OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
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" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 | 23 |
24 ASSEMBLER_TEST_RUN(Call, test) { | 24 ASSEMBLER_TEST_RUN(Call, test) { |
25 CallPattern call(test->entry() + test->code().Size(), test->code()); | 25 CallPattern call(test->entry() + test->code().Size(), test->code()); |
26 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(), | 26 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(), |
27 call.TargetAddress()); | 27 call.TargetAddress()); |
28 } | 28 } |
29 | 29 |
30 | 30 |
31 ASSEMBLER_TEST_GENERATE(Jump, assembler) { | 31 ASSEMBLER_TEST_GENERATE(Jump, assembler) { |
32 UNIMPLEMENTED(); | 32 __ BranchPatchable(&StubCode::InstanceFunctionLookupLabel()); |
| 33 __ BranchPatchable(&StubCode::AllocateArrayLabel()); |
33 } | 34 } |
34 | 35 |
35 | 36 |
36 ASSEMBLER_TEST_RUN(Jump, test) { | 37 ASSEMBLER_TEST_RUN(Jump, test) { |
37 JumpPattern jump1(test->entry()); | 38 JumpPattern jump1(test->entry()); |
38 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(), | 39 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(), |
39 jump1.TargetAddress()); | 40 jump1.TargetAddress()); |
40 JumpPattern jump2(test->entry() + jump1.pattern_length_in_bytes()); | 41 JumpPattern jump2(test->entry() + jump1.pattern_length_in_bytes()); |
41 EXPECT_EQ(StubCode::AllocateArrayLabel().address(), | 42 EXPECT_EQ(StubCode::AllocateArrayLabel().address(), |
42 jump2.TargetAddress()); | 43 jump2.TargetAddress()); |
43 uword target1 = jump1.TargetAddress(); | 44 uword target1 = jump1.TargetAddress(); |
44 uword target2 = jump2.TargetAddress(); | 45 uword target2 = jump2.TargetAddress(); |
45 jump1.SetTargetAddress(target2); | 46 jump1.SetTargetAddress(target2); |
46 jump2.SetTargetAddress(target1); | 47 jump2.SetTargetAddress(target1); |
47 EXPECT_EQ(StubCode::AllocateArrayLabel().address(), | 48 EXPECT_EQ(StubCode::AllocateArrayLabel().address(), |
48 jump1.TargetAddress()); | 49 jump1.TargetAddress()); |
49 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(), | 50 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(), |
50 jump2.TargetAddress()); | 51 jump2.TargetAddress()); |
51 } | 52 } |
52 | 53 |
53 } // namespace dart | 54 } // namespace dart |
54 | 55 |
55 #endif // defined TARGET_ARCH_ARM | 56 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |