OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 | 2 |
3 // Test constant pool array code. | 3 // Test constant pool array code. |
4 | 4 |
5 #include "v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "factory.h" | 7 #include "src/factory.h" |
8 #include "objects.h" | 8 #include "src/objects.h" |
9 #include "cctest.h" | 9 #include "test/cctest/cctest.h" |
10 | 10 |
11 using namespace v8::internal; | 11 using namespace v8::internal; |
12 | 12 |
13 | 13 |
14 Code* DummyCode(LocalContext* context) { | 14 Code* DummyCode(LocalContext* context) { |
15 CompileRun("function foo() {};"); | 15 CompileRun("function foo() {};"); |
16 i::Handle<i::JSFunction> fun = v8::Utils::OpenHandle( | 16 i::Handle<i::JSFunction> fun = v8::Utils::OpenHandle( |
17 *v8::Local<v8::Function>::Cast( | 17 *v8::Local<v8::Function>::Cast( |
18 (*context)->Global()->Get(v8_str("foo")))); | 18 (*context)->Global()->Get(v8_str("foo")))); |
19 return fun->code(); | 19 return fun->code(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 CHECK_EQ(array->get_int32_entry(6), 50); | 59 CHECK_EQ(array->get_int32_entry(6), 50); |
60 | 60 |
61 // Check pointers are updated on GC. | 61 // Check pointers are updated on GC. |
62 Object* old_ptr = array->get_heap_ptr_entry(5); | 62 Object* old_ptr = array->get_heap_ptr_entry(5); |
63 CHECK_EQ(*object, old_ptr); | 63 CHECK_EQ(*object, old_ptr); |
64 heap->CollectGarbage(NEW_SPACE); | 64 heap->CollectGarbage(NEW_SPACE); |
65 Object* new_ptr = array->get_heap_ptr_entry(5); | 65 Object* new_ptr = array->get_heap_ptr_entry(5); |
66 CHECK_NE(*object, old_ptr); | 66 CHECK_NE(*object, old_ptr); |
67 CHECK_EQ(*object, new_ptr); | 67 CHECK_EQ(*object, new_ptr); |
68 } | 68 } |
OLD | NEW |