Changeset 58286 in webkit for trunk/JavaScriptCore
- Timestamp:
- Apr 26, 2010, 9:22:46 PM (15 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 3 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r58284 r58286 1 2010-04-26 Oliver Hunt <[email protected]> 2 3 Reviewed by Gavin Barraclough. 4 5 Need to support more efficient dispatch of lightweight builtins 6 https://bugs.webkit.org/show_bug.cgi?id=38155 7 8 The problem with calling lightweight builtins is that marshalling 9 the call from the nitro calling convention to the system calling 10 convention is very expensive relative to the cost of the actually 11 evaluating the function. To work around this problem this patch 12 adds the ability to define a custom thunk for a builtin. 13 14 This allows us to use high performance custom implementations of 15 the common and sensible versions of simple builtins. This patch 16 includes a simple (use of which is currently hardcoded) thunk for 17 charCodeAt. 18 19 This adds a JSInterfaceJIT subclass called SpecializedThunkJIT 20 that has helper functions to remove (or at least reduce) the need 21 to have separate thunk implementations for each JSValue encoding. 22 23 * GNUmakefile.am: 24 * JavaScriptCore.pro: 25 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 26 * JavaScriptCore.xcodeproj/project.pbxproj: 27 Many project file updates 28 29 * create_hash_table: 30 Add thunk generation callbacks to the hash tables, currently 31 we hardcode the script to only support charCodeAt 32 33 * jit/JITStubCall.h: 34 * jit/JITStubs.cpp: 35 (JSC::JITThunks::~JITThunks): 36 (JSC::JITThunks::specializedThunk): 37 * jit/JITStubs.h: 38 * jit/SpecializedThunkJIT.h: Added. 39 (JSC::SpecializedThunkJIT::SpecializedThunkJIT): 40 (JSC::SpecializedThunkJIT::loadCellArgument): 41 (JSC::SpecializedThunkJIT::loadJSStringArgument): 42 (JSC::SpecializedThunkJIT::loadInt32Argument): 43 (JSC::SpecializedThunkJIT::appendFailure): 44 (JSC::SpecializedThunkJIT::returnInt32): 45 (JSC::SpecializedThunkJIT::finalize): 46 (JSC::SpecializedThunkJIT::argumentToVirtualRegister): 47 (JSC::SpecializedThunkJIT::tagReturnAsInt32): 48 * jit/ThunkGenerators.cpp: Added. 49 (JSC::ThunkHelpers::stringImplDataOffset): 50 (JSC::ThunkHelpers::jsStringLengthOffset): 51 (JSC::ThunkHelpers::jsStringValueOffset): 52 (JSC::charCodeAtThunkGenerator): 53 * jit/ThunkGenerators.h: Added. 54 * runtime/Executable.h: 55 (JSC::NativeExecutable::NativeExecutable): 56 * runtime/JSFunction.cpp: 57 (JSC::JSFunction::JSFunction): 58 * runtime/JSFunction.h: 59 * runtime/JSGlobalData.h: 60 (JSC::JSGlobalData::getThunk): 61 * runtime/JSString.h: 62 (JSC::): 63 * runtime/JSValue.h: 64 Protect some of the JSVALUE32 and JSVALUE32_64 only constants 65 and function behind appropriate USE() guards to make it harder 66 to use the wrong flags for the target build. 67 * runtime/Lookup.cpp: 68 (JSC::HashTable::createTable): 69 (JSC::setUpStaticFunctionSlot): 70 * runtime/Lookup.h: 71 (JSC::HashEntry::initialize): 72 (JSC::HashEntry::generator): 73 (JSC::HashEntry::): 74 Make the lookup tables use a specialized thunkGenerator 75 if present 76 * wtf/text/StringImpl.h: 77 1 78 2010-04-26 Oliver Hunt <[email protected]> 2 79 -
trunk/JavaScriptCore/GNUmakefile.am
r58206 r58286 96 96 JavaScriptCore/jit/JITStubs.h \ 97 97 JavaScriptCore/jit/JITStubCall.h \ 98 JavaScriptCore/jit/JSInterfaceJIT.h \ 99 JavaScriptCore/jit/SpecializedThunkJIT.h \ 100 JavaScriptCore/jit/ThunkGenerators.cpp \ 101 JavaScriptCore/jit/ThunkGenerators.h \ 98 102 JavaScriptCore/bytecode/StructureStubInfo.cpp \ 99 103 JavaScriptCore/bytecode/StructureStubInfo.h \ -
trunk/JavaScriptCore/JavaScriptCore.pro
r58136 r58286 104 104 jit/JITPropertyAccess32_64.cpp \ 105 105 jit/JITStubs.cpp \ 106 jit/ThunkGenerators.cpp \ 106 107 parser/Lexer.cpp \ 107 108 parser/Nodes.cpp \ -
trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r58003 r58286 1703 1703 <File 1704 1704 RelativePath="..\..\jit\JITStubs.h" 1705 > 1706 </File> 1707 <File 1708 RelativePath="..\..\jit\JSInterfaceJIT.h" 1709 > 1710 </File> 1711 <File 1712 RelativePath="..\..\jit\SpecializedThunkJIT.h" 1713 > 1714 </File> 1715 <File 1716 RelativePath="..\..\jit\ThunkGenerators.cpp" 1717 > 1718 </File> 1719 <File 1720 RelativePath="..\..\jit\ThunkGenerators.h" 1705 1721 > 1706 1722 </File> -
trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r58283 r58286 292 292 A727FF6B0DA3092200E548D7 /* JSPropertyNameIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */; }; 293 293 A7280A2811557E3000D56957 /* JSObjectRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A79EDB0811531CD60019E912 /* JSObjectRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 294 A73161FE118692FF00BB280D /* JSInterfaceJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = A73161FD118692FF00BB280D /* JSInterfaceJIT.h */; }; 294 A7386554118697B400540279 /* SpecializedThunkJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = A7386551118697B400540279 /* SpecializedThunkJIT.h */; }; 295 A7386555118697B400540279 /* ThunkGenerators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7386552118697B400540279 /* ThunkGenerators.cpp */; }; 296 A7386556118697B400540279 /* ThunkGenerators.h in Headers */ = {isa = PBXBuildFile; fileRef = A7386553118697B400540279 /* ThunkGenerators.h */; settings = {ATTRIBUTES = (Private, ); }; }; 295 297 A7482B9311671147003B0712 /* JSWeakObjectMapRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7482B791166CDEA003B0712 /* JSWeakObjectMapRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 296 298 A7482B9411671147003B0712 /* JSWeakObjectMapRefPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7482B7A1166CDEA003B0712 /* JSWeakObjectMapRefPrivate.cpp */; }; … … 298 300 A74B3499102A5F8E0032AB98 /* MarkStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A74B3498102A5F8E0032AB98 /* MarkStack.cpp */; }; 299 301 A766B44F0EE8DCD1009518CA /* ExecutableAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 302 A76C51761182748D00715B05 /* JSInterfaceJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = A76C51741182748D00715B05 /* JSInterfaceJIT.h */; }; 300 303 A76EE6590FAE59D5003F069A /* NativeFunctionWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = A76EE6580FAE59D5003F069A /* NativeFunctionWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; }; 301 304 A7795590101A74D500114E55 /* MarkStack.h in Headers */ = {isa = PBXBuildFile; fileRef = A779558F101A74D500114E55 /* MarkStack.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 873 876 A727FF650DA3053B00E548D7 /* JSPropertyNameIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPropertyNameIterator.h; sourceTree = "<group>"; }; 874 877 A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPropertyNameIterator.cpp; sourceTree = "<group>"; }; 875 A73161FD118692FF00BB280D /* JSInterfaceJIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInterfaceJIT.h; sourceTree = "<group>"; }; 878 A7386551118697B400540279 /* SpecializedThunkJIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpecializedThunkJIT.h; sourceTree = "<group>"; }; 879 A7386552118697B400540279 /* ThunkGenerators.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThunkGenerators.cpp; sourceTree = "<group>"; }; 880 A7386553118697B400540279 /* ThunkGenerators.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThunkGenerators.h; sourceTree = "<group>"; }; 876 881 A7482B791166CDEA003B0712 /* JSWeakObjectMapRefPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWeakObjectMapRefPrivate.h; sourceTree = "<group>"; }; 877 882 A7482B7A1166CDEA003B0712 /* JSWeakObjectMapRefPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWeakObjectMapRefPrivate.cpp; sourceTree = "<group>"; }; 878 883 A7482E37116A697B003B0712 /* JSWeakObjectMapRefInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWeakObjectMapRefInternal.h; sourceTree = "<group>"; }; 879 884 A74B3498102A5F8E0032AB98 /* MarkStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkStack.cpp; sourceTree = "<group>"; }; 885 A76C51741182748D00715B05 /* JSInterfaceJIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInterfaceJIT.h; sourceTree = "<group>"; }; 880 886 A76EE6580FAE59D5003F069A /* NativeFunctionWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeFunctionWrapper.h; sourceTree = "<group>"; }; 881 887 A779558F101A74D500114E55 /* MarkStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkStack.h; sourceTree = "<group>"; }; … … 1207 1213 isa = PBXGroup; 1208 1214 children = ( 1215 A7386551118697B400540279 /* SpecializedThunkJIT.h */, 1216 A7386552118697B400540279 /* ThunkGenerators.cpp */, 1217 A7386553118697B400540279 /* ThunkGenerators.h */, 1209 1218 A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */, 1210 1219 A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */, … … 1224 1233 14A23D6C0F4E19CE0023CDAD /* JITStubs.cpp */, 1225 1234 14A6581A0F4E36F4000150FD /* JITStubs.h */, 1226 A7 3161FD118692FF00BB280D/* JSInterfaceJIT.h */,1235 A76C51741182748D00715B05 /* JSInterfaceJIT.h */, 1227 1236 ); 1228 1237 path = jit; … … 2116 2125 BC5F7BBF11823B590052C02C /* ThreadingPrimitives.h in Headers */, 2117 2126 BC5F7BC011823B590052C02C /* ThreadSafeShared.h in Headers */, 2118 A73161FE118692FF00BB280D /* JSInterfaceJIT.h in Headers */, 2127 A76C51761182748D00715B05 /* JSInterfaceJIT.h in Headers */, 2128 A7386554118697B400540279 /* SpecializedThunkJIT.h in Headers */, 2129 A7386556118697B400540279 /* ThunkGenerators.h in Headers */, 2119 2130 ); 2120 2131 runOnlyForDeploymentPostprocessing = 0; … … 2565 2576 86B99AB8117E391E00DF5A90 /* RopeImpl.cpp in Sources */, 2566 2577 511FC4C9117EE28700425272 /* MD5.cpp in Sources */, 2578 A7386555118697B400540279 /* ThunkGenerators.cpp in Sources */, 2567 2579 ); 2568 2580 runOnlyForDeploymentPostprocessing = 0; -
trunk/JavaScriptCore/create_hash_table
r55311 r58286 248 248 } 249 249 my $count = scalar @keys + 1; 250 print "#if ENABLE(JIT)\n"; 251 print "#define THUNK_GENERATOR(generator) , generator\n"; 252 print "#else\n"; 253 print "#define THUNK_GENERATOR(generator)\n"; 254 print "#endif\n"; 250 255 print "\nstatic const struct HashTableValue ${nameEntries}\[$count\] = {\n"; 251 256 my $i = 0; … … 267 272 $secondValue = "0"; 268 273 } 269 print " { \"$key\", $attrs[$i], (intptr_t)" . $castStr . "($firstValue), (intptr_t)$secondValue },\n"; 274 my $thunkGenerator = "0"; 275 if ($key eq "charCodeAt") { 276 $thunkGenerator = "charCodeAtThunkGenerator"; 277 } 278 print " { \"$key\", $attrs[$i], (intptr_t)" . $castStr . "($firstValue), (intptr_t)$secondValue THUNK_GENERATOR($thunkGenerator) },\n"; 270 279 $i++; 271 280 } 272 print " { 0, 0, 0, 0 }\n";281 print " { 0, 0, 0, 0 THUNK_GENERATOR(0) }\n"; 273 282 print "};\n\n"; 283 print "#undef THUNK_GENERATOR\n"; 274 284 print "extern JSC_CONST_HASHTABLE HashTable $name =\n"; 275 285 print " \{ $compactSize, $compactHashSizeMask, $nameEntries, 0 \};\n"; -
trunk/JavaScriptCore/jit/JITStubCall.h
r50594 r58286 117 117 m_stackIndex += stackIndexStep; 118 118 } 119 119 120 #if USE(JSVALUE32_64) 120 121 void addArgument(const JSValue& value) 121 122 { … … 124 125 m_stackIndex += stackIndexStep; 125 126 } 127 #endif 126 128 127 129 void addArgument(JIT::RegisterID tag, JIT::RegisterID payload) -
trunk/JavaScriptCore/jit/JITStubs.cpp
r58167 r58286 837 837 838 838 #endif 839 } 840 841 JITThunks::~JITThunks() 842 { 839 843 } 840 844 … … 3304 3308 } 3305 3309 3310 NativeExecutable* JITThunks::specializedThunk(JSGlobalData* globalData, ThunkGenerator generator) 3311 { 3312 std::pair<ThunkMap::iterator, bool> entry = m_thunkMap.add(generator, 0); 3313 if (!entry.second) 3314 return entry.first->second.get(); 3315 entry.first->second = generator(globalData, m_executablePool.get()); 3316 return entry.first->second.get(); 3317 } 3318 3306 3319 } // namespace JSC 3307 3320 -
trunk/JavaScriptCore/jit/JITStubs.h
r57955 r58286 32 32 #include "MacroAssemblerCodeRef.h" 33 33 #include "Register.h" 34 #include "ThunkGenerators.h" 35 #include <wtf/HashMap.h> 34 36 35 37 #if ENABLE(JIT) … … 44 46 class Identifier; 45 47 class JSGlobalData; 46 class JSGlobal Data;48 class JSGlobalObject; 47 49 class JSObject; 48 50 class JSPropertyNameIterator; 49 51 class JSValue; 50 52 class JSValueEncodedAsPointer; 53 class NativeExecutable; 51 54 class Profiler; 52 55 class PropertySlot; 53 56 class PutPropertySlot; 54 57 class RegisterFile; 55 class JSGlobalObject;56 58 class RegExp; 57 59 … … 266 268 public: 267 269 JITThunks(JSGlobalData*); 270 ~JITThunks(); 268 271 269 272 static void tryCacheGetByID(CallFrame*, CodeBlock*, ReturnAddressPtr returnAddress, JSValue baseValue, const Identifier& propertyName, const PropertySlot&, StructureStubInfo* stubInfo); … … 276 279 MacroAssemblerCodePtr ctiSoftModulo() { return m_trampolineStructure.ctiSoftModulo; } 277 280 281 NativeExecutable* specializedThunk(JSGlobalData* globalData, ThunkGenerator generator); 278 282 private: 283 typedef HashMap<ThunkGenerator, RefPtr<NativeExecutable> > ThunkMap; 284 ThunkMap m_thunkMap; 279 285 RefPtr<ExecutablePool> m_executablePool; 280 286 -
trunk/JavaScriptCore/runtime/Executable.h
r48905 r58286 88 88 m_jitCode = JITCode(JITCode::HostFunction(exec->globalData().jitStubs.ctiNativeCallThunk())); 89 89 } 90 NativeExecutable(JITCode thunk) 91 : ExecutableBase(NUM_PARAMETERS_IS_HOST) 92 { 93 m_jitCode = thunk; 94 } 90 95 91 96 ~NativeExecutable(); -
trunk/JavaScriptCore/runtime/JSFunction.cpp
r55564 r58286 57 57 } 58 58 59 JSFunction::JSFunction(ExecState* exec, NonNullPassRefPtr<Structure> structure, int length, const Identifier& name, NativeExecutable* thunk, NativeFunction func) 60 : Base(&exec->globalData(), structure, name) 61 #if ENABLE(JIT) 62 , m_executable(thunk) 63 #endif 64 { 65 #if ENABLE(JIT) 66 setNativeFunction(func); 67 putDirect(exec->propertyNames().length, jsNumber(exec, length), DontDelete | ReadOnly | DontEnum); 68 #else 69 UNUSED_PARAM(thunk); 70 UNUSED_PARAM(length); 71 UNUSED_PARAM(func); 72 ASSERT_NOT_REACHED(); 73 #endif 74 } 75 59 76 JSFunction::JSFunction(ExecState* exec, NonNullPassRefPtr<Structure> structure, int length, const Identifier& name, NativeFunction func) 60 77 : Base(&exec->globalData(), structure, name) -
trunk/JavaScriptCore/runtime/JSFunction.h
r56085 r58286 34 34 class JSActivation; 35 35 class JSGlobalObject; 36 class NativeExecutable; 36 37 37 38 class JSFunction : public InternalFunction { … … 43 44 public: 44 45 JSFunction(ExecState*, NonNullPassRefPtr<Structure>, int length, const Identifier&, NativeFunction); 46 JSFunction(ExecState*, NonNullPassRefPtr<Structure>, int length, const Identifier&, NativeExecutable*, NativeFunction); 45 47 JSFunction(ExecState*, NonNullPassRefPtr<FunctionExecutable>, ScopeChainNode*); 46 48 virtual ~JSFunction(); -
trunk/JavaScriptCore/runtime/JSGlobalData.h
r58133 r58286 172 172 #if ENABLE(JIT) 173 173 JITThunks jitStubs; 174 NativeExecutable* getThunk(ThunkGenerator generator) 175 { 176 return jitStubs.specializedThunk(this, generator); 177 } 174 178 #endif 175 179 TimeoutChecker timeoutChecker; … … 221 225 void createNativeThunk(); 222 226 }; 223 227 224 228 } // namespace JSC 225 229 -
trunk/JavaScriptCore/runtime/JSImmediate.h
r58284 r58286 138 138 friend class JSFastMath; 139 139 friend class JSInterfaceJIT; 140 friend class SpecializedThunkJIT; 140 141 friend JSValue jsNumber(ExecState* exec, double d); 141 142 friend JSValue jsNumber(ExecState*, char i); … … 166 167 // with a 16-bit pattern within the range 0x0001..0xFFFE. 167 168 static const intptr_t DoubleEncodeOffset = 0x1000000000000ll; 168 #el se169 #elif USE(JSVALUE32) 169 170 static const intptr_t TagTypeNumber = 0x1; // bottom bit set indicates integer, this dominates the following bit 170 171 #endif -
trunk/JavaScriptCore/runtime/JSString.h
r57912 r58286 67 67 friend class JIT; 68 68 friend class JSGlobalData; 69 friend class SpecializedThunkJIT; 70 friend struct ThunkHelpers; 69 71 70 72 class RopeBuilder { -
trunk/JavaScriptCore/runtime/JSValue.h
r58284 r58286 68 68 friend class JITStubCall; 69 69 friend class JSInterfaceJIT; 70 friend class SpecializedThunkJIT; 70 71 71 72 public: … … 216 217 JSObject* toThisObjectSlowCase(ExecState*) const; 217 218 219 JSObject* synthesizePrototype(ExecState*) const; 220 JSObject* synthesizeObject(ExecState*) const; 221 222 #if USE(JSVALUE32_64) 218 223 enum { Int32Tag = 0xffffffff }; 219 224 enum { CellTag = 0xfffffffe }; … … 224 229 enum { EmptyValueTag = 0xfffffff9 }; 225 230 enum { DeletedValueTag = 0xfffffff8 }; 226 231 227 232 enum { LowestTag = DeletedValueTag }; 228 233 229 234 uint32_t tag() const; 230 235 int32_t payload() const; 231 236 232 JSObject* synthesizePrototype(ExecState*) const;233 JSObject* synthesizeObject(ExecState*) const;234 235 #if USE(JSVALUE32_64)236 237 union { 237 238 EncodedJSValue asEncodedJSValue; -
trunk/JavaScriptCore/runtime/Lookup.cpp
r53320 r58286 47 47 } 48 48 49 entry->initialize(identifier, values[i].attributes, values[i].value1, values[i].value2); 49 entry->initialize(identifier, values[i].attributes, values[i].value1, values[i].value2 50 #if ENABLE(JIT) 51 , values[i].generator 52 #endif 53 ); 50 54 } 51 55 table = entries; … … 71 75 72 76 if (!location) { 73 InternalFunction* function = new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject()->prototypeFunctionStructure(), entry->functionLength(), propertyName, entry->function()); 77 InternalFunction* function; 78 #if ENABLE(JIT) 79 if (entry->generator()) 80 function = new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject()->prototypeFunctionStructure(), entry->functionLength(), propertyName, exec->globalData().getThunk(entry->generator()), entry->function()); 81 else 82 #endif 83 function = new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject()->prototypeFunctionStructure(), entry->functionLength(), propertyName, entry->function()); 74 84 75 85 thisObj->putDirectFunction(propertyName, function, entry->attributes()); -
trunk/JavaScriptCore/runtime/Lookup.h
r55564 r58286 38 38 39 39 namespace JSC { 40 41 40 // Hash table generated by the create_hash_table script. 42 41 struct HashTableValue { … … 45 44 intptr_t value1; 46 45 intptr_t value2; 46 #if ENABLE(JIT) 47 ThunkGenerator generator; 48 #endif 47 49 }; 48 50 … … 54 56 class HashEntry : public FastAllocBase { 55 57 public: 56 void initialize(UString::Rep* key, unsigned char attributes, intptr_t v1, intptr_t v2) 58 void initialize(UString::Rep* key, unsigned char attributes, intptr_t v1, intptr_t v2 59 #if ENABLE(JIT) 60 , ThunkGenerator generator = 0 61 #endif 62 ) 57 63 { 58 64 m_key = key; … … 60 66 m_u.store.value1 = v1; 61 67 m_u.store.value2 = v2; 68 #if ENABLE(JIT) 69 m_u.function.generator = generator; 70 #endif 62 71 m_next = 0; 63 72 } … … 68 77 unsigned char attributes() const { return m_attributes; } 69 78 79 #if ENABLE(JIT) 80 ThunkGenerator generator() const { ASSERT(m_attributes & Function); return m_u.function.generator; } 81 #endif 70 82 NativeFunction function() const { ASSERT(m_attributes & Function); return m_u.function.functionValue; } 71 83 unsigned char functionLength() const { ASSERT(m_attributes & Function); return static_cast<unsigned char>(m_u.function.length); } … … 91 103 NativeFunction functionValue; 92 104 intptr_t length; // number of arguments for function 105 #if ENABLE(JIT) 106 ThunkGenerator generator; 107 #endif 93 108 } function; 94 109 struct { -
trunk/JavaScriptCore/wtf/text/StringImpl.h
r58114 r58286 28 28 #include <wtf/CrossThreadRefCounted.h> 29 29 #include <wtf/OwnFastMallocPtr.h> 30 #include <wtf/StdLibExtras.h> 30 31 #include <wtf/StringHashFunctions.h> 31 32 #include <wtf/Vector.h> … … 175 176 } 176 177 178 static unsigned dataOffset() { return OBJECT_OFFSETOF(StringImpl, m_data); } 177 179 static PassRefPtr<StringImpl> createWithTerminatingNullCharacter(const StringImpl&); 178 180 static PassRefPtr<StringImpl> createStrippingNullCharacters(const UChar*, unsigned length); … … 321 323 BufferOwnership bufferOwnership() const { return static_cast<BufferOwnership>(m_refCountAndFlags & s_refCountMaskBufferOwnership); } 322 324 bool isStatic() const { return m_refCountAndFlags & s_refCountFlagStatic; } 323 324 325 const UChar* m_data; 325 326 union {
Note:
See TracChangeset
for help on using the changeset viewer.