Changeset 62896 in webkit for trunk/JavaScriptCore/interpreter/Interpreter.cpp
- Timestamp:
- Jul 8, 2010, 10:47:49 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r62766 r62896 2903 2903 } 2904 2904 DEFINE_OPCODE(op_put_by_id) { 2905 /* put_by_id base(r) property(id) value(r) nop(n) nop(n) nop(n) nop(n) 2905 /* put_by_id base(r) property(id) value(r) nop(n) nop(n) nop(n) nop(n) direct(b) 2906 2906 2907 2907 Generic property access: Sets the property named by identifier … … 2910 2910 Unlike many opcodes, this one does not write any output to 2911 2911 the register file. 2912 2913 The "direct" flag should only be set this put_by_id is to initialize 2914 an object literal. 2912 2915 */ 2913 2916 … … 2915 2918 int property = vPC[2].u.operand; 2916 2919 int value = vPC[3].u.operand; 2920 int direct = vPC[8].u.operand; 2917 2921 2918 2922 JSValue baseValue = callFrame->r(base).jsValue(); 2919 2923 Identifier& ident = codeBlock->identifier(property); 2920 2924 PutPropertySlot slot; 2921 baseValue.put(callFrame, ident, callFrame->r(value).jsValue(), slot); 2925 if (direct) { 2926 baseValue.putDirect(callFrame, ident, callFrame->r(value).jsValue(), slot); 2927 ASSERT(slot.base() == baseValue); 2928 } else 2929 baseValue.put(callFrame, ident, callFrame->r(value).jsValue(), slot); 2922 2930 CHECK_FOR_EXCEPTION(); 2923 2931 … … 2928 2936 } 2929 2937 DEFINE_OPCODE(op_put_by_id_transition) { 2930 /* op_put_by_id_transition base(r) property(id) value(r) oldStructure(sID) newStructure(sID) structureChain(chain) offset(n) 2938 /* op_put_by_id_transition base(r) property(id) value(r) oldStructure(sID) newStructure(sID) structureChain(chain) offset(n) direct(b) 2931 2939 2932 2940 Cached property access: Attempts to set a new property with a cached transition … … 2949 2957 ASSERT(baseCell->isObject()); 2950 2958 JSObject* baseObject = asObject(baseCell); 2951 2952 RefPtr<Structure>* it = vPC[6].u.structureChain->head(); 2953 2954 JSValue proto = baseObject->structure()->prototypeForLookup(callFrame); 2955 while (!proto.isNull()) { 2956 if (UNLIKELY(asObject(proto)->structure() != (*it).get())) { 2957 uncachePutByID(codeBlock, vPC); 2958 NEXT_INSTRUCTION(); 2959 int direct = vPC[8].u.operand; 2960 2961 if (direct) { 2962 RefPtr<Structure>* it = vPC[6].u.structureChain->head(); 2963 2964 JSValue proto = baseObject->structure()->prototypeForLookup(callFrame); 2965 while (!proto.isNull()) { 2966 if (UNLIKELY(asObject(proto)->structure() != (*it).get())) { 2967 uncachePutByID(codeBlock, vPC); 2968 NEXT_INSTRUCTION(); 2969 } 2970 ++it; 2971 proto = asObject(proto)->structure()->prototypeForLookup(callFrame); 2959 2972 } 2960 ++it;2961 proto = asObject(proto)->structure()->prototypeForLookup(callFrame);2962 2973 } 2963 2964 2974 baseObject->transitionTo(newStructure); 2965 2975 … … 2978 2988 } 2979 2989 DEFINE_OPCODE(op_put_by_id_replace) { 2980 /* op_put_by_id_replace base(r) property(id) value(r) structure(sID) offset(n) nop(n) nop(n) 2990 /* op_put_by_id_replace base(r) property(id) value(r) structure(sID) offset(n) nop(n) nop(n) direct(b) 2981 2991 2982 2992 Cached property access: Attempts to set a pre-existing, cached … … 3013 3023 } 3014 3024 DEFINE_OPCODE(op_put_by_id_generic) { 3015 /* op_put_by_id_generic base(r) property(id) value(r) nop(n) nop(n) nop(n) nop(n) 3025 /* op_put_by_id_generic base(r) property(id) value(r) nop(n) nop(n) nop(n) nop(n) direct(b) 3016 3026 3017 3027 Generic property access: Sets the property named by identifier … … 3024 3034 int property = vPC[2].u.operand; 3025 3035 int value = vPC[3].u.operand; 3036 int direct = vPC[8].u.operand; 3026 3037 3027 3038 JSValue baseValue = callFrame->r(base).jsValue(); 3028 3039 Identifier& ident = codeBlock->identifier(property); 3029 3040 PutPropertySlot slot; 3030 baseValue.put(callFrame, ident, callFrame->r(value).jsValue(), slot); 3041 if (direct) { 3042 baseValue.putDirect(callFrame, ident, callFrame->r(value).jsValue(), slot); 3043 ASSERT(slot.base() == baseValue); 3044 } else 3045 baseValue.put(callFrame, ident, callFrame->r(value).jsValue(), slot); 3031 3046 CHECK_FOR_EXCEPTION(); 3032 3047
Note:
See TracChangeset
for help on using the changeset viewer.