OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 #include "src/factory.h" |
| 6 #include "src/isolate.h" |
5 #include "src/objects.h" | 7 #include "src/objects.h" |
| 8 // FIXME(mstarzinger, marja): This is weird, but required because of the missing |
| 9 // (disallowed) include: src/factory.h -> src/objects-inl.h |
| 10 #include "src/objects-inl.h" |
| 11 // FIXME(mstarzinger, marja): This is weird, but required because of the missing |
| 12 // (disallowed) include: src/type-feedback-vector.h -> |
| 13 // src/type-feedback-vector-inl.h |
| 14 #include "src/type-feedback-vector-inl.h" |
6 #include "test/cctest/cctest.h" | 15 #include "test/cctest/cctest.h" |
7 | 16 |
8 using namespace v8::internal; | 17 using namespace v8::internal; |
9 | 18 |
10 TEST(CodeLayoutWithoutUnwindingInfo) { | 19 TEST(CodeLayoutWithoutUnwindingInfo) { |
11 CcTest::InitializeVM(); | 20 CcTest::InitializeVM(); |
12 HandleScope handle_scope(CcTest::i_isolate()); | 21 HandleScope handle_scope(CcTest::i_isolate()); |
13 | 22 |
14 // "Hello, World!" in ASCII. | 23 // "Hello, World!" in ASCII. |
15 byte buffer_array[13] = {0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, | 24 byte buffer_array[13] = {0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 CHECK_EQ(code->unwinding_info_size(), unwinding_info_size); | 84 CHECK_EQ(code->unwinding_info_size(), unwinding_info_size); |
76 CHECK( | 85 CHECK( |
77 IsAligned(reinterpret_cast<uintptr_t>(code->unwinding_info_start()), 8)); | 86 IsAligned(reinterpret_cast<uintptr_t>(code->unwinding_info_start()), 8)); |
78 CHECK_EQ( | 87 CHECK_EQ( |
79 memcmp(code->unwinding_info_start(), unwinding_info, unwinding_info_size), | 88 memcmp(code->unwinding_info_start(), unwinding_info, unwinding_info_size), |
80 0); | 89 0); |
81 CHECK_EQ(code->unwinding_info_end() - reinterpret_cast<byte*>(*code), | 90 CHECK_EQ(code->unwinding_info_end() - reinterpret_cast<byte*>(*code), |
82 Code::kHeaderSize + RoundUp(buffer_size, kInt64Size) + kInt64Size + | 91 Code::kHeaderSize + RoundUp(buffer_size, kInt64Size) + kInt64Size + |
83 unwinding_info_size - kHeapObjectTag); | 92 unwinding_info_size - kHeapObjectTag); |
84 } | 93 } |
OLD | NEW |