Changeset 55564 in webkit for trunk/JavaScriptCore
- Timestamp:
- Mar 4, 2010, 5:33:54 PM (15 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r55521 r55564 1 2010-03-03 Oliver Hunt <[email protected]> 2 3 Reviewed by Gavin Barraclough. 4 5 Allow static property getters to interact with JSCs caching 6 https://bugs.webkit.org/show_bug.cgi?id=35716 7 8 Add new opcodes for handling cached lookup of static value getters. 9 More or less the same as with JS getters, all that changes is that 10 instead of calling through a JSFunction we always know that we have 11 a C function to call. 12 13 For the patching routines in the JIT we now need to pass a few 14 new parameters to allow us to pass enough information to the stub 15 function to allow us to call the C function correctly. Logically 16 this shouldn't actually be necessary as all of these functions ignore 17 the identifier, but removing the ident parameter would require 18 somewhat involved changes to the way we implement getOwnPropertySlot, 19 etc. 20 21 * bytecode/CodeBlock.cpp: 22 (JSC::CodeBlock::dump): 23 (JSC::CodeBlock::derefStructures): 24 (JSC::CodeBlock::refStructures): 25 * bytecode/Instruction.h: 26 (JSC::Instruction::Instruction): 27 (JSC::Instruction::): 28 * bytecode/Opcode.h: 29 * interpreter/Interpreter.cpp: 30 (JSC::Interpreter::tryCacheGetByID): 31 (JSC::Interpreter::privateExecute): 32 * jit/JIT.cpp: 33 (JSC::JIT::privateCompileMainPass): 34 * jit/JIT.h: 35 (JSC::JIT::compileGetByIdProto): 36 (JSC::JIT::compileGetByIdSelfList): 37 (JSC::JIT::compileGetByIdProtoList): 38 (JSC::JIT::compileGetByIdChainList): 39 (JSC::JIT::compileGetByIdChain): 40 * jit/JITPropertyAccess.cpp: 41 (JSC::JIT::privateCompileGetByIdProto): 42 (JSC::JIT::privateCompileGetByIdSelfList): 43 (JSC::JIT::privateCompileGetByIdProtoList): 44 (JSC::JIT::privateCompileGetByIdChainList): 45 (JSC::JIT::privateCompileGetByIdChain): 46 * jit/JITPropertyAccess32_64.cpp: 47 (JSC::JIT::privateCompileGetByIdProto): 48 (JSC::JIT::privateCompileGetByIdSelfList): 49 (JSC::JIT::privateCompileGetByIdProtoList): 50 (JSC::JIT::privateCompileGetByIdChainList): 51 (JSC::JIT::privateCompileGetByIdChain): 52 * jit/JITStubs.cpp: 53 (JSC::JITThunks::tryCacheGetByID): 54 (JSC::DEFINE_STUB_FUNCTION): 55 * jit/JITStubs.h: 56 (JSC::): 57 * runtime/JSFunction.cpp: 58 (JSC::JSFunction::getOwnPropertySlot): 59 * runtime/Lookup.h: 60 (JSC::getStaticPropertySlot): 61 (JSC::getStaticValueSlot): 62 * runtime/PropertySlot.h: 63 (JSC::PropertySlot::): 64 (JSC::PropertySlot::PropertySlot): 65 (JSC::PropertySlot::cachedPropertyType): 66 (JSC::PropertySlot::isCacheable): 67 (JSC::PropertySlot::isCacheableValue): 68 (JSC::PropertySlot::setValueSlot): 69 (JSC::PropertySlot::setCacheableCustom): 70 (JSC::PropertySlot::setGetterSlot): 71 (JSC::PropertySlot::setCacheableGetterSlot): 72 (JSC::PropertySlot::clearOffset): 73 (JSC::PropertySlot::customGetter): 74 1 75 2010-03-04 Shinichiro Hamaji <[email protected]> 2 76 -
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r55002 r55564 786 786 break; 787 787 } 788 case op_get_by_id_custom_self: { 789 printGetByIdOp(exec, location, it, "get_by_id_custom_self"); 790 break; 791 } 792 case op_get_by_id_custom_self_list: { 793 printGetByIdOp(exec, location, it, "get_by_id_custom_self_list"); 794 break; 795 } 796 case op_get_by_id_custom_proto: { 797 printGetByIdOp(exec, location, it, "get_by_id_custom_proto"); 798 break; 799 } 800 case op_get_by_id_custom_proto_list: { 801 printGetByIdOp(exec, location, it, "get_by_id_custom_proto_list"); 802 break; 803 } 804 case op_get_by_id_custom_chain: { 805 printGetByIdOp(exec, location, it, "get_by_id_custom_chain"); 806 break; 807 } 788 808 case op_get_by_id_generic: { 789 809 printGetByIdOp(exec, location, it, "get_by_id_generic"); … … 1376 1396 Interpreter* interpreter = m_globalData->interpreter; 1377 1397 1378 if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self) ) {1398 if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_self)) { 1379 1399 vPC[4].u.structure->deref(); 1380 1400 return; … … 1423 1443 Interpreter* interpreter = m_globalData->interpreter; 1424 1444 1425 if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self) ) {1445 if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_self)) { 1426 1446 vPC[4].u.structure->ref(); 1427 1447 return; -
trunk/JavaScriptCore/bytecode/Instruction.h
r46854 r55564 32 32 #include "MacroAssembler.h" 33 33 #include "Opcode.h" 34 #include "PropertySlot.h" 34 35 #include "Structure.h" 35 36 #include <wtf/VectorTraits.h> … … 145 146 Instruction(JSCell* jsCell) { u.jsCell = jsCell; } 146 147 Instruction(PolymorphicAccessStructureList* polymorphicStructures) { u.polymorphicStructures = polymorphicStructures; } 148 Instruction(PropertySlot::GetValueFunc getterFunc) { u.getterFunc = getterFunc; } 147 149 148 150 union { … … 153 155 JSCell* jsCell; 154 156 PolymorphicAccessStructureList* polymorphicStructures; 157 PropertySlot::GetValueFunc getterFunc; 155 158 } u; 156 159 }; -
trunk/JavaScriptCore/bytecode/Opcode.h
r55002 r55564 110 110 macro(op_get_by_id_getter_proto_list, 8) \ 111 111 macro(op_get_by_id_getter_chain, 8) \ 112 macro(op_get_by_id_custom_self, 8) \ 113 macro(op_get_by_id_custom_self_list, 8) \ 114 macro(op_get_by_id_custom_proto, 8) \ 115 macro(op_get_by_id_custom_proto_list, 8) \ 116 macro(op_get_by_id_custom_chain, 8) \ 112 117 macro(op_get_by_id_generic, 8) \ 113 118 macro(op_get_array_length, 8) \ -
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r55181 r55564 1031 1031 1032 1032 if (slot.slotBase() == baseValue) { 1033 vPC[0] = slot.isGetter() ? getOpcode(op_get_by_id_getter_self) : getOpcode(op_get_by_id_self); 1034 vPC[5] = slot.cachedOffset(); 1033 switch (slot.cachedPropertyType()) { 1034 case PropertySlot::Getter: 1035 vPC[0] = getOpcode(op_get_by_id_getter_self); 1036 vPC[5] = slot.cachedOffset(); 1037 break; 1038 case PropertySlot::Custom: 1039 vPC[0] = getOpcode(op_get_by_id_custom_self); 1040 vPC[5] = slot.customGetter(); 1041 break; 1042 default: 1043 vPC[0] = getOpcode(op_get_by_id_self); 1044 vPC[5] = slot.cachedOffset(); 1045 break; 1046 } 1035 1047 1036 1048 codeBlock->refStructures(vPC); … … 1057 1069 1058 1070 ASSERT(!baseObject->structure()->isUncacheableDictionary()); 1059 1060 vPC[0] = slot.isGetter() ? getOpcode(op_get_by_id_getter_proto) : getOpcode(op_get_by_id_proto); 1071 1072 switch (slot.cachedPropertyType()) { 1073 case PropertySlot::Getter: 1074 vPC[0] = getOpcode(op_get_by_id_getter_proto); 1075 vPC[6] = offset; 1076 break; 1077 case PropertySlot::Custom: 1078 vPC[0] = getOpcode(op_get_by_id_custom_proto); 1079 vPC[6] = slot.customGetter(); 1080 break; 1081 default: 1082 vPC[0] = getOpcode(op_get_by_id_proto); 1083 vPC[6] = offset; 1084 break; 1085 } 1061 1086 vPC[5] = baseObject->structure(); 1062 vPC[6] = offset;1063 1087 1064 1088 codeBlock->refStructures(vPC); … … 1073 1097 } 1074 1098 1075 vPC[0] = slot.isGetter() ? getOpcode(op_get_by_id_getter_chain) : getOpcode(op_get_by_id_chain); 1099 1100 switch (slot.cachedPropertyType()) { 1101 case PropertySlot::Getter: 1102 vPC[0] = getOpcode(op_get_by_id_getter_chain); 1103 vPC[7] = offset; 1104 break; 1105 case PropertySlot::Custom: 1106 vPC[0] = getOpcode(op_get_by_id_custom_chain); 1107 vPC[7] = slot.customGetter(); 1108 break; 1109 default: 1110 vPC[0] = getOpcode(op_get_by_id_chain); 1111 vPC[7] = offset; 1112 break; 1113 } 1076 1114 vPC[4] = structure; 1077 1115 vPC[5] = structure->prototypeChain(callFrame); 1078 1116 vPC[6] = count; 1079 vPC[7] = offset;1080 1117 codeBlock->refStructures(vPC); 1081 1118 } … … 2208 2245 skip_id_getter_proto: 2209 2246 #endif 2247 #if HAVE(COMPUTED_GOTO) 2248 goto *(&&skip_id_custom_proto); 2249 #endif 2250 DEFINE_OPCODE(op_get_by_id_custom_proto) { 2251 /* op_get_by_id_custom_proto dst(r) base(r) property(id) structure(sID) prototypeStructure(sID) offset(n) nop(n) 2252 2253 Cached property access: Attempts to use a cached named property getter 2254 from the value base's prototype. If the cache misses, op_get_by_id_custom_proto 2255 reverts to op_get_by_id. 2256 */ 2257 int base = vPC[2].u.operand; 2258 JSValue baseValue = callFrame->r(base).jsValue(); 2259 2260 if (LIKELY(baseValue.isCell())) { 2261 JSCell* baseCell = asCell(baseValue); 2262 Structure* structure = vPC[4].u.structure; 2263 2264 if (LIKELY(baseCell->structure() == structure)) { 2265 ASSERT(structure->prototypeForLookup(callFrame).isObject()); 2266 JSObject* protoObject = asObject(structure->prototypeForLookup(callFrame)); 2267 Structure* prototypeStructure = vPC[5].u.structure; 2268 2269 if (LIKELY(protoObject->structure() == prototypeStructure)) { 2270 int dst = vPC[1].u.operand; 2271 int property = vPC[3].u.operand; 2272 Identifier& ident = callFrame->codeBlock()->identifier(property); 2273 2274 PropertySlot::GetValueFunc getter = vPC[6].u.getterFunc; 2275 JSValue result = getter(callFrame, protoObject, ident); 2276 CHECK_FOR_EXCEPTION(); 2277 callFrame->r(dst) = result; 2278 vPC += OPCODE_LENGTH(op_get_by_id_custom_proto); 2279 NEXT_INSTRUCTION(); 2280 } 2281 } 2282 } 2283 uncacheGetByID(callFrame->codeBlock(), vPC); 2284 NEXT_INSTRUCTION(); 2285 } 2286 #if HAVE(COMPUTED_GOTO) 2287 skip_id_custom_proto: 2288 #endif 2210 2289 DEFINE_OPCODE(op_get_by_id_self_list) { 2211 2290 // Polymorphic self access caching currently only supported when JITting. … … 2230 2309 } 2231 2310 DEFINE_OPCODE(op_get_by_id_getter_proto_list) { 2311 // Polymorphic prototype access caching currently only supported when JITting. 2312 ASSERT_NOT_REACHED(); 2313 // This case of the switch must not be empty, else (op_get_by_id_proto_list == op_get_by_id_chain)! 2314 vPC += OPCODE_LENGTH(op_get_by_id_proto_list); 2315 NEXT_INSTRUCTION(); 2316 } 2317 DEFINE_OPCODE(op_get_by_id_custom_self_list) { 2318 // Polymorphic self access caching currently only supported when JITting. 2319 ASSERT_NOT_REACHED(); 2320 // This case of the switch must not be empty, else (op_get_by_id_self_list == op_get_by_id_chain)! 2321 vPC += OPCODE_LENGTH(op_get_by_id_custom_self_list); 2322 NEXT_INSTRUCTION(); 2323 } 2324 DEFINE_OPCODE(op_get_by_id_custom_proto_list) { 2232 2325 // Polymorphic prototype access caching currently only supported when JITting. 2233 2326 ASSERT_NOT_REACHED(); … … 2324 2417 #if HAVE(COMPUTED_GOTO) 2325 2418 skip_id_getter_self: 2419 #endif 2420 #if HAVE(COMPUTED_GOTO) 2421 goto *(&&skip_id_custom_self); 2422 #endif 2423 DEFINE_OPCODE(op_get_by_id_custom_self) { 2424 /* op_get_by_id_custom_self dst(r) base(r) property(id) structure(sID) offset(n) nop(n) nop(n) 2425 2426 Cached property access: Attempts to use a cached named property getter 2427 from the value base. If the cache misses, op_get_by_id_custom_self reverts to 2428 op_get_by_id. 2429 */ 2430 int base = vPC[2].u.operand; 2431 JSValue baseValue = callFrame->r(base).jsValue(); 2432 2433 if (LIKELY(baseValue.isCell())) { 2434 JSCell* baseCell = asCell(baseValue); 2435 Structure* structure = vPC[4].u.structure; 2436 2437 if (LIKELY(baseCell->structure() == structure)) { 2438 ASSERT(baseCell->isObject()); 2439 int dst = vPC[1].u.operand; 2440 int property = vPC[3].u.operand; 2441 Identifier& ident = callFrame->codeBlock()->identifier(property); 2442 2443 PropertySlot::GetValueFunc getter = vPC[5].u.getterFunc; 2444 JSValue result = getter(callFrame, baseValue, ident); 2445 CHECK_FOR_EXCEPTION(); 2446 callFrame->r(dst) = result; 2447 vPC += OPCODE_LENGTH(op_get_by_id_custom_self); 2448 NEXT_INSTRUCTION(); 2449 } 2450 } 2451 uncacheGetByID(callFrame->codeBlock(), vPC); 2452 NEXT_INSTRUCTION(); 2453 } 2454 #if HAVE(COMPUTED_GOTO) 2455 skip_id_custom_self: 2326 2456 #endif 2327 2457 DEFINE_OPCODE(op_get_by_id_generic) { … … 2399 2529 #if HAVE(COMPUTED_GOTO) 2400 2530 skip_id_getter_chain: 2531 #endif 2532 #if HAVE(COMPUTED_GOTO) 2533 goto *(&&skip_id_custom_chain); 2534 #endif 2535 DEFINE_OPCODE(op_get_by_id_custom_chain) { 2536 /* op_get_by_id_custom_chain dst(r) base(r) property(id) structure(sID) structureChain(chain) count(n) offset(n) 2537 2538 Cached property access: Attempts to use a cached named property getter on the 2539 value base's prototype chain. If the cache misses, op_get_by_id_custom_chain 2540 reverts to op_get_by_id. 2541 */ 2542 int base = vPC[2].u.operand; 2543 JSValue baseValue = callFrame->r(base).jsValue(); 2544 2545 if (LIKELY(baseValue.isCell())) { 2546 JSCell* baseCell = asCell(baseValue); 2547 Structure* structure = vPC[4].u.structure; 2548 2549 if (LIKELY(baseCell->structure() == structure)) { 2550 RefPtr<Structure>* it = vPC[5].u.structureChain->head(); 2551 size_t count = vPC[6].u.operand; 2552 RefPtr<Structure>* end = it + count; 2553 2554 while (true) { 2555 JSObject* baseObject = asObject(baseCell->structure()->prototypeForLookup(callFrame)); 2556 2557 if (UNLIKELY(baseObject->structure() != (*it).get())) 2558 break; 2559 2560 if (++it == end) { 2561 int dst = vPC[1].u.operand; 2562 int property = vPC[3].u.operand; 2563 Identifier& ident = callFrame->codeBlock()->identifier(property); 2564 2565 PropertySlot::GetValueFunc getter = vPC[7].u.getterFunc; 2566 JSValue result = getter(callFrame, baseObject, ident); 2567 CHECK_FOR_EXCEPTION(); 2568 callFrame->r(dst) = result; 2569 vPC += OPCODE_LENGTH(op_get_by_id_custom_chain); 2570 NEXT_INSTRUCTION(); 2571 } 2572 2573 // Update baseCell, so that next time around the loop we'll pick up the prototype's prototype. 2574 baseCell = baseObject; 2575 } 2576 } 2577 } 2578 uncacheGetByID(callFrame->codeBlock(), vPC); 2579 NEXT_INSTRUCTION(); 2580 } 2581 #if HAVE(COMPUTED_GOTO) 2582 skip_id_custom_chain: 2401 2583 #endif 2402 2584 DEFINE_OPCODE(op_get_array_length) { -
trunk/JavaScriptCore/jit/JIT.cpp
r55002 r55564 328 328 case op_get_by_id_getter_self: 329 329 case op_get_by_id_getter_self_list: 330 case op_get_by_id_custom_chain: 331 case op_get_by_id_custom_proto: 332 case op_get_by_id_custom_proto_list: 333 case op_get_by_id_custom_self: 334 case op_get_by_id_custom_self_list: 330 335 case op_get_string_length: 331 336 case op_put_by_id_generic: -
trunk/JavaScriptCore/jit/JIT.h
r55185 r55564 284 284 } 285 285 286 static void compileGetByIdProto(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, bool isGetter, size_t cachedOffset, ReturnAddressPtr returnAddress)286 static void compileGetByIdProto(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress) 287 287 { 288 288 JIT jit(globalData, codeBlock); 289 jit.privateCompileGetByIdProto(stubInfo, structure, prototypeStructure, i sGetter, cachedOffset, returnAddress, callFrame);290 } 291 292 static void compileGetByIdSelfList(JSGlobalData* globalData, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, bool isGetter, size_t cachedOffset)289 jit.privateCompileGetByIdProto(stubInfo, structure, prototypeStructure, ident, slot, cachedOffset, returnAddress, callFrame); 290 } 291 292 static void compileGetByIdSelfList(JSGlobalData* globalData, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset) 293 293 { 294 294 JIT jit(globalData, codeBlock); 295 jit.privateCompileGetByIdSelfList(stubInfo, polymorphicStructures, currentIndex, structure, i sGetter, cachedOffset);296 } 297 static void compileGetByIdProtoList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, Structure* prototypeStructure, bool isGetter, size_t cachedOffset)295 jit.privateCompileGetByIdSelfList(stubInfo, polymorphicStructures, currentIndex, structure, ident, slot, cachedOffset); 296 } 297 static void compileGetByIdProtoList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset) 298 298 { 299 299 JIT jit(globalData, codeBlock); 300 jit.privateCompileGetByIdProtoList(stubInfo, prototypeStructureList, currentIndex, structure, prototypeStructure, i sGetter, cachedOffset, callFrame);301 } 302 static void compileGetByIdChainList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, StructureChain* chain, size_t count, bool isGetter, size_t cachedOffset)300 jit.privateCompileGetByIdProtoList(stubInfo, prototypeStructureList, currentIndex, structure, prototypeStructure, ident, slot, cachedOffset, callFrame); 301 } 302 static void compileGetByIdChainList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset) 303 303 { 304 304 JIT jit(globalData, codeBlock); 305 jit.privateCompileGetByIdChainList(stubInfo, prototypeStructureList, currentIndex, structure, chain, count, i sGetter, cachedOffset, callFrame);306 } 307 308 static void compileGetByIdChain(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, bool isGetter, size_t cachedOffset, ReturnAddressPtr returnAddress)305 jit.privateCompileGetByIdChainList(stubInfo, prototypeStructureList, currentIndex, structure, chain, count, ident, slot, cachedOffset, callFrame); 306 } 307 308 static void compileGetByIdChain(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress) 309 309 { 310 310 JIT jit(globalData, codeBlock); 311 jit.privateCompileGetByIdChain(stubInfo, structure, chain, count, i sGetter, cachedOffset, returnAddress, callFrame);311 jit.privateCompileGetByIdChain(stubInfo, structure, chain, count, ident, slot, cachedOffset, returnAddress, callFrame); 312 312 } 313 313 … … 355 355 void privateCompileSlowCases(); 356 356 JITCode privateCompile(); 357 void privateCompileGetByIdProto(StructureStubInfo*, Structure*, Structure* prototypeStructure, bool isGetter, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame);358 void privateCompileGetByIdSelfList(StructureStubInfo*, PolymorphicAccessStructureList*, int, Structure*, bool isGetter, size_t cachedOffset);359 void privateCompileGetByIdProtoList(StructureStubInfo*, PolymorphicAccessStructureList*, int, Structure*, Structure* prototypeStructure, bool isGetter, size_t cachedOffset, CallFrame* callFrame);360 void privateCompileGetByIdChainList(StructureStubInfo*, PolymorphicAccessStructureList*, int, Structure*, StructureChain* chain, size_t count, bool isGetter, size_t cachedOffset, CallFrame* callFrame);361 void privateCompileGetByIdChain(StructureStubInfo*, Structure*, StructureChain*, size_t count, bool isGetter, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame);357 void privateCompileGetByIdProto(StructureStubInfo*, Structure*, Structure* prototypeStructure, const Identifier&, const PropertySlot&, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame); 358 void privateCompileGetByIdSelfList(StructureStubInfo*, PolymorphicAccessStructureList*, int, Structure*, const Identifier&, const PropertySlot&, size_t cachedOffset); 359 void privateCompileGetByIdProtoList(StructureStubInfo*, PolymorphicAccessStructureList*, int, Structure*, Structure* prototypeStructure, const Identifier&, const PropertySlot&, size_t cachedOffset, CallFrame* callFrame); 360 void privateCompileGetByIdChainList(StructureStubInfo*, PolymorphicAccessStructureList*, int, Structure*, StructureChain* chain, size_t count, const Identifier&, const PropertySlot&, size_t cachedOffset, CallFrame* callFrame); 361 void privateCompileGetByIdChain(StructureStubInfo*, Structure*, StructureChain*, size_t count, const Identifier&, const PropertySlot&, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame); 362 362 void privateCompilePutByIdTransition(StructureStubInfo*, Structure*, Structure*, size_t cachedOffset, StructureChain*, ReturnAddressPtr returnAddress); 363 363 -
trunk/JavaScriptCore/jit/JITPropertyAccess.cpp
r55198 r55564 697 697 } 698 698 699 void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, bool isGetter, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)699 void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame) 700 700 { 701 701 // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is … … 715 715 #endif 716 716 717 bool needsStubLink = false; 718 717 719 // Checks out okay! 718 if (isGetter) { 720 if (slot.cachedPropertyType() == PropertySlot::Getter) { 721 needsStubLink = true; 719 722 compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset); 720 723 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); … … 723 726 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 724 727 stubCall.call(); 728 } else if (slot.cachedPropertyType() == PropertySlot::Custom) { 729 needsStubLink = true; 730 JITStubCall stubCall(this, cti_op_get_by_id_custom_stub); 731 stubCall.addArgument(ImmPtr(protoObject)); 732 stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress())); 733 stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident))); 734 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 735 stubCall.call(); 725 736 } else 726 737 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); … … 736 747 patchBuffer.link(success, stubInfo->hotPathBegin.labelAtOffset(patchOffsetGetByIdPutResult)); 737 748 738 if ( isGetter) {749 if (needsStubLink) { 739 750 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 740 751 if (iter->to) … … 755 766 } 756 767 757 void JIT::privateCompileGetByIdSelfList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, bool isGetter, size_t cachedOffset)768 void JIT::privateCompileGetByIdSelfList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset) 758 769 { 759 770 Jump failureCase = checkStructure(regT0, structure); 760 if (isGetter) { 771 bool needsStubLink = false; 772 if (slot.cachedPropertyType() == PropertySlot::Getter) { 773 needsStubLink = true; 761 774 if (!structure->isUsingInlineStorage()) { 762 775 move(regT0, regT1); … … 769 782 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 770 783 stubCall.call(); 784 } else if (slot.cachedPropertyType() == PropertySlot::Custom) { 785 needsStubLink = true; 786 JITStubCall stubCall(this, cti_op_get_by_id_custom_stub); 787 stubCall.addArgument(regT0); 788 stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress())); 789 stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident))); 790 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 791 stubCall.call(); 771 792 } else 772 793 compileGetDirectOffset(regT0, regT0, structure, cachedOffset); … … 775 796 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 776 797 777 if ( isGetter) {798 if (needsStubLink) { 778 799 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 779 800 if (iter->to) … … 803 824 } 804 825 805 void JIT::privateCompileGetByIdProtoList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, Structure* prototypeStructure, bool isGetter, size_t cachedOffset, CallFrame* callFrame)826 void JIT::privateCompileGetByIdProtoList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, CallFrame* callFrame) 806 827 { 807 828 // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is … … 822 843 823 844 // Checks out okay! 824 if (isGetter) { 845 bool needsStubLink = false; 846 if (slot.cachedPropertyType() == PropertySlot::Getter) { 847 needsStubLink = true; 825 848 compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset); 826 849 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); … … 829 852 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 830 853 stubCall.call(); 854 } else if (slot.cachedPropertyType() == PropertySlot::Custom) { 855 needsStubLink = true; 856 JITStubCall stubCall(this, cti_op_get_by_id_custom_stub); 857 stubCall.addArgument(ImmPtr(protoObject)); 858 stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress())); 859 stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident))); 860 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 861 stubCall.call(); 831 862 } else 832 863 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); … … 836 867 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 837 868 838 if ( isGetter) {869 if (needsStubLink) { 839 870 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 840 871 if (iter->to) … … 863 894 } 864 895 865 void JIT::privateCompileGetByIdChainList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, StructureChain* chain, size_t count, bool isGetter, size_t cachedOffset, CallFrame* callFrame)896 void JIT::privateCompileGetByIdChainList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, CallFrame* callFrame) 866 897 { 867 898 ASSERT(count); … … 890 921 ASSERT(protoObject); 891 922 892 if (isGetter) { 923 bool needsStubLink = false; 924 if (slot.cachedPropertyType() == PropertySlot::Getter) { 925 needsStubLink = true; 893 926 compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset); 894 927 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); … … 897 930 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 898 931 stubCall.call(); 932 } else if (slot.cachedPropertyType() == PropertySlot::Custom) { 933 needsStubLink = true; 934 JITStubCall stubCall(this, cti_op_get_by_id_custom_stub); 935 stubCall.addArgument(ImmPtr(protoObject)); 936 stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress())); 937 stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident))); 938 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 939 stubCall.call(); 899 940 } else 900 941 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); … … 903 944 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 904 945 905 if ( isGetter) {946 if (needsStubLink) { 906 947 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 907 948 if (iter->to) … … 931 972 } 932 973 933 void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, bool isGetter, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)974 void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame) 934 975 { 935 976 ASSERT(count); … … 957 998 } 958 999 ASSERT(protoObject); 959 960 if (isGetter) { 1000 1001 bool needsStubLink = false; 1002 if (slot.cachedPropertyType() == PropertySlot::Getter) { 1003 needsStubLink = true; 961 1004 compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset); 962 1005 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); … … 965 1008 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 966 1009 stubCall.call(); 1010 } else if (slot.cachedPropertyType() == PropertySlot::Custom) { 1011 needsStubLink = true; 1012 JITStubCall stubCall(this, cti_op_get_by_id_custom_stub); 1013 stubCall.addArgument(ImmPtr(protoObject)); 1014 stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress())); 1015 stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident))); 1016 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 1017 stubCall.call(); 967 1018 } else 968 1019 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); … … 971 1022 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 972 1023 973 if ( isGetter) {1024 if (needsStubLink) { 974 1025 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 975 1026 if (iter->to) -
trunk/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
r55198 r55564 719 719 } 720 720 721 void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, bool isGetter, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)721 void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame) 722 722 { 723 723 // regT0 holds a JSCell* … … 737 737 Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), ImmPtr(prototypeStructure)); 738 738 #endif 739 739 bool needsStubLink = false; 740 740 // Checks out okay! 741 if (isGetter) { 741 if (slot.cachedPropertyType() == PropertySlot::Getter) { 742 needsStubLink = true; 742 743 compileGetDirectOffset(protoObject, regT2, regT2, regT1, cachedOffset); 743 744 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); … … 746 747 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 747 748 stubCall.call(); 749 } else if (slot.cachedPropertyType() == PropertySlot::Custom) { 750 needsStubLink = true; 751 JITStubCall stubCall(this, cti_op_get_by_id_custom_stub); 752 stubCall.addArgument(ImmPtr(protoObject)); 753 stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress())); 754 stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident))); 755 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 756 stubCall.call(); 748 757 } else 749 758 compileGetDirectOffset(protoObject, regT2, regT1, regT0, cachedOffset); … … 761 770 patchBuffer.link(success, stubInfo->hotPathBegin.labelAtOffset(patchOffsetGetByIdPutResult)); 762 771 763 if ( isGetter) {772 if (needsStubLink) { 764 773 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 765 774 if (iter->to) … … 782 791 783 792 784 void JIT::privateCompileGetByIdSelfList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, bool isGetter, size_t cachedOffset)793 void JIT::privateCompileGetByIdSelfList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset) 785 794 { 786 795 // regT0 holds a JSCell* 787 796 Jump failureCase = checkStructure(regT0, structure); 788 if (isGetter) { 797 bool needsStubLink = false; 798 if (slot.cachedPropertyType() == PropertySlot::Getter) { 799 needsStubLink = true; 789 800 if (!structure->isUsingInlineStorage()) { 790 801 move(regT0, regT1); … … 797 808 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 798 809 stubCall.call(); 810 } else if (slot.cachedPropertyType() == PropertySlot::Custom) { 811 needsStubLink = true; 812 JITStubCall stubCall(this, cti_op_get_by_id_custom_stub); 813 stubCall.addArgument(regT0); 814 stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress())); 815 stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident))); 816 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 817 stubCall.call(); 799 818 } else 800 819 compileGetDirectOffset(regT0, regT1, regT0, structure, cachedOffset); … … 803 822 804 823 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 805 if ( isGetter) {824 if (needsStubLink) { 806 825 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 807 826 if (iter->to) … … 830 849 } 831 850 832 void JIT::privateCompileGetByIdProtoList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, Structure* prototypeStructure, bool isGetter, size_t cachedOffset, CallFrame* callFrame)851 void JIT::privateCompileGetByIdProtoList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, CallFrame* callFrame) 833 852 { 834 853 // regT0 holds a JSCell* … … 850 869 #endif 851 870 852 if (isGetter) { 871 bool needsStubLink = false; 872 if (slot.cachedPropertyType() == PropertySlot::Getter) { 873 needsStubLink = true; 853 874 compileGetDirectOffset(protoObject, regT2, regT2, regT1, cachedOffset); 854 875 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); … … 857 878 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 858 879 stubCall.call(); 880 } else if (slot.cachedPropertyType() == PropertySlot::Custom) { 881 needsStubLink = true; 882 JITStubCall stubCall(this, cti_op_get_by_id_custom_stub); 883 stubCall.addArgument(ImmPtr(protoObject)); 884 stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress())); 885 stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident))); 886 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 887 stubCall.call(); 859 888 } else 860 889 compileGetDirectOffset(protoObject, regT2, regT1, regT0, cachedOffset); … … 863 892 864 893 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 865 if ( isGetter) {894 if (needsStubLink) { 866 895 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 867 896 if (iter->to) … … 889 918 } 890 919 891 void JIT::privateCompileGetByIdChainList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, StructureChain* chain, size_t count, bool isGetter, size_t cachedOffset, CallFrame* callFrame)920 void JIT::privateCompileGetByIdChainList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, CallFrame* callFrame) 892 921 { 893 922 // regT0 holds a JSCell* … … 917 946 ASSERT(protoObject); 918 947 919 if (isGetter) { 948 bool needsStubLink = false; 949 if (slot.cachedPropertyType() == PropertySlot::Getter) { 950 needsStubLink = true; 920 951 compileGetDirectOffset(protoObject, regT2, regT2, regT1, cachedOffset); 921 952 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); … … 924 955 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 925 956 stubCall.call(); 957 } else if (slot.cachedPropertyType() == PropertySlot::Custom) { 958 needsStubLink = true; 959 JITStubCall stubCall(this, cti_op_get_by_id_custom_stub); 960 stubCall.addArgument(ImmPtr(protoObject)); 961 stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress())); 962 stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident))); 963 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 964 stubCall.call(); 926 965 } else 927 966 compileGetDirectOffset(protoObject, regT2, regT1, regT0, cachedOffset); … … 930 969 931 970 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 932 if ( isGetter) {971 if (needsStubLink) { 933 972 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 934 973 if (iter->to) … … 957 996 } 958 997 959 void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, bool isGetter, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)998 void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame) 960 999 { 961 1000 // regT0 holds a JSCell* … … 985 1024 ASSERT(protoObject); 986 1025 987 if (isGetter) { 1026 bool needsStubLink = false; 1027 if (slot.cachedPropertyType() == PropertySlot::Getter) { 1028 needsStubLink = true; 988 1029 compileGetDirectOffset(protoObject, regT2, regT2, regT1, cachedOffset); 989 1030 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); … … 992 1033 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 993 1034 stubCall.call(); 1035 } else if (slot.cachedPropertyType() == PropertySlot::Custom) { 1036 needsStubLink = true; 1037 JITStubCall stubCall(this, cti_op_get_by_id_custom_stub); 1038 stubCall.addArgument(ImmPtr(protoObject)); 1039 stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress())); 1040 stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident))); 1041 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 1042 stubCall.call(); 994 1043 } else 995 1044 compileGetDirectOffset(protoObject, regT2, regT1, regT0, cachedOffset); … … 997 1046 998 1047 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 999 if ( isGetter) {1048 if (needsStubLink) { 1000 1049 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 1001 1050 if (iter->to) -
trunk/JavaScriptCore/jit/JITStubs.cpp
r55185 r55564 876 876 // set this up, so derefStructures can do it's job. 877 877 stubInfo->initGetByIdSelf(structure); 878 if (slot. isGetter())878 if (slot.cachedPropertyType() != PropertySlot::Value) 879 879 ctiPatchCallByReturnAddress(codeBlock, returnAddress, FunctionPtr(cti_op_get_by_id_self_fail)); 880 880 else … … 905 905 ASSERT(!structure->isDictionary()); 906 906 ASSERT(!slotBaseObject->structure()->isDictionary()); 907 JIT::compileGetByIdProto(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, slotBaseObject->structure(), slot.isGetter(), offset, returnAddress);907 JIT::compileGetByIdProto(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, slotBaseObject->structure(), propertyName, slot, offset, returnAddress); 908 908 return; 909 909 } … … 918 918 StructureChain* prototypeChain = structure->prototypeChain(callFrame); 919 919 stubInfo->initGetByIdChain(structure, prototypeChain); 920 JIT::compileGetByIdChain(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, prototypeChain, count, slot.isGetter(), offset, returnAddress);920 JIT::compileGetByIdChain(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, prototypeChain, count, propertyName, slot, offset, returnAddress); 921 921 } 922 922 … … 1400 1400 } 1401 1401 1402 JIT::compileGetByIdSelfList(callFrame->scopeChain()->globalData, codeBlock, stubInfo, polymorphicStructureList, listIndex, asCell(baseValue)->structure(), slot.isGetter(), slot.cachedOffset());1402 JIT::compileGetByIdSelfList(callFrame->scopeChain()->globalData, codeBlock, stubInfo, polymorphicStructureList, listIndex, asCell(baseValue)->structure(), ident, slot, slot.cachedOffset()); 1403 1403 1404 1404 if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1)) … … 1455 1455 } 1456 1456 1457 DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_custom_stub) 1458 { 1459 STUB_INIT_STACK_FRAME(stackFrame); 1460 CallFrame* callFrame = stackFrame.callFrame; 1461 JSObject* slotBase = stackFrame.args[0].jsObject(); 1462 PropertySlot::GetValueFunc getter = reinterpret_cast<PropertySlot::GetValueFunc>(stackFrame.args[1].asPointer); 1463 const Identifier& ident = stackFrame.args[2].identifier(); 1464 JSValue result = getter(callFrame, slotBase, ident); 1465 if (callFrame->hadException()) 1466 returnToThrowTrampoline(&callFrame->globalData(), stackFrame.args[3].returnAddress(), STUB_RETURN_ADDRESS); 1467 1468 return JSValue::encode(result); 1469 } 1470 1457 1471 DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_proto_list) 1458 1472 { … … 1496 1510 PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex); 1497 1511 1498 JIT::compileGetByIdProtoList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, slotBaseObject->structure(), slot.isGetter(), offset);1512 JIT::compileGetByIdProtoList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, slotBaseObject->structure(), propertyName, slot, offset); 1499 1513 1500 1514 if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1)) … … 1506 1520 1507 1521 StructureChain* protoChain = structure->prototypeChain(callFrame); 1508 JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, protoChain, count, slot.isGetter(), offset);1522 JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, protoChain, count, propertyName, slot, offset); 1509 1523 1510 1524 if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1)) -
trunk/JavaScriptCore/jit/JITStubs.h
r55453 r55564 278 278 EncodedJSValue JIT_STUB cti_op_get_by_id_method_check(STUB_ARGS_DECLARATION); 279 279 EncodedJSValue JIT_STUB cti_op_get_by_id_getter_stub(STUB_ARGS_DECLARATION); 280 EncodedJSValue JIT_STUB cti_op_get_by_id_custom_stub(STUB_ARGS_DECLARATION); 280 281 EncodedJSValue JIT_STUB cti_op_get_by_id_proto_fail(STUB_ARGS_DECLARATION); 281 282 EncodedJSValue JIT_STUB cti_op_get_by_id_proto_list(STUB_ARGS_DECLARATION); -
trunk/JavaScriptCore/runtime/JSFunction.cpp
r55401 r55564 163 163 164 164 if (propertyName == exec->propertyNames().arguments) { 165 slot.setC ustom(this, argumentsGetter);165 slot.setCacheableCustom(this, argumentsGetter); 166 166 return true; 167 167 } 168 168 169 169 if (propertyName == exec->propertyNames().length) { 170 slot.setC ustom(this, lengthGetter);170 slot.setCacheableCustom(this, lengthGetter); 171 171 return true; 172 172 } 173 173 174 174 if (propertyName == exec->propertyNames().caller) { 175 slot.setC ustom(this, callerGetter);175 slot.setCacheableCustom(this, callerGetter); 176 176 return true; 177 177 } -
trunk/JavaScriptCore/runtime/Lookup.h
r53320 r55564 182 182 setUpStaticFunctionSlot(exec, entry, thisObj, propertyName, slot); 183 183 else 184 slot.setC ustom(thisObj, entry->propertyGetter());184 slot.setCacheableCustom(thisObj, entry->propertyGetter()); 185 185 186 186 return true; … … 259 259 ASSERT(!(entry->attributes() & Function)); 260 260 261 slot.setC ustom(thisObj, entry->propertyGetter());261 slot.setCacheableCustom(thisObj, entry->propertyGetter()); 262 262 return true; 263 263 } -
trunk/JavaScriptCore/runtime/PropertySlot.h
r55401 r55564 40 40 class PropertySlot { 41 41 public: 42 enum CachedPropertyType { 43 Uncacheable, 44 Getter, 45 Custom, 46 Value 47 }; 48 42 49 PropertySlot() 50 : m_cachedPropertyType(Uncacheable) 43 51 { 44 52 clearBase(); … … 49 57 explicit PropertySlot(const JSValue base) 50 58 : m_slotBase(base) 59 , m_cachedPropertyType(Uncacheable) 51 60 { 52 61 clearOffset(); … … 83 92 } 84 93 85 bool isGetter() const { return m_isGetter; }86 bool isCacheable() const { return m_ isCacheable; }87 bool isCacheableValue() const { return m_ isCacheable && !m_isGetter; }94 CachedPropertyType cachedPropertyType() const { return m_cachedPropertyType; } 95 bool isCacheable() const { return m_cachedPropertyType != Uncacheable; } 96 bool isCacheableValue() const { return m_cachedPropertyType == Value; } 88 97 size_t cachedOffset() const 89 98 { … … 116 125 m_data.valueSlot = valueSlot; 117 126 m_offset = offset; 118 m_isCacheable = true; 119 m_isGetter = false; 127 m_cachedPropertyType = Value; 120 128 } 121 129 … … 147 155 m_slotBase = slotBase; 148 156 } 157 158 void setCacheableCustom(JSValue slotBase, GetValueFunc getValue) 159 { 160 ASSERT(slotBase); 161 ASSERT(getValue); 162 m_getValue = getValue; 163 m_getIndexValue = 0; 164 m_slotBase = slotBase; 165 m_cachedPropertyType = Custom; 166 } 149 167 150 168 void setCustomIndex(JSValue slotBase, unsigned index, GetIndexValueFunc getIndexValue) … … 164 182 m_getValue = GETTER_FUNCTION_MARKER; 165 183 m_data.getterFunc = getterFunc; 166 m_isGetter = true;167 184 } 168 185 … … 175 192 m_data.getterFunc = getterFunc; 176 193 m_offset = offset; 177 m_isCacheable = true; 178 m_isGetter = true; 194 m_cachedPropertyType = Getter; 179 195 } 180 196 … … 215 231 // (For other data members, we don't need to clear anything because reuse would meaningfully overwrite them.) 216 232 m_offset = 0; 217 m_isCacheable = false; 218 m_isGetter = false; 233 m_cachedPropertyType = Uncacheable; 219 234 } 220 235 … … 222 237 223 238 JSValue thisValue() const { return m_thisValue; } 239 240 GetValueFunc customGetter() const 241 { 242 ASSERT(m_cachedPropertyType == Custom); 243 return m_getValue; 244 } 224 245 private: 225 246 JSValue functionGetter(ExecState*) const; … … 240 261 241 262 size_t m_offset; 242 bool m_isCacheable : 1; 243 bool m_isGetter : 1; 263 CachedPropertyType m_cachedPropertyType; 244 264 }; 245 265
Note:
See TracChangeset
for help on using the changeset viewer.