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

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

Issue 1249933003: Rename assembler field/getter/setter allow_constant_pool to constant_pool_allowed (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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/assembler_arm64.h ('k') | runtime/vm/assembler_mips.h » ('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" // 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"
(...skipping 12 matching lines...) Expand all
23 DEFINE_FLAG(bool, use_far_branches, false, "Always use far branches"); 23 DEFINE_FLAG(bool, use_far_branches, false, "Always use far branches");
24 DEFINE_FLAG(bool, print_stop_message, false, "Print stop message."); 24 DEFINE_FLAG(bool, print_stop_message, false, "Print stop message.");
25 DECLARE_FLAG(bool, inline_alloc); 25 DECLARE_FLAG(bool, inline_alloc);
26 26
27 27
28 Assembler::Assembler(bool use_far_branches) 28 Assembler::Assembler(bool use_far_branches)
29 : buffer_(), 29 : buffer_(),
30 prologue_offset_(-1), 30 prologue_offset_(-1),
31 use_far_branches_(use_far_branches), 31 use_far_branches_(use_far_branches),
32 comments_(), 32 comments_(),
33 allow_constant_pool_(true) { 33 constant_pool_allowed_(true) {
34 } 34 }
35 35
36 36
37 void Assembler::InitializeMemoryWithBreakpoints(uword data, intptr_t length) { 37 void Assembler::InitializeMemoryWithBreakpoints(uword data, intptr_t length) {
38 ASSERT(Utils::IsAligned(data, 4)); 38 ASSERT(Utils::IsAligned(data, 4));
39 ASSERT(Utils::IsAligned(length, 4)); 39 ASSERT(Utils::IsAligned(length, 4));
40 const uword end = data + length; 40 const uword end = data + length;
41 while (data < end) { 41 while (data < end) {
42 *reinterpret_cast<int32_t*>(data) = Instr::kBreakPointInstruction; 42 *reinterpret_cast<int32_t*>(data) = Instr::kBreakPointInstruction;
43 data += 4; 43 data += 4;
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 } 359 }
360 360
361 361
362 intptr_t Assembler::FindImmediate(int64_t imm) { 362 intptr_t Assembler::FindImmediate(int64_t imm) {
363 return object_pool_wrapper_.FindImmediate(imm); 363 return object_pool_wrapper_.FindImmediate(imm);
364 } 364 }
365 365
366 366
367 bool Assembler::CanLoadFromObjectPool(const Object& object) const { 367 bool Assembler::CanLoadFromObjectPool(const Object& object) const {
368 ASSERT(!Thread::CanLoadFromThread(object)); 368 ASSERT(!Thread::CanLoadFromThread(object));
369 if (!allow_constant_pool()) { 369 if (!constant_pool_allowed()) {
370 return false; 370 return false;
371 } 371 }
372 372
373 // TODO(zra, kmillikin): Also load other large immediates from the object 373 // TODO(zra, kmillikin): Also load other large immediates from the object
374 // pool 374 // pool
375 if (object.IsSmi()) { 375 if (object.IsSmi()) {
376 // If the raw smi does not fit into a 32-bit signed int, then we'll keep 376 // If the raw smi does not fit into a 32-bit signed int, then we'll keep
377 // the raw value in the object pool. 377 // the raw value in the object pool.
378 return !Utils::IsInt(32, reinterpret_cast<int64_t>(object.raw())); 378 return !Utils::IsInt(32, reinterpret_cast<int64_t>(object.raw()));
379 } 379 }
380 ASSERT(object.IsNotTemporaryScopedHandle()); 380 ASSERT(object.IsNotTemporaryScopedHandle());
381 ASSERT(object.IsOld()); 381 ASSERT(object.IsOld());
382 return true; 382 return true;
383 } 383 }
384 384
385 385
386 bool Assembler::CanLoadImmediateFromPool(int64_t imm, Register pp) { 386 bool Assembler::CanLoadImmediateFromPool(int64_t imm, Register pp) {
387 if (!allow_constant_pool()) { 387 if (!constant_pool_allowed()) {
388 return false; 388 return false;
389 } 389 }
390 return !Utils::IsInt(32, imm) && (pp != kNoPP); 390 return !Utils::IsInt(32, imm) && (pp != kNoPP);
391 } 391 }
392 392
393 393
394 void Assembler::LoadExternalLabel(Register dst, 394 void Assembler::LoadExternalLabel(Register dst,
395 const ExternalLabel* label, 395 const ExternalLabel* label,
396 Patchability patchable, 396 Patchability patchable,
397 Register pp) { 397 Register pp) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 } else if (CanLoadFromObjectPool(object)) { 458 } else if (CanLoadFromObjectPool(object)) {
459 LoadObject(TMP, object, pp); 459 LoadObject(TMP, object, pp);
460 CompareRegisters(reg, TMP); 460 CompareRegisters(reg, TMP);
461 } else { 461 } else {
462 CompareImmediate(reg, reinterpret_cast<int64_t>(object.raw()), pp); 462 CompareImmediate(reg, reinterpret_cast<int64_t>(object.raw()), pp);
463 } 463 }
464 } 464 }
465 465
466 466
467 void Assembler::LoadDecodableImmediate(Register reg, int64_t imm, Register pp) { 467 void Assembler::LoadDecodableImmediate(Register reg, int64_t imm, Register pp) {
468 if ((pp != kNoPP) && allow_constant_pool()) { 468 if ((pp != kNoPP) && constant_pool_allowed()) {
469 const int32_t offset = ObjectPool::element_offset(FindImmediate(imm)); 469 const int32_t offset = ObjectPool::element_offset(FindImmediate(imm));
470 LoadWordFromPoolOffset(reg, pp, offset); 470 LoadWordFromPoolOffset(reg, pp, offset);
471 } else { 471 } else {
472 // TODO(zra): Since this sequence only needs to be decodable, it can be 472 // TODO(zra): Since this sequence only needs to be decodable, it can be
473 // of variable length. 473 // of variable length.
474 LoadImmediateFixed(reg, imm); 474 LoadImmediateFixed(reg, imm);
475 } 475 }
476 } 476 }
477 477
478 478
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 add(base, array, Operand(index, LSL, shift)); 1457 add(base, array, Operand(index, LSL, shift));
1458 } 1458 }
1459 const OperandSize size = Address::OperandSizeFor(cid); 1459 const OperandSize size = Address::OperandSizeFor(cid);
1460 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); 1460 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size));
1461 return Address(base, offset, Address::Offset, size); 1461 return Address(base, offset, Address::Offset, size);
1462 } 1462 }
1463 1463
1464 } // namespace dart 1464 } // namespace dart
1465 1465
1466 #endif // defined TARGET_ARCH_ARM64 1466 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/assembler_mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698