Changeset 35775 in webkit for trunk/JavaScriptCore
- Timestamp:
- Aug 15, 2008, 12:43:48 AM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/APICast.h
r35442 r35775 41 41 typedef const struct OpaqueJSContext* JSContextRef; 42 42 typedef struct OpaqueJSContext* JSGlobalContextRef; 43 typedef struct OpaqueJSString* JSStringRef;44 43 typedef struct OpaqueJSPropertyNameAccumulator* JSPropertyNameAccumulatorRef; 45 44 typedef const struct OpaqueJSValue* JSValueRef; … … 61 60 { 62 61 return reinterpret_cast<KJS::JSValue*>(const_cast<OpaqueJSValue*>(v)); 63 }64 65 inline KJS::UString::Rep* toJS(JSStringRef b)66 {67 return reinterpret_cast<KJS::UString::Rep*>(b);68 62 } 69 63 … … 91 85 { 92 86 return reinterpret_cast<JSValueRef*>(const_cast<const KJS::JSValue**>(v)); 93 }94 95 inline JSStringRef toRef(KJS::UString::Rep* s)96 {97 return reinterpret_cast<JSStringRef>(s);98 87 } 99 88 -
trunk/JavaScriptCore/API/JSBase.cpp
r35604 r35775 30 30 #include "APICast.h" 31 31 #include "completion.h" 32 #include "OpaqueJSString.h" 32 33 #include <kjs/ExecState.h> 33 34 #include <kjs/InitializeThreading.h> … … 44 45 45 46 JSObject* jsThisObject = toJS(thisObject); 46 UString::Rep* scriptRep = toJS(script);47 UString::Rep* sourceURLRep = sourceURL ? toJS(sourceURL) : &UString::Rep::null;48 47 49 48 // Interpreter::evaluate sets "this" to the global object if it is NULL 50 49 JSGlobalObject* globalObject = exec->dynamicGlobalObject(); 51 Completion completion = Interpreter::evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), UString(sourceURLRep), startingLineNumber, UString(scriptRep), jsThisObject);50 Completion completion = Interpreter::evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), sourceURL->ustring(), startingLineNumber, script->ustring(), jsThisObject); 52 51 53 52 if (completion.complType() == Throw) { … … 69 68 exec->globalData().heap->registerThread(); 70 69 71 UString::Rep* scriptRep = toJS(script); 72 UString::Rep* sourceURLRep = sourceURL ? toJS(sourceURL) : &UString::Rep::null; 73 Completion completion = Interpreter::checkSyntax(exec->dynamicGlobalObject()->globalExec(), UString(sourceURLRep), startingLineNumber, UString(scriptRep)); 70 Completion completion = Interpreter::checkSyntax(exec->dynamicGlobalObject()->globalExec(), sourceURL->ustring(), startingLineNumber, script->ustring()); 74 71 if (completion.complType() == Throw) { 75 72 if (exception) -
trunk/JavaScriptCore/API/JSCallbackObjectFunctions.h
r35478 r35775 34 34 #include "JSString.h" 35 35 #include "JSStringRef.h" 36 #include "OpaqueJSString.h" 36 37 #include "PropertyNameArray.h" 37 38 #include <wtf/Vector.h> … … 106 107 JSContextRef ctx = toRef(exec); 107 108 JSObjectRef thisRef = toRef(this); 108 JSStringRef propertyNameRef = toRef(propertyName.ustring().rep());109 RefPtr<OpaqueJSString> propertyNameRef; 109 110 110 111 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) { 111 112 // optional optimization to bypass getProperty in cases when we only need to know if the property exists 112 113 if (JSObjectHasPropertyCallback hasProperty = jsClass->hasProperty) { 113 if (hasProperty(ctx, thisRef, propertyNameRef)) { 114 if (!propertyNameRef) 115 propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 116 if (hasProperty(ctx, thisRef, propertyNameRef.get())) { 114 117 slot.setCustom(this, callbackGetter); 115 118 return true; 116 119 } 117 120 } else if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) { 118 if (JSValueRef value = getProperty(ctx, thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) { 121 if (!propertyNameRef) 122 propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 123 if (JSValueRef value = getProperty(ctx, thisRef, propertyNameRef.get(), toRef(exec->exceptionSlot()))) { 119 124 // cache the value so we don't have to compute it again 120 125 // FIXME: This violates the PropertySlot design a little bit. … … 154 159 JSContextRef ctx = toRef(exec); 155 160 JSObjectRef thisRef = toRef(this); 156 JSStringRef propertyNameRef = toRef(propertyName.ustring().rep());161 RefPtr<OpaqueJSString> propertyNameRef; 157 162 JSValueRef valueRef = toRef(value); 158 163 159 164 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) { 160 165 if (JSObjectSetPropertyCallback setProperty = jsClass->setProperty) { 161 if (setProperty(ctx, thisRef, propertyNameRef, valueRef, toRef(exec->exceptionSlot()))) 166 if (!propertyNameRef) 167 propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 168 if (setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, toRef(exec->exceptionSlot()))) 162 169 return; 163 170 } … … 168 175 return; 169 176 if (JSObjectSetPropertyCallback setProperty = entry->setProperty) { 170 if (setProperty(ctx, thisRef, propertyNameRef, valueRef, toRef(exec->exceptionSlot()))) 177 if (!propertyNameRef) 178 propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 179 if (setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, toRef(exec->exceptionSlot()))) 171 180 return; 172 181 } else … … 199 208 JSContextRef ctx = toRef(exec); 200 209 JSObjectRef thisRef = toRef(this); 201 JSStringRef propertyNameRef = toRef(propertyName.ustring().rep());210 RefPtr<OpaqueJSString> propertyNameRef; 202 211 203 212 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) { 204 213 if (JSObjectDeletePropertyCallback deleteProperty = jsClass->deleteProperty) { 205 if (deleteProperty(ctx, thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) 214 if (!propertyNameRef) 215 propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 216 if (deleteProperty(ctx, thisRef, propertyNameRef.get(), toRef(exec->exceptionSlot()))) 206 217 return true; 207 218 } … … 431 442 432 443 JSObjectRef thisRef = toRef(thisObj); 433 JSStringRef propertyNameRef = toRef(propertyName.ustring().rep());444 RefPtr<OpaqueJSString> propertyNameRef; 434 445 435 446 for (JSClassRef jsClass = thisObj->m_class; jsClass; jsClass = jsClass->parentClass) … … 437 448 if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep())) 438 449 if (JSObjectGetPropertyCallback getProperty = entry->getProperty) { 439 if (JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) 450 if (!propertyNameRef) 451 propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 452 if (JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), toRef(exec->exceptionSlot()))) 440 453 return toJS(value); 441 454 } … … 477 490 478 491 JSObjectRef thisRef = toRef(thisObj); 479 JSStringRef propertyNameRef = toRef(propertyName.ustring().rep());492 RefPtr<OpaqueJSString> propertyNameRef; 480 493 481 494 for (JSClassRef jsClass = thisObj->m_class; jsClass; jsClass = jsClass->parentClass) 482 495 if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) { 483 if (JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) 496 if (!propertyNameRef) 497 propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 498 if (JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), toRef(exec->exceptionSlot()))) 484 499 return toJS(value); 485 500 } -
trunk/JavaScriptCore/API/JSObjectRef.cpp
r35478 r35775 37 37 #include "JSGlobalObject.h" 38 38 #include "JSObject.h" 39 #include "JSRetainPtr.h" 39 40 #include "JSString.h" 40 41 #include "JSValueRef.h" … … 86 87 exec->globalData().heap->registerThread(); 87 88 88 Identifier nameID = name ? Identifier(exec, toJS(name)) : Identifier(exec, "anonymous");89 Identifier nameID = name ? name->identifier(exec) : Identifier(exec, "anonymous"); 89 90 90 91 return toRef(new (exec) JSCallbackFunction(exec, callAsFunction, nameID)); … … 110 111 exec->globalData().heap->registerThread(); 111 112 112 UString::Rep* bodyRep = toJS(body); 113 UString::Rep* sourceURLRep = sourceURL ? toJS(sourceURL) : &UString::Rep::null; 114 115 Identifier nameID = name ? Identifier(exec, toJS(name)) : Identifier(exec, "anonymous"); 113 Identifier nameID = name ? name->identifier(exec) : Identifier(exec, "anonymous"); 116 114 117 115 ArgList args; 118 116 for (unsigned i = 0; i < parameterCount; i++) 119 args.append(jsString(exec, UString( toJS(parameterNames[i]))));120 args.append(jsString(exec, UString(bodyRep)));121 122 JSObject* result = constructFunction(exec, args, nameID, UString(sourceURLRep), startingLineNumber);117 args.append(jsString(exec, UString(parameterNames[i]->ustring()))); 118 args.append(jsString(exec, body->ustring())); 119 120 JSObject* result = constructFunction(exec, args, nameID, sourceURL->ustring(), startingLineNumber); 123 121 if (exec->hadException()) { 124 122 if (exception) … … 150 148 151 149 JSObject* jsObject = toJS(object); 152 UString::Rep* nameRep = toJS(propertyName); 153 154 return jsObject->hasProperty(exec, Identifier(exec, nameRep)); 150 151 return jsObject->hasProperty(exec, propertyName->identifier(exec)); 155 152 } 156 153 … … 161 158 162 159 JSObject* jsObject = toJS(object); 163 UString::Rep* nameRep = toJS(propertyName); 164 165 JSValue* jsValue = jsObject->get(exec, Identifier(exec, nameRep)); 160 161 JSValue* jsValue = jsObject->get(exec, propertyName->identifier(exec)); 166 162 if (exec->hadException()) { 167 163 if (exception) … … 178 174 179 175 JSObject* jsObject = toJS(object); 180 Identifier name( exec, toJS(propertyName));176 Identifier name(propertyName->identifier(exec)); 181 177 JSValue* jsValue = toJS(value); 182 178 … … 232 228 233 229 JSObject* jsObject = toJS(object); 234 UString::Rep* nameRep = toJS(propertyName); 235 236 bool result = jsObject->deleteProperty(exec, Identifier(exec, nameRep)); 230 231 bool result = jsObject->deleteProperty(exec, propertyName->identifier(exec)); 237 232 if (exec->hadException()) { 238 233 if (exception) … … 338 333 } 339 334 340 struct OpaqueJSPropertyNameArray 341 { 342 OpaqueJSPropertyNameArray(JSGlobalData* globalData) : refCount(0), array(globalData) 335 struct OpaqueJSPropertyNameArray { 336 OpaqueJSPropertyNameArray(JSGlobalData* globalData) 337 : refCount(0) 338 , globalData(globalData) 343 339 { 344 340 } 345 341 346 342 unsigned refCount; 347 PropertyNameArray array; 343 JSGlobalData* globalData; 344 Vector<JSRetainPtr<JSStringRef> > array; 348 345 }; 349 346 … … 354 351 exec->globalData().heap->registerThread(); 355 352 356 JSPropertyNameArrayRef propertyNames = new OpaqueJSPropertyNameArray(&exec->globalData()); 357 jsObject->getPropertyNames(exec, propertyNames->array); 353 JSGlobalData* globalData = &exec->globalData(); 354 355 JSPropertyNameArrayRef propertyNames = new OpaqueJSPropertyNameArray(globalData); 356 PropertyNameArray array(globalData); 357 jsObject->getPropertyNames(exec, array); 358 359 size_t size = array.size(); 360 propertyNames->array.reserveCapacity(size); 361 for (size_t i = 0; i < size; ++i) 362 propertyNames->array.append(JSRetainPtr<JSStringRef>(Adopt, OpaqueJSString::create(array[i].ustring()).releaseRef())); 358 363 359 364 return JSPropertyNameArrayRetain(propertyNames); … … 379 384 JSStringRef JSPropertyNameArrayGetNameAtIndex(JSPropertyNameArrayRef array, size_t index) 380 385 { 381 return toRef(array->array[static_cast<unsigned>(index)].ustring().rep());386 return array->array[static_cast<unsigned>(index)].get(); 382 387 } 383 388 … … 385 390 { 386 391 PropertyNameArray* propertyNames = toJS(array); 387 UString::Rep* rep = toJS(propertyName);388 392 389 393 propertyNames->globalData()->heap->registerThread(); 390 394 391 propertyNames->add( Identifier(propertyNames->globalData(), rep));392 } 395 propertyNames->add(propertyName->identifier(propertyNames->globalData())); 396 } -
trunk/JavaScriptCore/API/JSStringRef.cpp
r35478 r35775 28 28 #include "JSStringRef.h" 29 29 30 #include <wtf/Platform.h> 31 32 #include "APICast.h" 33 #include <kjs/JSType.h> 34 #include <kjs/JSString.h> 35 #include <kjs/operations.h> 36 #include <kjs/ustring.h> 37 #include <kjs/JSValue.h> 30 #include "OpaqueJSString.h" 38 31 #include <wtf/unicode/UTF8.h> 39 32 … … 43 36 JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars) 44 37 { 45 return toRef(UString(chars, static_cast<int>(numChars)).rep()->ref());38 return OpaqueJSString::create(chars, numChars).releaseRef(); 46 39 } 47 40 48 41 JSStringRef JSStringCreateWithUTF8CString(const char* string) 49 42 { 50 RefPtr<UString::Rep> result = UString::Rep::createFromUTF8(string); 51 if (result.get() == &UString::Rep::null) 52 return 0; 43 if (string) { 44 size_t length = strlen(string); 45 Vector<UChar, 1024> buffer(length); 46 UChar* p = buffer.data(); 47 if (conversionOK == convertUTF8ToUTF16(&string, string + length, &p, p + length)) 48 return OpaqueJSString::create(buffer.data(), p - buffer.data()).releaseRef(); 49 } 53 50 54 return toRef(result.release().releaseRef()); 51 // Null string. 52 return OpaqueJSString::create().releaseRef(); 55 53 } 56 54 57 55 JSStringRef JSStringRetain(JSStringRef string) 58 56 { 59 UString::Rep* rep = toJS(string);60 return toRef(rep->ref());57 string->ref(); 58 return string; 61 59 } 62 60 63 61 void JSStringRelease(JSStringRef string) 64 62 { 65 UString::Rep* rep = toJS(string); 66 bool needsLocking = rep->identifierTable(); 67 if (needsLocking) { 68 // It is wasteful to take the lock for non-shared contexts, but we don't have a good way 69 // to determine what the context is. 70 rep->deref(); 71 } else 72 rep->deref(); 63 string->deref(); 73 64 } 74 65 75 66 size_t JSStringGetLength(JSStringRef string) 76 67 { 77 UString::Rep* rep = toJS(string); 78 return rep->size(); 68 return string->length(); 79 69 } 80 70 81 71 const JSChar* JSStringGetCharactersPtr(JSStringRef string) 82 72 { 83 UString::Rep* rep = toJS(string); 84 return reinterpret_cast<const JSChar*>(rep->data()); 73 return string->characters(); 85 74 } 86 75 87 76 size_t JSStringGetMaximumUTF8CStringSize(JSStringRef string) 88 77 { 89 UString::Rep* rep = toJS(string);90 91 78 // Any UTF8 character > 3 bytes encodes as a UTF16 surrogate pair. 92 return rep->size() * 3 + 1; // + 1 for terminating '\0'79 return string->length() * 3 + 1; // + 1 for terminating '\0' 93 80 } 94 81 95 82 size_t JSStringGetUTF8CString(JSStringRef string, char* buffer, size_t bufferSize) 96 83 { 97 UString::Rep* rep = toJS(string);98 CString cString = UString(rep).UTF8String();84 if (!bufferSize) 85 return 0; 99 86 100 size_t length = std::min(bufferSize, cString.size() + 1); // + 1 for terminating '\0' 101 memcpy(buffer, cString.c_str(), length); 102 return length; 87 char* p = buffer; 88 const UChar* d = string->characters(); 89 ConversionResult result = convertUTF16ToUTF8(&d, d + string->length(), &p, p + bufferSize - 1, true); 90 *p++ = '\0'; 91 if (result != conversionOK && result != targetExhausted) 92 return 0; 93 94 return p - buffer; 103 95 } 104 96 105 97 bool JSStringIsEqual(JSStringRef a, JSStringRef b) 106 98 { 107 UString::Rep* aRep = toJS(a); 108 UString::Rep* bRep = toJS(b); 109 110 return UString(aRep) == UString(bRep); 99 unsigned len = a->length(); 100 return len == b->length() && 0 == memcmp(a->characters(), b->characters(), len * sizeof(UChar)); 111 101 } 112 102 -
trunk/JavaScriptCore/API/JSStringRefCF.cpp
r35227 r35775 30 30 #include "APICast.h" 31 31 #include "JSStringRef.h" 32 #include "OpaqueJSString.h" 32 33 #include <kjs/ustring.h> 33 34 #include <kjs/JSValue.h> 34 35 using namespace KJS; 35 #include <wtf/OwnArrayPtr.h> 36 36 37 37 JSStringRef JSStringCreateWithCFString(CFStringRef string) 38 38 { 39 39 CFIndex length = CFStringGetLength(string); 40 UString::Rep* rep; 41 if (!length) 42 rep = UString("").rep()->ref(); 43 else { 44 UniChar* buffer = static_cast<UniChar*>(fastMalloc(sizeof(UniChar) * length)); 45 CFStringGetCharacters(string, CFRangeMake(0, length), buffer); 40 if (length) { 41 OwnArrayPtr<UniChar> buffer(new UniChar[length]); 42 CFStringGetCharacters(string, CFRangeMake(0, length), buffer.get()); 46 43 COMPILE_ASSERT(sizeof(UniChar) == sizeof(UChar), unichar_and_uchar_must_be_same_size); 47 rep = UString(reinterpret_cast<UChar*>(buffer), length, false).rep()->ref(); 44 return OpaqueJSString::create(buffer.get(), length).releaseRef(); 45 } else { 46 return OpaqueJSString::create(0, 0).releaseRef(); 48 47 } 49 return toRef(rep); 50 } 48 } 51 49 52 50 CFStringRef JSStringCopyCFString(CFAllocatorRef alloc, JSStringRef string) 53 51 { 54 UString::Rep* rep = toJS(string); 55 return CFStringCreateWithCharacters(alloc, reinterpret_cast<const UniChar*>(rep->data()), rep->size()); 52 return CFStringCreateWithCharacters(alloc, reinterpret_cast<const UniChar*>(string->characters()), string->length()); 56 53 } -
trunk/JavaScriptCore/API/JSValueRef.cpp
r35478 r35775 189 189 exec->globalData().heap->registerThread(); 190 190 191 UString::Rep* rep = toJS(string); 192 return toRef(jsString(exec, UString(rep))); 191 return toRef(jsString(exec, string->ustring())); 193 192 } 194 193 … … 224 223 JSValue* jsValue = toJS(value); 225 224 226 JSStringRef stringRef = toRef(jsValue->toString(exec).rep()->ref());227 if (exec->hadException()) { 228 if (exception) 229 *exception = toRef(exec->exception()); 230 exec->clearException(); 231 stringRef = 0;232 } 233 return stringRef ;225 RefPtr<OpaqueJSString> stringRef(OpaqueJSString::create(jsValue->toString(exec))); 226 if (exec->hadException()) { 227 if (exception) 228 *exception = toRef(exec->exception()); 229 exec->clearException(); 230 stringRef.clear(); 231 } 232 return stringRef.release().releaseRef(); 234 233 } 235 234 -
trunk/JavaScriptCore/ChangeLog
r35756 r35775 1 2008-08-15 Alexey Proskuryakov <[email protected]> 2 3 Reviewed by Geoff Garen. 4 5 JSStringRef is created context-free, but can get linked to one via an identifier table, 6 breaking an implicit API contract. 7 8 Made JSStringRef point to OpaqueJSString, which is a new string object separate from UString. 9 10 * API/APICast.h: Removed toRef/toJS conversions for JSStringRef, as this is no longer a 11 simple typecast. 12 13 * kjs/identifier.cpp: 14 (KJS::Identifier::checkSameIdentifierTable): 15 * kjs/identifier.h: 16 (KJS::Identifier::add): 17 (KJS::UString::checkSameIdentifierTable): 18 Added assertions to verify that an identifier is not being added to a different JSGlobalData. 19 20 * API/JSObjectRef.cpp: 21 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray): Changed OpaqueJSPropertyNameArray to 22 hold JSStringRefs. This is necessary to avoid having to construct (and leak) a new instance 23 in JSPropertyNameArrayGetNameAtIndex(), now that making a JSStringRef is not just a typecast. 24 25 * API/OpaqueJSString.cpp: Added. 26 (OpaqueJSString::create): 27 (OpaqueJSString::ustring): 28 (OpaqueJSString::identifier): 29 * API/OpaqueJSString.h: Added. 30 (OpaqueJSString::create): 31 (OpaqueJSString::characters): 32 (OpaqueJSString::length): 33 (OpaqueJSString::OpaqueJSString): 34 (OpaqueJSString::~OpaqueJSString): 35 36 * API/JSBase.cpp: 37 (JSEvaluateScript): 38 (JSCheckScriptSyntax): 39 * API/JSCallbackObjectFunctions.h: 40 (KJS::::getOwnPropertySlot): 41 (KJS::::put): 42 (KJS::::deleteProperty): 43 (KJS::::staticValueGetter): 44 (KJS::::callbackGetter): 45 * API/JSStringRef.cpp: 46 (JSStringCreateWithCharacters): 47 (JSStringCreateWithUTF8CString): 48 (JSStringRetain): 49 (JSStringRelease): 50 (JSStringGetLength): 51 (JSStringGetCharactersPtr): 52 (JSStringGetMaximumUTF8CStringSize): 53 (JSStringGetUTF8CString): 54 (JSStringIsEqual): 55 * API/JSStringRefCF.cpp: 56 (JSStringCreateWithCFString): 57 (JSStringCopyCFString): 58 * API/JSValueRef.cpp: 59 (JSValueMakeString): 60 (JSValueToStringCopy): 61 Updated to use OpaqueJSString. 62 63 * GNUmakefile.am: 64 * JavaScriptCore.exp: 65 * JavaScriptCore.pri: 66 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 67 * JavaScriptCore.xcodeproj/project.pbxproj: 68 * JavaScriptCoreSources.bkl: 69 Added OpaqueJSString. 70 1 71 2008-08-14 Kevin McCullough <[email protected]> 2 72 -
trunk/JavaScriptCore/GNUmakefile.am
r35658 r35775 48 48 JavaScriptCore/API/JSStringRef.cpp \ 49 49 JavaScriptCore/API/JSValueRef.cpp \ 50 JavaScriptCore/API/OpaqueJSString.cpp \ 50 51 JavaScriptCore/ForwardingHeaders/JavaScriptCore/APICast.h \ 51 52 JavaScriptCore/ForwardingHeaders/JavaScriptCore/JSBase.h \ -
trunk/JavaScriptCore/JavaScriptCore.exp
r35691 r35775 77 77 __Z15jsRegExpCompilePKti24JSRegExpIgnoreCaseOption23JSRegExpMultilineOptionPjPPKc 78 78 __Z15jsRegExpExecutePK8JSRegExpPKtiiPii 79 __ZN14OpaqueJSStringD1Ev 79 80 __ZN3KJS10Identifier11addSlowCaseEPNS_12JSGlobalDataEPNS_7UString3RepE 80 81 __ZN3KJS10Identifier11addSlowCaseEPNS_9ExecStateEPNS_7UString3RepE 82 __ZN3KJS10Identifier24checkSameIdentifierTableEPNS_12JSGlobalDataEPNS_7UString3RepE 83 __ZN3KJS10Identifier24checkSameIdentifierTableEPNS_9ExecStateEPNS_7UString3RepE 81 84 __ZN3KJS10Identifier3addEPNS_9ExecStateEPKc 82 85 __ZN3KJS10Identifier5equalEPKNS_7UString3RepEPKc -
trunk/JavaScriptCore/JavaScriptCore.pri
r35478 r35775 46 46 API/JSStringRef.cpp \ 47 47 API/JSValueRef.cpp \ 48 API/OpaqueJSString.cpp \ 48 49 kjs/InitializeThreading.cpp \ 49 50 kjs/JSGlobalData.cpp \ -
trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r35478 r35775 1103 1103 </File> 1104 1104 <File 1105 RelativePath="..\..\API\OpaqueJSString.cpp" 1106 > 1107 </File> 1108 <File 1109 RelativePath="..\..\API\OpaqueJSString.h" 1110 > 1111 </File> 1112 <File 1105 1113 RelativePath="..\..\API\WebKitAvailability.h" 1106 1114 > -
trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r35691 r35775 275 275 BCF605140E203EF800B9A64D /* ArgList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF605120E203EF800B9A64D /* ArgList.h */; settings = {ATTRIBUTES = (Private, ); }; }; 276 276 C0A272630E50A06300E96E15 /* NotFound.h in Headers */ = {isa = PBXBuildFile; fileRef = C0A2723F0E509F1E00E96E15 /* NotFound.h */; settings = {ATTRIBUTES = (Private, ); }; }; 277 E124A8F70E555775003091F1 /* OpaqueJSString.h in Headers */ = {isa = PBXBuildFile; fileRef = E124A8F50E555775003091F1 /* OpaqueJSString.h */; }; 278 E124A8F80E555775003091F1 /* OpaqueJSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E124A8F60E555775003091F1 /* OpaqueJSString.cpp */; }; 277 279 E178636D0D9BEEC300D74E75 /* InitializeThreading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E178636C0D9BEEC300D74E75 /* InitializeThreading.cpp */; }; 278 280 E18E3A590DF9278C00D90B34 /* JSGlobalData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18E3A570DF9278C00D90B34 /* JSGlobalData.cpp */; }; … … 704 706 D21202290AD4310C00ED79B6 /* DateMath.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DateMath.h; sourceTree = "<group>"; }; 705 707 E11D51750B2E798D0056C188 /* StringExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringExtras.h; sourceTree = "<group>"; }; 708 E124A8F50E555775003091F1 /* OpaqueJSString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpaqueJSString.h; sourceTree = "<group>"; }; 709 E124A8F60E555775003091F1 /* OpaqueJSString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OpaqueJSString.cpp; sourceTree = "<group>"; }; 706 710 E178633F0D9BEC0000D74E75 /* InitializeThreading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitializeThreading.h; sourceTree = "<group>"; }; 707 711 E178636C0D9BEEC300D74E75 /* InitializeThreading.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InitializeThreading.cpp; sourceTree = "<group>"; }; … … 907 911 14BD5A2B0A3E91F600BAF59C /* JSValueRef.cpp */, 908 912 1482B6EA0A4300B300517CFC /* JSValueRef.h */, 913 E124A8F60E555775003091F1 /* OpaqueJSString.cpp */, 914 E124A8F50E555775003091F1 /* OpaqueJSString.h */, 909 915 5DE3D0F40DD8DDFB00468714 /* WebKitAvailability.h */, 910 916 ); … … 1514 1520 8613F45B0E3A433E00C948FD /* SamplingTool.h in Headers */, 1515 1521 C0A272630E50A06300E96E15 /* NotFound.h in Headers */, 1522 E124A8F70E555775003091F1 /* OpaqueJSString.h in Headers */, 1516 1523 ); 1517 1524 runOnlyForDeploymentPostprocessing = 0; … … 1619 1626 projectDirPath = ""; 1620 1627 projectRoot = ""; 1621 projectRoots = (1622 "",1623 );1624 1628 targets = ( 1625 1629 932F5BE30822A1C700736975 /* All */, … … 1821 1825 905B02AE0E28640F006DF882 /* RefCountedLeakCounter.cpp in Sources */, 1822 1826 8613F45A0E3A433E00C948FD /* SamplingTool.cpp in Sources */, 1827 E124A8F80E555775003091F1 /* OpaqueJSString.cpp in Sources */, 1823 1828 ); 1824 1829 runOnlyForDeploymentPostprocessing = 0; -
trunk/JavaScriptCore/JavaScriptCoreSources.bkl
r35478 r35775 40 40 API/JSStringRef.cpp 41 41 API/JSValueRef.cpp 42 API/OpaqueJSString.cpp 42 43 </set> 43 44 -
trunk/JavaScriptCore/kjs/identifier.cpp
r35478 r35775 224 224 } 225 225 226 #ifndef NDEBUG 227 void Identifier::checkSameIdentifierTable(ExecState* exec, UString::Rep* rep) 228 { 229 ASSERT(rep->identifierTable() == exec->identifierTable()); 230 } 231 232 void Identifier::checkSameIdentifierTable(JSGlobalData* globalData, UString::Rep* rep) 233 { 234 ASSERT(rep->identifierTable() == globalData->identifierTable); 235 } 236 237 #endif 238 226 239 } // namespace KJS -
trunk/JavaScriptCore/kjs/identifier.h
r35418 r35775 92 92 static PassRefPtr<UString::Rep> add(ExecState* exec, UString::Rep* r) 93 93 { 94 if (r->identifierTable()) 94 if (r->identifierTable()) { 95 checkSameIdentifierTable(exec, r); 95 96 return r; 97 } 96 98 return addSlowCase(exec, r); 97 99 } 98 100 static PassRefPtr<UString::Rep> add(JSGlobalData* globalData, UString::Rep* r) 99 101 { 100 if (r->identifierTable()) 102 if (r->identifierTable()) { 103 checkSameIdentifierTable(globalData, r); 101 104 return r; 105 } 102 106 return addSlowCase(globalData, r); 103 107 } … … 105 109 static PassRefPtr<UString::Rep> addSlowCase(ExecState*, UString::Rep* r); 106 110 static PassRefPtr<UString::Rep> addSlowCase(JSGlobalData*, UString::Rep* r); 111 112 static void checkSameIdentifierTable(ExecState*, UString::Rep*); 113 static void checkSameIdentifierTable(JSGlobalData*, UString::Rep*); 107 114 }; 108 115 … … 122 129 } 123 130 131 #ifdef NDEBUG 132 void UString::checkSameIdentifierTable(ExecState*, UString::Rep*) {} 133 void UString::checkSameIdentifierTable(JSGlobalData*, UString::Rep*) {} 134 #endif 135 124 136 IdentifierTable* createIdentifierTable(); 125 137 void deleteIdentifierTable(IdentifierTable*);
Note:
See TracChangeset
for help on using the changeset viewer.