| 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 2944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2955 | 2955 |
| 2956 __ bind(&skip_assignment); | 2956 __ bind(&skip_assignment); |
| 2957 } | 2957 } |
| 2958 | 2958 |
| 2959 | 2959 |
| 2960 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2960 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
| 2961 HObjectAccess access = instr->hydrogen()->access(); | 2961 HObjectAccess access = instr->hydrogen()->access(); |
| 2962 int offset = access.offset(); | 2962 int offset = access.offset(); |
| 2963 | 2963 |
| 2964 if (access.IsExternalMemory()) { | 2964 if (access.IsExternalMemory()) { |
| 2965 DCHECK(!access.read_barrier()); |
| 2965 Register result = ToRegister(instr->result()); | 2966 Register result = ToRegister(instr->result()); |
| 2966 MemOperand operand = instr->object()->IsConstantOperand() | 2967 MemOperand operand = instr->object()->IsConstantOperand() |
| 2967 ? MemOperand::StaticVariable(ToExternalReference( | 2968 ? MemOperand::StaticVariable(ToExternalReference( |
| 2968 LConstantOperand::cast(instr->object()))) | 2969 LConstantOperand::cast(instr->object()))) |
| 2969 : MemOperand(ToRegister(instr->object()), offset); | 2970 : MemOperand(ToRegister(instr->object()), offset); |
| 2970 __ Load(result, operand, access.representation()); | 2971 __ Load(result, operand, access.representation()); |
| 2971 return; | 2972 return; |
| 2972 } | 2973 } |
| 2973 | 2974 |
| 2974 Register object = ToRegister(instr->object()); | 2975 Register object = ToRegister(instr->object()); |
| 2975 if (instr->hydrogen()->representation().IsDouble()) { | 2976 if (instr->hydrogen()->representation().IsDouble()) { |
| 2977 DCHECK(!access.read_barrier()); |
| 2976 XMMRegister result = ToDoubleRegister(instr->result()); | 2978 XMMRegister result = ToDoubleRegister(instr->result()); |
| 2977 __ movsd(result, FieldOperand(object, offset)); | 2979 __ movsd(result, FieldOperand(object, offset)); |
| 2978 return; | 2980 return; |
| 2979 } | 2981 } |
| 2980 | 2982 |
| 2981 Register result = ToRegister(instr->result()); | 2983 Register result = ToRegister(instr->result()); |
| 2982 if (!access.IsInobject()) { | 2984 if (!access.IsInobject()) { |
| 2985 DCHECK(!access.read_barrier()); |
| 2983 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); | 2986 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); |
| 2984 object = result; | 2987 object = result; |
| 2985 } | 2988 } |
| 2989 if (access.read_barrier()) { |
| 2990 DCHECK(!result.is(object)); |
| 2991 DCHECK(instr->hydrogen()->representation().IsTagged()); |
| 2992 __ Load(result, FieldOperand(object, offset), access.representation()); |
| 2993 Label done; |
| 2994 DCHECK_NE(kReadBarrierTag, 0); |
| 2995 __ test(result, Immediate(kReadBarrierMask)); |
| 2996 __ j(zero, &done); |
| 2997 __ test(result, Immediate(kSmiTagMask)); |
| 2998 DCHECK_EQ(kSmiTag, 0); |
| 2999 __ j(zero, &done); |
| 3000 __ and_(result, Immediate(~kReadBarrierTag)); |
| 3001 __ mov(FieldOperand(object, offset), result); |
| 3002 __ bind(&done); |
| 3003 return; |
| 3004 } |
| 2986 __ Load(result, FieldOperand(object, offset), access.representation()); | 3005 __ Load(result, FieldOperand(object, offset), access.representation()); |
| 2987 } | 3006 } |
| 2988 | 3007 |
| 2989 | 3008 |
| 2990 void LCodeGen::EmitPushTaggedOperand(LOperand* operand) { | 3009 void LCodeGen::EmitPushTaggedOperand(LOperand* operand) { |
| 2991 DCHECK(!operand->IsDoubleRegister()); | 3010 DCHECK(!operand->IsDoubleRegister()); |
| 2992 if (operand->IsConstantOperand()) { | 3011 if (operand->IsConstantOperand()) { |
| 2993 Handle<Object> object = ToHandle(LConstantOperand::cast(operand)); | 3012 Handle<Object> object = ToHandle(LConstantOperand::cast(operand)); |
| 2994 AllowDeferredHandleDereference smi_check; | 3013 AllowDeferredHandleDereference smi_check; |
| 2995 if (object->IsSmi()) { | 3014 if (object->IsSmi()) { |
| (...skipping 2753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5749 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5768 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5750 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5769 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5751 } | 5770 } |
| 5752 | 5771 |
| 5753 | 5772 |
| 5754 #undef __ | 5773 #undef __ |
| 5755 | 5774 |
| 5756 } } // namespace v8::internal | 5775 } } // namespace v8::internal |
| 5757 | 5776 |
| 5758 #endif // V8_TARGET_ARCH_IA32 | 5777 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |