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_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
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 15 matching lines...) Expand all Loading... |
26 // before the end of the code buffer, including the delay slot for the | 26 // before the end of the code buffer, including the delay slot for the |
27 // return jump. | 27 // return jump. |
28 CallPattern call(test->entry() + test->code().Size() - (2*Instr::kInstrSize), | 28 CallPattern call(test->entry() + test->code().Size() - (2*Instr::kInstrSize), |
29 test->code()); | 29 test->code()); |
30 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(), | 30 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(), |
31 call.TargetAddress()); | 31 call.TargetAddress()); |
32 } | 32 } |
33 | 33 |
34 | 34 |
35 ASSEMBLER_TEST_GENERATE(Jump, assembler) { | 35 ASSEMBLER_TEST_GENERATE(Jump, assembler) { |
36 UNIMPLEMENTED(); | 36 __ BranchPatchable(&StubCode::InstanceFunctionLookupLabel()); |
| 37 __ BranchPatchable(&StubCode::AllocateArrayLabel()); |
37 } | 38 } |
38 | 39 |
39 | 40 |
40 ASSEMBLER_TEST_RUN(Jump, test) { | 41 ASSEMBLER_TEST_RUN(Jump, test) { |
41 JumpPattern jump1(test->entry()); | 42 JumpPattern jump1(test->entry()); |
42 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(), | 43 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(), |
43 jump1.TargetAddress()); | 44 jump1.TargetAddress()); |
44 JumpPattern jump2(test->entry() + jump1.pattern_length_in_bytes()); | 45 JumpPattern jump2(test->entry() + jump1.pattern_length_in_bytes()); |
45 EXPECT_EQ(StubCode::AllocateArrayLabel().address(), | 46 EXPECT_EQ(StubCode::AllocateArrayLabel().address(), |
46 jump2.TargetAddress()); | 47 jump2.TargetAddress()); |
47 uword target1 = jump1.TargetAddress(); | 48 uword target1 = jump1.TargetAddress(); |
48 uword target2 = jump2.TargetAddress(); | 49 uword target2 = jump2.TargetAddress(); |
49 jump1.SetTargetAddress(target2); | 50 jump1.SetTargetAddress(target2); |
50 jump2.SetTargetAddress(target1); | 51 jump2.SetTargetAddress(target1); |
51 EXPECT_EQ(StubCode::AllocateArrayLabel().address(), | 52 EXPECT_EQ(StubCode::AllocateArrayLabel().address(), |
52 jump1.TargetAddress()); | 53 jump1.TargetAddress()); |
53 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(), | 54 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(), |
54 jump2.TargetAddress()); | 55 jump2.TargetAddress()); |
55 } | 56 } |
56 | 57 |
57 } // namespace dart | 58 } // namespace dart |
58 | 59 |
59 #endif // defined TARGET_ARCH_MIPS | 60 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |