Changeset 52231 in webkit
- Timestamp:
- Dec 16, 2009 7:50:37 PM (14 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r52222 r52231 1 2009-12-16 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 Fixed <rdar://problem/7355025> Interpreter::privateExecute macro generates 6 bloated code 7 8 This patch cuts Interpreter stack use by about a third. 9 10 * bytecode/Opcode.h: Changed Opcode to const void* to work with the 11 const static initiliazation we want to do in Interpreter::privateExecute. 12 13 * interpreter/Interpreter.cpp: 14 (JSC::Interpreter::Interpreter): Moved hashtable initialization here to 15 avoid polluting Interpreter::privateExecute's stack, and changed it from a 16 series of add() calls to one add() call in a loop, to cut down on code size. 17 18 (JSC::Interpreter::privateExecute): Changed a series of label computations 19 to a copy of a compile-time constant array to cut down on code size. 20 1 21 2009-12-16 Mark Rowe <mrowe@apple.com> 2 22 -
trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r52222 r52231 2567 2567 baseConfigurationReference = 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */; 2568 2568 buildSettings = { 2569 BUILD_VARIANTS = ( 2570 normal, 2571 ); 2569 BUILD_VARIANTS = normal; 2572 2570 }; 2573 2571 name = Production; -
trunk/JavaScriptCore/bytecode/Opcode.h
r51735 r52231 197 197 198 198 #if HAVE(COMPUTED_GOTO) 199 typedef void* Opcode;199 typedef const void* Opcode; 200 200 #else 201 201 typedef OpcodeID Opcode; -
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r51964 r52231 322 322 , m_reentryDepth(0) 323 323 { 324 #if HAVE(COMPUTED_GOTO) 324 325 privateExecute(InitializeAndReturn, 0, 0, 0); 326 327 for (int i = 0; i < numOpcodeIDs; ++i) 328 m_opcodeIDTable.add(m_opcodeTable[i], static_cast<OpcodeID>(i)); 329 #endif // HAVE(COMPUTED_GOTO) 330 325 331 #if ENABLE(OPCODE_SAMPLING) 326 332 enableSampler(); … … 1082 1088 // One-time initialization of our address tables. We have to put this code 1083 1089 // here because our labels are only in scope inside this function. 1084 if ( flag == InitializeAndReturn) {1090 if (UNLIKELY(flag == InitializeAndReturn)) { 1085 1091 #if HAVE(COMPUTED_GOTO) 1086 #define ADD_BYTECODE(id, length) m_opcodeTable[id] = &&id; 1087 FOR_EACH_OPCODE_ID(ADD_BYTECODE); 1088 #undef ADD_BYTECODE 1089 1090 #define ADD_OPCODE_ID(id, length) m_opcodeIDTable.add(&&id, id); 1091 FOR_EACH_OPCODE_ID(ADD_OPCODE_ID); 1092 #undef ADD_OPCODE_ID 1093 ASSERT(m_opcodeIDTable.size() == numOpcodeIDs); 1092 #define LIST_OPCODE_LABEL(id, length) &&id, 1093 static Opcode labels[] = { FOR_EACH_OPCODE_ID(LIST_OPCODE_LABEL) }; 1094 for (size_t i = 0; i < sizeof(labels) / sizeof(Opcode); ++i) 1095 m_opcodeTable[i] = labels[i]; 1096 #undef LIST_OPCODE_LABEL 1094 1097 #endif // HAVE(COMPUTED_GOTO) 1095 1098 return JSValue();
Note: See TracChangeset
for help on using the changeset viewer.