| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/instructions.h" | 10 #include "vm/instructions.h" |
| 11 #include "vm/stub_code.h" | 11 #include "vm/stub_code.h" |
| 12 #include "vm/unit_test.h" | 12 #include "vm/unit_test.h" |
| 13 | 13 |
| 14 namespace dart { | 14 namespace dart { |
| 15 | 15 |
| 16 #define __ assembler-> | 16 #define __ assembler-> |
| 17 | 17 |
| 18 ASSEMBLER_TEST_GENERATE(Call, assembler) { | 18 ASSEMBLER_TEST_GENERATE(Call, assembler) { |
| 19 // Code accessing pp is generated, but not executed. Uninitialized pp is OK. |
| 20 __ set_constant_pool_allowed(true); |
| 19 __ BranchLinkPatchable(&StubCode::InvokeDartCodeLabel()); | 21 __ BranchLinkPatchable(&StubCode::InvokeDartCodeLabel()); |
| 20 __ ret(); | 22 __ ret(); |
| 21 } | 23 } |
| 22 | 24 |
| 23 | 25 |
| 24 ASSEMBLER_TEST_RUN(Call, test) { | 26 ASSEMBLER_TEST_RUN(Call, test) { |
| 25 // The return address, which must be the address of an instruction contained | 27 // The return address, which must be the address of an instruction contained |
| 26 // in the code, points to the Ret instruction above, i.e. one instruction | 28 // in the code, points to the Ret instruction above, i.e. one instruction |
| 27 // before the end of the code buffer. | 29 // before the end of the code buffer. |
| 28 CallPattern call(test->entry() + test->code().Size() - Instr::kInstrSize, | 30 CallPattern call(test->entry() + test->code().Size() - Instr::kInstrSize, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 jump1.SetTargetAddress(target2); | 62 jump1.SetTargetAddress(target2); |
| 61 jump2.SetTargetAddress(target1); | 63 jump2.SetTargetAddress(target1); |
| 62 EXPECT_EQ(array_stub.EntryPoint(), jump1.TargetAddress()); | 64 EXPECT_EQ(array_stub.EntryPoint(), jump1.TargetAddress()); |
| 63 EXPECT_EQ(StubCode::InvokeDartCodeLabel().address(), | 65 EXPECT_EQ(StubCode::InvokeDartCodeLabel().address(), |
| 64 jump2.TargetAddress()); | 66 jump2.TargetAddress()); |
| 65 } | 67 } |
| 66 | 68 |
| 67 } // namespace dart | 69 } // namespace dart |
| 68 | 70 |
| 69 #endif // defined TARGET_ARCH_ARM64 | 71 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |