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

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

Issue 2226893002: Optimize AOT's switchable calls for the monomorphic case. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 years, 4 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
« no previous file with comments | « runtime/vm/instructions_arm64.cc ('k') | runtime/vm/instructions_arm_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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. 19 // Code accessing pp is generated, but not executed. Uninitialized pp is OK.
20 __ set_constant_pool_allowed(true); 20 __ set_constant_pool_allowed(true);
21 __ BranchLinkPatchable(*StubCode::InvokeDartCode_entry()); 21 __ BranchLinkPatchable(*StubCode::InvokeDartCode_entry());
22 __ ret(); 22 __ ret();
23 } 23 }
24 24
25 25
26 ASSEMBLER_TEST_RUN(Call, test) { 26 ASSEMBLER_TEST_RUN(Call, test) {
27 // 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
28 // 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
29 // before the end of the code buffer. 29 // before the end of the code buffer.
30 CallPattern call(test->entry() + test->code().Size() - Instr::kInstrSize, 30 uword end = test->payload_start() + test->code().Size();
31 CallPattern call(end - Instr::kInstrSize,
31 test->code()); 32 test->code());
32 EXPECT_EQ(StubCode::InvokeDartCode_entry()->code(), 33 EXPECT_EQ(StubCode::InvokeDartCode_entry()->code(),
33 call.TargetCode()); 34 call.TargetCode());
34 } 35 }
35 36
36 37
37 } // namespace dart 38 } // namespace dart
38 39
39 #endif // defined TARGET_ARCH_ARM64 40 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/instructions_arm64.cc ('k') | runtime/vm/instructions_arm_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698