Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(628)

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 893073006: Add map-based read barrier to WeakCell Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2945 matching lines...) Expand 10 before | Expand all | Expand 10 after
2956 2956
2957 __ bind(&skip_assignment); 2957 __ bind(&skip_assignment);
2958 } 2958 }
2959 2959
2960 2960
2961 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { 2961 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
2962 HObjectAccess access = instr->hydrogen()->access(); 2962 HObjectAccess access = instr->hydrogen()->access();
2963 int offset = access.offset(); 2963 int offset = access.offset();
2964 2964
2965 if (access.IsExternalMemory()) { 2965 if (access.IsExternalMemory()) {
2966 DCHECK(!access.read_barrier());
2966 Register result = ToRegister(instr->result()); 2967 Register result = ToRegister(instr->result());
2967 MemOperand operand = instr->object()->IsConstantOperand() 2968 MemOperand operand = instr->object()->IsConstantOperand()
2968 ? MemOperand::StaticVariable(ToExternalReference( 2969 ? MemOperand::StaticVariable(ToExternalReference(
2969 LConstantOperand::cast(instr->object()))) 2970 LConstantOperand::cast(instr->object())))
2970 : MemOperand(ToRegister(instr->object()), offset); 2971 : MemOperand(ToRegister(instr->object()), offset);
2971 __ Load(result, operand, access.representation()); 2972 __ Load(result, operand, access.representation());
2972 return; 2973 return;
2973 } 2974 }
2974 2975
2975 Register object = ToRegister(instr->object()); 2976 Register object = ToRegister(instr->object());
2976 if (instr->hydrogen()->representation().IsDouble()) { 2977 if (instr->hydrogen()->representation().IsDouble()) {
2978 DCHECK(!access.read_barrier());
2977 XMMRegister result = ToDoubleRegister(instr->result()); 2979 XMMRegister result = ToDoubleRegister(instr->result());
2978 __ movsd(result, FieldOperand(object, offset)); 2980 __ movsd(result, FieldOperand(object, offset));
2979 return; 2981 return;
2980 } 2982 }
2981 2983
2982 Register result = ToRegister(instr->result()); 2984 Register result = ToRegister(instr->result());
2983 if (!access.IsInobject()) { 2985 if (!access.IsInobject()) {
2986 DCHECK(!access.read_barrier());
2984 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); 2987 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset));
2985 object = result; 2988 object = result;
2986 } 2989 }
2990 if (access.read_barrier()) {
2991 DCHECK(!result.is(object));
2992 DCHECK(instr->hydrogen()->representation().IsTagged());
2993 // Read barrier: Change the map to show we used the weak cell.
2994 __ LoadHeapObject(result, factory()->used_weak_cell_map());
2995 __ mov(result, FieldOperand(object, HeapObject::kMapOffset));
ulan 2015/02/04 09:35:04 __ mov(FieldOperand(object, HeapObject::kMapOffset
Erik Corry 2015/02/04 10:49:42 This is intended to be a store, not a load.
ulan 2015/02/04 11:08:10 Yep. The destination of the mov is the first argum
2996 }
2987 __ Load(result, FieldOperand(object, offset), access.representation()); 2997 __ Load(result, FieldOperand(object, offset), access.representation());
2988 } 2998 }
2989 2999
2990 3000
2991 void LCodeGen::EmitPushTaggedOperand(LOperand* operand) { 3001 void LCodeGen::EmitPushTaggedOperand(LOperand* operand) {
2992 DCHECK(!operand->IsDoubleRegister()); 3002 DCHECK(!operand->IsDoubleRegister());
2993 if (operand->IsConstantOperand()) { 3003 if (operand->IsConstantOperand()) {
2994 Handle<Object> object = ToHandle(LConstantOperand::cast(operand)); 3004 Handle<Object> object = ToHandle(LConstantOperand::cast(operand));
2995 AllowDeferredHandleDereference smi_check; 3005 AllowDeferredHandleDereference smi_check;
2996 if (object->IsSmi()) { 3006 if (object->IsSmi()) {
(...skipping 2775 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698