OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/instructions.h" | 9 #include "vm/instructions.h" |
10 #include "vm/stub_code.h" | 10 #include "vm/stub_code.h" |
11 #include "vm/unit_test.h" | 11 #include "vm/unit_test.h" |
12 | 12 |
13 namespace dart { | 13 namespace dart { |
14 | 14 |
15 #define __ assembler-> | 15 #define __ assembler-> |
16 | 16 |
17 ASSEMBLER_TEST_GENERATE(Call, assembler) { | 17 ASSEMBLER_TEST_GENERATE(Call, assembler) { |
18 __ Call(*StubCode::InvokeDartCode_entry()); | 18 __ Call(*StubCode::InvokeDartCode_entry()); |
19 __ ret(); | 19 __ ret(); |
20 } | 20 } |
21 | 21 |
22 | |
23 static intptr_t prologue_code_size = -1; | 22 static intptr_t prologue_code_size = -1; |
24 | 23 |
25 | |
26 ASSEMBLER_TEST_GENERATE(Jump, assembler) { | 24 ASSEMBLER_TEST_GENERATE(Jump, assembler) { |
27 ASSERT(assembler->CodeSize() == 0); | 25 ASSERT(assembler->CodeSize() == 0); |
28 __ pushq(PP); | 26 __ pushq(PP); |
29 __ LoadPoolPointer(); | 27 __ LoadPoolPointer(); |
30 prologue_code_size = assembler->CodeSize(); | 28 prologue_code_size = assembler->CodeSize(); |
31 __ JmpPatchable(*StubCode::InvokeDartCode_entry(), PP); | 29 __ JmpPatchable(*StubCode::InvokeDartCode_entry(), PP); |
32 __ JmpPatchable(*StubCode::AllocateArray_entry(), PP); | 30 __ JmpPatchable(*StubCode::AllocateArray_entry(), PP); |
33 __ popq(PP); | 31 __ popq(PP); |
34 __ ret(); | 32 __ ret(); |
35 } | 33 } |
36 | 34 |
37 | |
38 } // namespace dart | 35 } // namespace dart |
39 | 36 |
40 #endif // defined TARGET_ARCH_X64 | 37 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |