Index: test/cctest/test-heap.cc |
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc |
index 28ffa05e56a66d4075e648cede0dc4a4c844c942..318166536e7087c75af15b871fb3c09ab002c2de 100644 |
--- a/test/cctest/test-heap.cc |
+++ b/test/cctest/test-heap.cc |
@@ -117,30 +117,24 @@ static void CheckFindCodeObject(Isolate* isolate) { |
CodeDesc desc; |
assm.GetCode(&desc); |
- Heap* heap = isolate->heap(); |
- Object* code = heap->CreateCode( |
- desc, |
- Code::ComputeFlags(Code::STUB), |
- Handle<Code>())->ToObjectChecked(); |
+ Handle<Code> code = isolate->factory()->NewCode( |
+ desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
CHECK(code->IsCode()); |
- HeapObject* obj = HeapObject::cast(code); |
+ HeapObject* obj = HeapObject::cast(*code); |
Address obj_addr = obj->address(); |
for (int i = 0; i < obj->Size(); i += kPointerSize) { |
Object* found = isolate->FindCodeObject(obj_addr + i); |
- CHECK_EQ(code, found); |
+ CHECK_EQ(*code, found); |
} |
- Object* copy = heap->CreateCode( |
- desc, |
- Code::ComputeFlags(Code::STUB), |
- Handle<Code>())->ToObjectChecked(); |
- CHECK(copy->IsCode()); |
- HeapObject* obj_copy = HeapObject::cast(copy); |
+ Handle<Code> copy = isolate->factory()->NewCode( |
+ desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
+ HeapObject* obj_copy = HeapObject::cast(*copy); |
Object* not_right = isolate->FindCodeObject(obj_copy->address() + |
obj_copy->Size() / 2); |
- CHECK(not_right != code); |
+ CHECK(not_right != *code); |
} |