Changeset 49734 in webkit for trunk/JavaScriptCore/jit/JITStubs.cpp
- Timestamp:
- Oct 16, 2009, 10:52:20 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITStubs.cpp
r49726 r49734 701 701 // Structure transition, cache transition info 702 702 if (slot.type() == PutPropertySlot::NewProperty) { 703 StructureChain* prototypeChain = structure->prototypeChain(callFrame); 704 if (!prototypeChain->isCacheable() || structure->isDictionary()) { 703 if (structure->isDictionary()) { 705 704 ctiPatchCallByReturnAddress(codeBlock, returnAddress, FunctionPtr(cti_op_put_by_id_generic)); 706 705 return; 707 706 } 707 708 // put_by_id_transition checks the prototype chain for setters. 709 normalizePrototypeChain(callFrame, baseCell); 710 711 StructureChain* prototypeChain = structure->prototypeChain(callFrame); 708 712 stubInfo->initPutByIdTransition(structure->previousID(), structure, prototypeChain); 709 713 JIT::compilePutByIdTransition(callFrame->scopeChain()->globalData, codeBlock, stubInfo, structure->previousID(), structure, slot.cachedOffset(), prototypeChain, returnAddress); … … 781 785 } 782 786 783 size_t count = countPrototypeChainEntriesAndCheckForProxies(callFrame, baseValue, slot);787 size_t count = normalizePrototypeChain(callFrame, baseValue, slot.slotBase()); 784 788 if (!count) { 785 789 stubInfo->accessType = access_get_by_id_generic; … … 788 792 789 793 StructureChain* prototypeChain = structure->prototypeChain(callFrame); 790 if (!prototypeChain->isCacheable()) {791 ctiPatchCallByReturnAddress(codeBlock, returnAddress, FunctionPtr(cti_op_get_by_id_generic));792 return;793 }794 794 stubInfo->initGetByIdChain(structure, prototypeChain); 795 795 JIT::compileGetByIdChain(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, prototypeChain, count, slot.cachedOffset(), returnAddress); … … 1333 1333 if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1)) 1334 1334 ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_list_full)); 1335 } else if (size_t count = countPrototypeChainEntriesAndCheckForProxies(callFrame, baseValue, slot)) { 1336 StructureChain* protoChain = structure->prototypeChain(callFrame); 1337 if (!protoChain->isCacheable()) { 1338 ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_fail)); 1339 return JSValue::encode(result); 1340 } 1341 1335 } else if (size_t count = normalizePrototypeChain(callFrame, baseValue, slot.slotBase())) { 1342 1336 int listIndex; 1343 1337 PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex); 1338 1339 StructureChain* protoChain = structure->prototypeChain(callFrame); 1344 1340 JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, protoChain, count, slot.cachedOffset()); 1345 1341 … … 2672 2668 STUB_INIT_STACK_FRAME(stackFrame); 2673 2669 2674 return JSPropertyNameIterator::create(stackFrame.callFrame, stackFrame.args[0].jsValue()); 2675 } 2676 2677 DEFINE_STUB_FUNCTION(EncodedJSValue, op_next_pname) 2678 { 2679 STUB_INIT_STACK_FRAME(stackFrame); 2680 2681 JSPropertyNameIterator* it = stackFrame.args[0].propertyNameIterator(); 2682 JSValue temp = it->next(stackFrame.callFrame); 2683 if (!temp) 2684 it->invalidate(); 2685 return JSValue::encode(temp); 2670 CallFrame* callFrame = stackFrame.callFrame; 2671 JSObject* o = stackFrame.args[0].jsObject(); 2672 Structure* structure = o->structure(); 2673 JSPropertyNameIterator* jsPropertyNameIterator = structure->enumerationCache(); 2674 if (!jsPropertyNameIterator || jsPropertyNameIterator->cachedPrototypeChain() != structure->prototypeChain(callFrame)) 2675 jsPropertyNameIterator = JSPropertyNameIterator::create(callFrame, o); 2676 return jsPropertyNameIterator; 2677 } 2678 2679 DEFINE_STUB_FUNCTION(int, has_property) 2680 { 2681 STUB_INIT_STACK_FRAME(stackFrame); 2682 2683 JSObject* base = stackFrame.args[0].jsObject(); 2684 JSString* property = stackFrame.args[1].jsString(); 2685 return base->hasProperty(stackFrame.callFrame, Identifier(stackFrame.callFrame, property->value())); 2686 2686 } 2687 2687 … … 3024 3024 } 3025 3025 3026 DEFINE_STUB_FUNCTION(EncodedJSValue, to_object) 3027 { 3028 STUB_INIT_STACK_FRAME(stackFrame); 3029 3030 CallFrame* callFrame = stackFrame.callFrame; 3031 return JSValue::encode(stackFrame.args[0].jsValue().toObject(callFrame)); 3032 } 3033 3026 3034 } // namespace JSC 3027 3035
Note:
See TracChangeset
for help on using the changeset viewer.