| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 2943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2954 | 2954 |
| 2955 __ bind(&skip_assignment); | 2955 __ bind(&skip_assignment); |
| 2956 } | 2956 } |
| 2957 | 2957 |
| 2958 | 2958 |
| 2959 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2959 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
| 2960 HObjectAccess access = instr->hydrogen()->access(); | 2960 HObjectAccess access = instr->hydrogen()->access(); |
| 2961 int offset = access.offset(); | 2961 int offset = access.offset(); |
| 2962 | 2962 |
| 2963 if (access.IsExternalMemory()) { | 2963 if (access.IsExternalMemory()) { |
| 2964 DCHECK(!access.read_barrier()); |
| 2964 Register result = ToRegister(instr->result()); | 2965 Register result = ToRegister(instr->result()); |
| 2965 MemOperand operand = instr->object()->IsConstantOperand() | 2966 MemOperand operand = instr->object()->IsConstantOperand() |
| 2966 ? MemOperand::StaticVariable(ToExternalReference( | 2967 ? MemOperand::StaticVariable(ToExternalReference( |
| 2967 LConstantOperand::cast(instr->object()))) | 2968 LConstantOperand::cast(instr->object()))) |
| 2968 : MemOperand(ToRegister(instr->object()), offset); | 2969 : MemOperand(ToRegister(instr->object()), offset); |
| 2969 __ Load(result, operand, access.representation()); | 2970 __ Load(result, operand, access.representation()); |
| 2970 return; | 2971 return; |
| 2971 } | 2972 } |
| 2972 | 2973 |
| 2973 Register object = ToRegister(instr->object()); | 2974 Register object = ToRegister(instr->object()); |
| 2974 if (instr->hydrogen()->representation().IsDouble()) { | 2975 if (instr->hydrogen()->representation().IsDouble()) { |
| 2976 DCHECK(!access.read_barrier()); |
| 2975 XMMRegister result = ToDoubleRegister(instr->result()); | 2977 XMMRegister result = ToDoubleRegister(instr->result()); |
| 2976 __ movsd(result, FieldOperand(object, offset)); | 2978 __ movsd(result, FieldOperand(object, offset)); |
| 2977 return; | 2979 return; |
| 2978 } | 2980 } |
| 2979 | 2981 |
| 2980 Register result = ToRegister(instr->result()); | 2982 Register result = ToRegister(instr->result()); |
| 2981 if (!access.IsInobject()) { | 2983 if (!access.IsInobject()) { |
| 2984 DCHECK(!access.read_barrier()); |
| 2982 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); | 2985 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); |
| 2983 object = result; | 2986 object = result; |
| 2984 } | 2987 } |
| 2988 if (access.read_barrier()) { |
| 2989 DCHECK(!result.is(object)); |
| 2990 DCHECK(instr->hydrogen()->representation().IsTagged()); |
| 2991 // Read barrier: Change the map to show we used the weak cell. |
| 2992 __ LoadHeapObject(result, factory()->used_weak_cell_map()); |
| 2993 __ mov(FieldOperand(object, HeapObject::kMapOffset), result); |
| 2994 } |
| 2985 __ Load(result, FieldOperand(object, offset), access.representation()); | 2995 __ Load(result, FieldOperand(object, offset), access.representation()); |
| 2986 } | 2996 } |
| 2987 | 2997 |
| 2988 | 2998 |
| 2989 void LCodeGen::EmitPushTaggedOperand(LOperand* operand) { | 2999 void LCodeGen::EmitPushTaggedOperand(LOperand* operand) { |
| 2990 DCHECK(!operand->IsDoubleRegister()); | 3000 DCHECK(!operand->IsDoubleRegister()); |
| 2991 if (operand->IsConstantOperand()) { | 3001 if (operand->IsConstantOperand()) { |
| 2992 Handle<Object> object = ToHandle(LConstantOperand::cast(operand)); | 3002 Handle<Object> object = ToHandle(LConstantOperand::cast(operand)); |
| 2993 AllowDeferredHandleDereference smi_check; | 3003 AllowDeferredHandleDereference smi_check; |
| 2994 if (object->IsSmi()) { | 3004 if (object->IsSmi()) { |
| (...skipping 2777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5772 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5782 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5773 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5783 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5774 } | 5784 } |
| 5775 | 5785 |
| 5776 | 5786 |
| 5777 #undef __ | 5787 #undef __ |
| 5778 | 5788 |
| 5779 } } // namespace v8::internal | 5789 } } // namespace v8::internal |
| 5780 | 5790 |
| 5781 #endif // V8_TARGET_ARCH_IA32 | 5791 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |