Commit d31ed984 authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

Fix GC bug with missing handle. Bug=133618

Review URL: https://chromiumcodereview.appspot.com/10559083

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11886 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent dce8dccd
...@@ -2597,15 +2597,15 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, ...@@ -2597,15 +2597,15 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result,
} else { } else {
// Negative lookup. // Negative lookup.
// Check prototypes. // Check prototypes.
HeapObject* current = HeapObject::cast((*type)->prototype()); Handle<HeapObject> current(HeapObject::cast((*type)->prototype()));
Heap* heap = type->GetHeap(); Heap* heap = type->GetHeap();
while (current != heap->null_value()) { while (*current != heap->null_value()) {
Handle<HeapObject> link(current); __ LoadHeapObject(result, current);
__ LoadHeapObject(result, link);
__ ldr(result, FieldMemOperand(result, HeapObject::kMapOffset)); __ ldr(result, FieldMemOperand(result, HeapObject::kMapOffset));
__ cmp(result, Operand(Handle<Map>(JSObject::cast(current)->map()))); __ cmp(result, Operand(Handle<Map>(current->map())));
DeoptimizeIf(ne, env); DeoptimizeIf(ne, env);
current = HeapObject::cast(current->map()->prototype()); current =
Handle<HeapObject>(HeapObject::cast(current->map()->prototype()));
} }
__ LoadRoot(result, Heap::kUndefinedValueRootIndex); __ LoadRoot(result, Heap::kUndefinedValueRootIndex);
} }
......
...@@ -2327,15 +2327,15 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, ...@@ -2327,15 +2327,15 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result,
} else { } else {
// Negative lookup. // Negative lookup.
// Check prototypes. // Check prototypes.
HeapObject* current = HeapObject::cast((*type)->prototype()); Handle<HeapObject> current(HeapObject::cast((*type)->prototype()));
Heap* heap = type->GetHeap(); Heap* heap = type->GetHeap();
while (current != heap->null_value()) { while (*current != heap->null_value()) {
Handle<HeapObject> link(current); __ LoadHeapObject(result, current);
__ LoadHeapObject(result, link);
__ cmp(FieldOperand(result, HeapObject::kMapOffset), __ cmp(FieldOperand(result, HeapObject::kMapOffset),
Handle<Map>(JSObject::cast(current)->map())); Handle<Map>(current->map()));
DeoptimizeIf(not_equal, env); DeoptimizeIf(not_equal, env);
current = HeapObject::cast(current->map()->prototype()); current =
Handle<HeapObject>(HeapObject::cast(current->map()->prototype()));
} }
__ mov(result, factory()->undefined_value()); __ mov(result, factory()->undefined_value());
} }
......
...@@ -2341,15 +2341,14 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, ...@@ -2341,15 +2341,14 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result,
} else { } else {
// Negative lookup. // Negative lookup.
// Check prototypes. // Check prototypes.
HeapObject* current = HeapObject::cast((*type)->prototype()); Handle<HeapObject> current(HeapObject::cast((*type)->prototype()));
Heap* heap = type->GetHeap(); Heap* heap = type->GetHeap();
while (current != heap->null_value()) { while (*current != heap->null_value()) {
Handle<HeapObject> link(current); __ LoadHeapObject(result, current);
__ LoadHeapObject(result, link);
__ lw(result, FieldMemOperand(result, HeapObject::kMapOffset)); __ lw(result, FieldMemOperand(result, HeapObject::kMapOffset));
DeoptimizeIf(ne, env, DeoptimizeIf(ne, env, result, Operand(Handle<Map>(current->map())));
result, Operand(Handle<Map>(JSObject::cast(current)->map()))); current =
current = HeapObject::cast(current->map()->prototype()); Handle<HeapObject>(HeapObject::cast(current->map()->prototype()));
} }
__ LoadRoot(result, Heap::kUndefinedValueRootIndex); __ LoadRoot(result, Heap::kUndefinedValueRootIndex);
} }
......
...@@ -2221,15 +2221,15 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, ...@@ -2221,15 +2221,15 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result,
} else { } else {
// Negative lookup. // Negative lookup.
// Check prototypes. // Check prototypes.
HeapObject* current = HeapObject::cast((*type)->prototype()); Handle<HeapObject> current(HeapObject::cast((*type)->prototype()));
Heap* heap = type->GetHeap(); Heap* heap = type->GetHeap();
while (current != heap->null_value()) { while (*current != heap->null_value()) {
Handle<HeapObject> link(current); __ LoadHeapObject(result, current);
__ LoadHeapObject(result, link);
__ Cmp(FieldOperand(result, HeapObject::kMapOffset), __ Cmp(FieldOperand(result, HeapObject::kMapOffset),
Handle<Map>(JSObject::cast(current)->map())); Handle<Map>(current->map()));
DeoptimizeIf(not_equal, env); DeoptimizeIf(not_equal, env);
current = HeapObject::cast(current->map()->prototype()); current =
Handle<HeapObject>(HeapObject::cast(current->map()->prototype()));
} }
__ LoadRoot(result, Heap::kUndefinedValueRootIndex); __ LoadRoot(result, Heap::kUndefinedValueRootIndex);
} }
......
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