Commit 81c4a422 authored by ulan's avatar ulan Committed by Commit bot

Use weak cells in CheckPropertyCell.

BUG=v8:3629
LOG=N

Review URL: https://codereview.chromium.org/815143002

Cr-Commit-Position: refs/heads/master@{#26379}
parent 79cad15c
...@@ -201,7 +201,8 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell( ...@@ -201,7 +201,8 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell(
Register scratch, Label* miss) { Register scratch, Label* miss) {
Handle<Cell> cell = JSGlobalObject::EnsurePropertyCell(global, name); Handle<Cell> cell = JSGlobalObject::EnsurePropertyCell(global, name);
DCHECK(cell->value()->IsTheHole()); DCHECK(cell->value()->IsTheHole());
__ mov(scratch, Operand(cell)); Handle<WeakCell> weak_cell = masm->isolate()->factory()->NewWeakCell(cell);
__ LoadWeakValue(scratch, weak_cell, miss);
__ ldr(scratch, FieldMemOperand(scratch, Cell::kValueOffset)); __ ldr(scratch, FieldMemOperand(scratch, Cell::kValueOffset));
__ LoadRoot(ip, Heap::kTheHoleValueRootIndex); __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
__ cmp(scratch, ip); __ cmp(scratch, ip);
......
...@@ -111,7 +111,8 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell( ...@@ -111,7 +111,8 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell(
Register scratch, Label* miss) { Register scratch, Label* miss) {
Handle<Cell> cell = JSGlobalObject::EnsurePropertyCell(global, name); Handle<Cell> cell = JSGlobalObject::EnsurePropertyCell(global, name);
DCHECK(cell->value()->IsTheHole()); DCHECK(cell->value()->IsTheHole());
__ Mov(scratch, Operand(cell)); Handle<WeakCell> weak_cell = masm->isolate()->factory()->NewWeakCell(cell);
__ LoadWeakValue(scratch, weak_cell, miss);
__ Ldr(scratch, FieldMemOperand(scratch, Cell::kValueOffset)); __ Ldr(scratch, FieldMemOperand(scratch, Cell::kValueOffset));
__ JumpIfNotRoot(scratch, Heap::kTheHoleValueRootIndex, miss); __ JumpIfNotRoot(scratch, Heap::kTheHoleValueRootIndex, miss);
} }
......
...@@ -227,14 +227,11 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell( ...@@ -227,14 +227,11 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell(
Register scratch, Label* miss) { Register scratch, Label* miss) {
Handle<PropertyCell> cell = JSGlobalObject::EnsurePropertyCell(global, name); Handle<PropertyCell> cell = JSGlobalObject::EnsurePropertyCell(global, name);
DCHECK(cell->value()->IsTheHole()); DCHECK(cell->value()->IsTheHole());
Handle<Oddball> the_hole = masm->isolate()->factory()->the_hole_value(); Factory* factory = masm->isolate()->factory();
if (masm->serializer_enabled()) { Handle<WeakCell> weak_cell = factory->NewWeakCell(cell);
__ mov(scratch, Immediate(cell)); __ LoadWeakValue(scratch, weak_cell, miss);
__ cmp(FieldOperand(scratch, PropertyCell::kValueOffset), __ cmp(FieldOperand(scratch, PropertyCell::kValueOffset),
Immediate(the_hole)); Immediate(factory->the_hole_value()));
} else {
__ cmp(Operand::ForCell(cell), Immediate(the_hole));
}
__ j(not_equal, miss); __ j(not_equal, miss);
} }
......
...@@ -197,7 +197,8 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell( ...@@ -197,7 +197,8 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell(
Register scratch, Label* miss) { Register scratch, Label* miss) {
Handle<Cell> cell = JSGlobalObject::EnsurePropertyCell(global, name); Handle<Cell> cell = JSGlobalObject::EnsurePropertyCell(global, name);
DCHECK(cell->value()->IsTheHole()); DCHECK(cell->value()->IsTheHole());
__ li(scratch, Operand(cell)); Handle<WeakCell> weak_cell = masm->isolate()->factory()->NewWeakCell(cell);
__ LoadWeakValue(scratch, weak_cell, miss);
__ lw(scratch, FieldMemOperand(scratch, Cell::kValueOffset)); __ lw(scratch, FieldMemOperand(scratch, Cell::kValueOffset));
__ LoadRoot(at, Heap::kTheHoleValueRootIndex); __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
__ Branch(miss, ne, scratch, Operand(at)); __ Branch(miss, ne, scratch, Operand(at));
......
...@@ -198,7 +198,8 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell( ...@@ -198,7 +198,8 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell(
Register scratch, Label* miss) { Register scratch, Label* miss) {
Handle<Cell> cell = JSGlobalObject::EnsurePropertyCell(global, name); Handle<Cell> cell = JSGlobalObject::EnsurePropertyCell(global, name);
DCHECK(cell->value()->IsTheHole()); DCHECK(cell->value()->IsTheHole());
__ li(scratch, Operand(cell)); Handle<WeakCell> weak_cell = masm->isolate()->factory()->NewWeakCell(cell);
__ LoadWeakValue(scratch, weak_cell, miss);
__ ld(scratch, FieldMemOperand(scratch, Cell::kValueOffset)); __ ld(scratch, FieldMemOperand(scratch, Cell::kValueOffset));
__ LoadRoot(at, Heap::kTheHoleValueRootIndex); __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
__ Branch(miss, ne, scratch, Operand(at)); __ Branch(miss, ne, scratch, Operand(at));
......
...@@ -206,9 +206,10 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell( ...@@ -206,9 +206,10 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell(
Register scratch, Label* miss) { Register scratch, Label* miss) {
Handle<PropertyCell> cell = JSGlobalObject::EnsurePropertyCell(global, name); Handle<PropertyCell> cell = JSGlobalObject::EnsurePropertyCell(global, name);
DCHECK(cell->value()->IsTheHole()); DCHECK(cell->value()->IsTheHole());
__ Move(scratch, cell); Factory* factory = masm->isolate()->factory();
__ Cmp(FieldOperand(scratch, Cell::kValueOffset), Handle<WeakCell> weak_cell = factory->NewWeakCell(cell);
masm->isolate()->factory()->the_hole_value()); __ LoadWeakValue(scratch, weak_cell, miss);
__ Cmp(FieldOperand(scratch, Cell::kValueOffset), factory->the_hole_value());
__ j(not_equal, miss); __ j(not_equal, miss);
} }
......
...@@ -227,14 +227,11 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell( ...@@ -227,14 +227,11 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell(
Register scratch, Label* miss) { Register scratch, Label* miss) {
Handle<PropertyCell> cell = JSGlobalObject::EnsurePropertyCell(global, name); Handle<PropertyCell> cell = JSGlobalObject::EnsurePropertyCell(global, name);
DCHECK(cell->value()->IsTheHole()); DCHECK(cell->value()->IsTheHole());
Handle<Oddball> the_hole = masm->isolate()->factory()->the_hole_value(); Factory* factory = masm->isolate()->factory();
if (masm->serializer_enabled()) { Handle<WeakCell> weak_cell = factory->NewWeakCell(cell);
__ mov(scratch, Immediate(cell)); __ LoadWeakValue(scratch, weak_cell, miss);
__ cmp(FieldOperand(scratch, PropertyCell::kValueOffset), __ cmp(FieldOperand(scratch, PropertyCell::kValueOffset),
Immediate(the_hole)); Immediate(factory->the_hole_value()));
} else {
__ cmp(Operand::ForCell(cell), Immediate(the_hole));
}
__ j(not_equal, miss); __ j(not_equal, miss);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment