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

Unified Diff: runtime/vm/assembler_arm64.cc

Issue 513213002: Generate some intrinsics using our IR. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed Slava's feedback Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/assembler_mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_arm64.cc
===================================================================
--- runtime/vm/assembler_arm64.cc (revision 39909)
+++ runtime/vm/assembler_arm64.cc (working copy)
@@ -31,7 +31,8 @@
patchable_pool_entries_(),
prologue_offset_(-1),
use_far_branches_(use_far_branches),
- comments_() {
+ comments_(),
+ allow_constant_pool_(true) {
if (Isolate::Current() != Dart::vm_isolate()) {
object_pool_ = GrowableObjectArray::New(Heap::kOld);
@@ -487,7 +488,20 @@
}
+// A set of VM objects that are present in every constant pool.
+static bool IsAlwaysInConstantPool(const Object& object) {
+ // TODO(zra): Evaluate putting all VM heap objects into the pool.
+ return (object.raw() == Object::null())
+ || (object.raw() == Bool::True().raw())
+ || (object.raw() == Bool::False().raw());
+}
+
+
bool Assembler::CanLoadObjectFromPool(const Object& object) {
+ if (!allow_constant_pool()) {
+ return IsAlwaysInConstantPool(object);
+ }
+
// TODO(zra, kmillikin): Also load other large immediates from the object
// pool
if (object.IsSmi()) {
@@ -500,14 +514,14 @@
return (Isolate::Current() != Dart::vm_isolate()) &&
// Not in the VMHeap, OR is one of the VMHeap objects we put in every
// object pool.
- // TODO(zra): Evaluate putting all VM heap objects into the pool.
- (!object.InVMHeap() || (object.raw() == Object::null()) ||
- (object.raw() == Bool::True().raw()) ||
- (object.raw() == Bool::False().raw()));
+ (!object.InVMHeap() || IsAlwaysInConstantPool(object));
}
bool Assembler::CanLoadImmediateFromPool(int64_t imm, Register pp) {
+ if (!allow_constant_pool()) {
+ return false;
+ }
return !Utils::IsInt(32, imm) &&
(pp != kNoPP) &&
// We *could* put constants in the pool in a VM isolate, but it is
@@ -567,7 +581,9 @@
void Assembler::LoadDecodableImmediate(Register reg, int64_t imm, Register pp) {
- if ((pp != kNoPP) && (Isolate::Current() != Dart::vm_isolate())) {
+ if ((pp != kNoPP) &&
+ (Isolate::Current() != Dart::vm_isolate()) &&
+ allow_constant_pool()) {
int64_t val_smi_tag = imm & kSmiTagMask;
imm &= ~kSmiTagMask; // Mask off the tag bits.
const int32_t offset = Array::element_offset(FindImmediate(imm));
« 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