Changeset 49726 in webkit for trunk/JavaScriptCore/jit/JITStubs.cpp
- Timestamp:
- Oct 16, 2009, 7:31:42 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITStubs.cpp
r49717 r49726 701 701 // Structure transition, cache transition info 702 702 if (slot.type() == PutPropertySlot::NewProperty) { 703 if (structure->isDictionary()) { 703 StructureChain* prototypeChain = structure->prototypeChain(callFrame); 704 if (!prototypeChain->isCacheable() || structure->isDictionary()) { 704 705 ctiPatchCallByReturnAddress(codeBlock, returnAddress, FunctionPtr(cti_op_put_by_id_generic)); 705 706 return; 706 707 } 707 708 // put_by_id_transition checks the prototype chain for setters.709 normalizePrototypeChain(callFrame, baseCell);710 711 StructureChain* prototypeChain = structure->prototypeChain(callFrame);712 708 stubInfo->initPutByIdTransition(structure->previousID(), structure, prototypeChain); 713 709 JIT::compilePutByIdTransition(callFrame->scopeChain()->globalData, codeBlock, stubInfo, structure->previousID(), structure, slot.cachedOffset(), prototypeChain, returnAddress); … … 785 781 } 786 782 787 size_t count = normalizePrototypeChain(callFrame, baseValue, slot.slotBase());783 size_t count = countPrototypeChainEntriesAndCheckForProxies(callFrame, baseValue, slot); 788 784 if (!count) { 789 785 stubInfo->accessType = access_get_by_id_generic; … … 792 788 793 789 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 = normalizePrototypeChain(callFrame, baseValue, slot.slotBase())) { 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 1336 1342 int listIndex; 1337 1343 PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex); 1338 1339 StructureChain* protoChain = structure->prototypeChain(callFrame);1340 1344 JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, protoChain, count, slot.cachedOffset()); 1341 1345 … … 2668 2672 STUB_INIT_STACK_FRAME(stackFrame); 2669 2673 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())); 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); 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 3034 3026 } // namespace JSC 3035 3027
Note:
See TracChangeset
for help on using the changeset viewer.