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

Unified 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: Fix merge 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
index 3e6de5f0bc61f7ea0fc1ae51c437f4cdaadfbbaa..9efbcd2bc11a54ca95b2a800f0cfa01a1dda2655 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -2961,6 +2961,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
int offset = access.offset();
if (access.IsExternalMemory()) {
+ DCHECK(!access.read_barrier());
Register result = ToRegister(instr->result());
MemOperand operand = instr->object()->IsConstantOperand()
? MemOperand::StaticVariable(ToExternalReference(
@@ -2972,6 +2973,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
Register object = ToRegister(instr->object());
if (instr->hydrogen()->representation().IsDouble()) {
+ DCHECK(!access.read_barrier());
XMMRegister result = ToDoubleRegister(instr->result());
__ movsd(result, FieldOperand(object, offset));
return;
@@ -2979,9 +2981,17 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
Register result = ToRegister(instr->result());
if (!access.IsInobject()) {
+ DCHECK(!access.read_barrier());
__ mov(result, FieldOperand(object, JSObject::kPropertiesOffset));
object = result;
}
+ if (access.read_barrier()) {
+ DCHECK(!result.is(object));
+ DCHECK(instr->hydrogen()->representation().IsTagged());
+ // Read barrier: Change the map to show we used the weak cell.
+ __ LoadHeapObject(result, factory()->used_weak_cell_map());
+ __ mov(FieldOperand(object, HeapObject::kMapOffset), result);
+ }
__ Load(result, FieldOperand(object, offset), access.representation());
}
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698