Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: runtime/vm/instructions_arm_test.cc

Issue 12518016: Decode ic data and arguments descriptor passed in calls on ARM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
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 __ BranchLinkPatchable(&StubCode::InstanceFunctionLookupLabel()); 18 __ BranchLinkPatchable(&StubCode::InstanceFunctionLookupLabel());
19 // Do not emit any code after the call above, since we decode backwards 19 __ Ret();
20 // starting from the return address, i.e. from the end of this code buffer.
21 } 20 }
22 21
23 22
24 ASSEMBLER_TEST_RUN(Call, test) { 23 ASSEMBLER_TEST_RUN(Call, test) {
25 CallPattern call(test->entry() + test->code().Size(), test->code()); 24 // The return address, which must be the address of an instruction contained
25 // in the code, points to the Ret instruction above, i.e. one instruction
26 // before the end of the code buffer.
zra 2013/03/11 22:36:08 Check why this did not fail before.
regis 2013/03/11 23:16:30 code_patcher_arm verifies the above statement with
27 CallPattern call(test->entry() + test->code().Size() - Instr::kInstrSize,
28 test->code());
26 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(), 29 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(),
27 call.TargetAddress()); 30 call.TargetAddress());
28 } 31 }
29 32
30 33
31 ASSEMBLER_TEST_GENERATE(Jump, assembler) { 34 ASSEMBLER_TEST_GENERATE(Jump, assembler) {
32 __ BranchPatchable(&StubCode::InstanceFunctionLookupLabel()); 35 __ BranchPatchable(&StubCode::InstanceFunctionLookupLabel());
33 __ BranchPatchable(&StubCode::AllocateArrayLabel()); 36 __ BranchPatchable(&StubCode::AllocateArrayLabel());
34 } 37 }
35 38
(...skipping 11 matching lines...) Expand all
47 jump2.SetTargetAddress(target1); 50 jump2.SetTargetAddress(target1);
48 EXPECT_EQ(StubCode::AllocateArrayLabel().address(), 51 EXPECT_EQ(StubCode::AllocateArrayLabel().address(),
49 jump1.TargetAddress()); 52 jump1.TargetAddress());
50 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(), 53 EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(),
51 jump2.TargetAddress()); 54 jump2.TargetAddress());
52 } 55 }
53 56
54 } // namespace dart 57 } // namespace dart
55 58
56 #endif // defined TARGET_ARCH_ARM 59 #endif // defined TARGET_ARCH_ARM
OLDNEW
« runtime/vm/instructions_arm.cc ('K') | « runtime/vm/instructions_arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698