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

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

Issue 2463083002: Remove default monomorphic check code from functions and stubs that do not need it. (Closed)
Patch Set: address comment Created 4 years, 1 month 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
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" // NOLINT 5 #include "vm/globals.h" // NOLINT
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/longjump.h" 10 #include "vm/longjump.h"
11 #include "vm/runtime_entry.h" 11 #include "vm/runtime_entry.h"
12 #include "vm/simulator.h" 12 #include "vm/simulator.h"
13 #include "vm/stack_frame.h" 13 #include "vm/stack_frame.h"
14 #include "vm/stub_code.h" 14 #include "vm/stub_code.h"
15 15
16 namespace dart { 16 namespace dart {
17 17
18 DECLARE_FLAG(bool, check_code_pointer); 18 DECLARE_FLAG(bool, check_code_pointer);
19 DECLARE_FLAG(bool, inline_alloc); 19 DECLARE_FLAG(bool, inline_alloc);
20 20
21 DEFINE_FLAG(bool, use_far_branches, false, "Always use far branches"); 21 DEFINE_FLAG(bool, use_far_branches, false, "Always use far branches");
22 22
23 23
24 Assembler::Assembler(bool use_far_branches) 24 Assembler::Assembler(bool use_far_branches)
25 : buffer_(), 25 : buffer_(),
26 prologue_offset_(-1), 26 prologue_offset_(-1),
27 has_single_entry_point_(true),
27 use_far_branches_(use_far_branches), 28 use_far_branches_(use_far_branches),
28 comments_(), 29 comments_(),
29 constant_pool_allowed_(false) { 30 constant_pool_allowed_(false) {
30 MonomorphicCheckedEntry();
31 } 31 }
32 32
33 33
34 void Assembler::InitializeMemoryWithBreakpoints(uword data, intptr_t length) { 34 void Assembler::InitializeMemoryWithBreakpoints(uword data, intptr_t length) {
35 ASSERT(Utils::IsAligned(data, 4)); 35 ASSERT(Utils::IsAligned(data, 4));
36 ASSERT(Utils::IsAligned(length, 4)); 36 ASSERT(Utils::IsAligned(length, 4));
37 const uword end = data + length; 37 const uword end = data + length;
38 while (data < end) { 38 while (data < end) {
39 *reinterpret_cast<int32_t*>(data) = Instr::kBreakPointInstruction; 39 *reinterpret_cast<int32_t*>(data) = Instr::kBreakPointInstruction;
40 data += 4; 40 data += 4;
(...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 void Assembler::EnterStubFrame() { 1231 void Assembler::EnterStubFrame() {
1232 EnterDartFrame(0); 1232 EnterDartFrame(0);
1233 } 1233 }
1234 1234
1235 1235
1236 void Assembler::LeaveStubFrame() { 1236 void Assembler::LeaveStubFrame() {
1237 LeaveDartFrame(); 1237 LeaveDartFrame();
1238 } 1238 }
1239 1239
1240 1240
1241 void Assembler::NoMonomorphicCheckedEntry() {
1242 buffer_.Reset();
1243 brk(0);
1244 brk(0);
1245 brk(0);
1246 brk(0);
1247 ASSERT(CodeSize() == Instructions::kCheckedEntryOffset);
1248 }
1249
1250
1251 // R0 receiver, R5 guarded cid as Smi 1241 // R0 receiver, R5 guarded cid as Smi
1252 void Assembler::MonomorphicCheckedEntry() { 1242 void Assembler::MonomorphicCheckedEntry() {
1243 ASSERT(has_single_entry_point_);
1244 has_single_entry_point_ = false;
1253 bool saved_use_far_branches = use_far_branches(); 1245 bool saved_use_far_branches = use_far_branches();
1254 set_use_far_branches(false); 1246 set_use_far_branches(false);
1255 1247
1256 Label immediate, have_cid, miss; 1248 Label immediate, have_cid, miss;
1257 Bind(&miss); 1249 Bind(&miss);
1258 ldr(IP0, Address(THR, Thread::monomorphic_miss_entry_offset())); 1250 ldr(IP0, Address(THR, Thread::monomorphic_miss_entry_offset()));
1259 br(IP0); 1251 br(IP0);
1260 1252
1261 Bind(&immediate); 1253 Bind(&immediate);
1262 movz(R4, Immediate(kSmiCid), 0); 1254 movz(R4, Immediate(kSmiCid), 0);
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 str(tmp, Address(addr, 7), kUnsignedByte); 1566 str(tmp, Address(addr, 7), kUnsignedByte);
1575 if (sz == kDoubleWord) { 1567 if (sz == kDoubleWord) {
1576 return; 1568 return;
1577 } 1569 }
1578 UNIMPLEMENTED(); 1570 UNIMPLEMENTED();
1579 } 1571 }
1580 1572
1581 } // namespace dart 1573 } // namespace dart
1582 1574
1583 #endif // defined TARGET_ARCH_ARM64 1575 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/assembler_dbc.h » ('j') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698