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

Unified Diff: src/ia32/macro-assembler-ia32.cc

Issue 892843002: Add mistagging-readbarrier to weak cell Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ic/ia32/handler-compiler-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/macro-assembler-ia32.cc
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
index 27f8f35b66ff277f2d340c581e1c05e51f894f42..bb902da535fbc9c89e465190c201069c9c3d8023 100644
--- a/src/ia32/macro-assembler-ia32.cc
+++ b/src/ia32/macro-assembler-ia32.cc
@@ -2398,16 +2398,31 @@ void MacroAssembler::PushHeapObject(Handle<HeapObject> object) {
void MacroAssembler::CmpWeakValue(Register value, Handle<WeakCell> cell,
Register scratch) {
+ // TODO(erikcorry): Perhaps we can use a special weak cell that does not have
+ // a read barrier, since we are not using it here. But then we have to be
+ // sure we don't use the weak cell for normal loads that need a read barrier.
mov(scratch, cell);
- cmp(value, FieldOperand(scratch, WeakCell::kValueOffset));
+ mov(scratch,
+ FieldOperand(scratch, WeakCell::kValueOffsetDontForgetTheReadBarrier));
+ and_(scratch, Immediate(~kReadBarrierTag));
+ cmp(value, scratch);
}
-void MacroAssembler::LoadWeakValue(Register value, Handle<WeakCell> cell,
- Label* miss) {
- mov(value, cell);
- mov(value, FieldOperand(value, WeakCell::kValueOffset));
+void MacroAssembler::LoadWeakValue(Register value, Register scratch,
+ Handle<WeakCell> cell, Label* miss) {
+ DCHECK(!value.is(scratch));
+ mov(scratch, cell);
+ mov(value,
+ FieldOperand(scratch, WeakCell::kValueOffsetDontForgetTheReadBarrier));
JumpIfSmi(value, miss);
+ Label done;
+ test(value, Immediate(kReadBarrierTag));
+ j(not_zero, &done);
Hannes Payer (out of office) 2015/02/04 13:03:44 Do we need the test? Maybe the cpu is more happy w
+ and_(value, Immediate(~kReadBarrierTag));
+ mov(FieldOperand(scratch, WeakCell::kValueOffsetDontForgetTheReadBarrier),
+ value);
+ bind(&done);
}
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ic/ia32/handler-compiler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698