 Chromium Code Reviews
 Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. | 
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without | 
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are | 
| 4 // met: | 4 // met: | 
| 5 // | 5 // | 
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright | 
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. | 
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above | 
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following | 
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided | 
| (...skipping 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2158 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 2158 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 
| 2159 : isolate()->builtins()->StoreIC_Initialize(); | 2159 : isolate()->builtins()->StoreIC_Initialize(); | 
| 2160 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); | 2160 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); | 
| 2161 } | 2161 } | 
| 2162 | 2162 | 
| 2163 | 2163 | 
| 2164 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2164 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 
| 2165 Register context = ToRegister(instr->context()); | 2165 Register context = ToRegister(instr->context()); | 
| 2166 Register result = ToRegister(instr->result()); | 2166 Register result = ToRegister(instr->result()); | 
| 2167 __ mov(result, ContextOperand(context, instr->slot_index())); | 2167 __ mov(result, ContextOperand(context, instr->slot_index())); | 
| 2168 | |
| 2168 if (instr->hydrogen()->RequiresHoleCheck()) { | 2169 if (instr->hydrogen()->RequiresHoleCheck()) { | 
| 2169 __ cmp(result, factory()->the_hole_value()); | 2170 __ cmp(result, factory()->the_hole_value()); | 
| 2170 DeoptimizeIf(equal, instr->environment()); | 2171 if (instr->hydrogen()->DeoptimizesOnHole()) { | 
| 2172 DeoptimizeIf(equal, instr->environment()); | |
| 2173 } else { | |
| 2174 Label is_not_hole; | |
| 2175 __ j(not_equal, &is_not_hole, Label::kNear); | |
| 2176 | |
| 
Steven
2011/12/12 13:12:44
Those blank lines do not help readability. Could y
 | |
| 2177 __ mov(result, factory()->undefined_value()); | |
| 2178 | |
| 2179 __ bind(&is_not_hole); | |
| 2180 } | |
| 2171 } | 2181 } | 
| 2172 } | 2182 } | 
| 2173 | 2183 | 
| 2174 | 2184 | 
| 2175 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2185 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 
| 2176 Register context = ToRegister(instr->context()); | 2186 Register context = ToRegister(instr->context()); | 
| 2177 Register value = ToRegister(instr->value()); | 2187 Register value = ToRegister(instr->value()); | 
| 2188 | |
| 2189 Label skip_assignment; | |
| 2190 | |
| 2178 Operand target = ContextOperand(context, instr->slot_index()); | 2191 Operand target = ContextOperand(context, instr->slot_index()); | 
| 2179 if (instr->hydrogen()->RequiresHoleCheck()) { | 2192 if (instr->hydrogen()->RequiresHoleCheck()) { | 
| 2180 __ cmp(target, factory()->the_hole_value()); | 2193 __ cmp(target, factory()->the_hole_value()); | 
| 2181 DeoptimizeIf(equal, instr->environment()); | 2194 if (instr->hydrogen()->DeoptimizesOnHole()) { | 
| 2195 DeoptimizeIf(equal, instr->environment()); | |
| 2196 } else { | |
| 2197 __ j(not_equal, &skip_assignment, Label::kNear); | |
| 2198 } | |
| 2182 } | 2199 } | 
| 2200 | |
| 2183 __ mov(target, value); | 2201 __ mov(target, value); | 
| 2184 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2202 if (instr->hydrogen()->NeedsWriteBarrier()) { | 
| 2185 HType type = instr->hydrogen()->value()->type(); | 2203 HType type = instr->hydrogen()->value()->type(); | 
| 2186 SmiCheck check_needed = | 2204 SmiCheck check_needed = | 
| 2187 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2205 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 
| 2188 Register temp = ToRegister(instr->TempAt(0)); | 2206 Register temp = ToRegister(instr->TempAt(0)); | 
| 2189 int offset = Context::SlotOffset(instr->slot_index()); | 2207 int offset = Context::SlotOffset(instr->slot_index()); | 
| 2190 __ RecordWriteContextSlot(context, | 2208 __ RecordWriteContextSlot(context, | 
| 2191 offset, | 2209 offset, | 
| 2192 value, | 2210 value, | 
| 2193 temp, | 2211 temp, | 
| 2194 kSaveFPRegs, | 2212 kSaveFPRegs, | 
| 2195 EMIT_REMEMBERED_SET, | 2213 EMIT_REMEMBERED_SET, | 
| 2196 check_needed); | 2214 check_needed); | 
| 2197 } | 2215 } | 
| 2216 | |
| 2217 __ bind(&skip_assignment); | |
| 2198 } | 2218 } | 
| 2199 | 2219 | 
| 2200 | 2220 | 
| 2201 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2221 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 
| 2202 Register object = ToRegister(instr->object()); | 2222 Register object = ToRegister(instr->object()); | 
| 2203 Register result = ToRegister(instr->result()); | 2223 Register result = ToRegister(instr->result()); | 
| 2204 if (instr->hydrogen()->is_in_object()) { | 2224 if (instr->hydrogen()->is_in_object()) { | 
| 2205 __ mov(result, FieldOperand(object, instr->hydrogen()->offset())); | 2225 __ mov(result, FieldOperand(object, instr->hydrogen()->offset())); | 
| 2206 } else { | 2226 } else { | 
| 2207 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); | 2227 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); | 
| (...skipping 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4617 this, pointers, Safepoint::kLazyDeopt); | 4637 this, pointers, Safepoint::kLazyDeopt); | 
| 4618 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4638 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 
| 4619 } | 4639 } | 
| 4620 | 4640 | 
| 4621 | 4641 | 
| 4622 #undef __ | 4642 #undef __ | 
| 4623 | 4643 | 
| 4624 } } // namespace v8::internal | 4644 } } // namespace v8::internal | 
| 4625 | 4645 | 
| 4626 #endif // V8_TARGET_ARCH_IA32 | 4646 #endif // V8_TARGET_ARCH_IA32 | 
| OLD | NEW |