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

Unified Diff: runtime/vm/assembler_x64.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_x64.h ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_x64.cc
===================================================================
--- runtime/vm/assembler_x64.cc (revision 39909)
+++ runtime/vm/assembler_x64.cc (working copy)
@@ -25,7 +25,8 @@
object_pool_(GrowableObjectArray::Handle()),
patchable_pool_entries_(),
prologue_offset_(-1),
- comments_() {
+ comments_(),
+ allow_constant_pool_(true) {
// Far branching mode is only needed and implemented for MIPS and ARM.
ASSERT(!use_far_branches);
Isolate* isolate = Isolate::Current();
@@ -148,6 +149,7 @@
void Assembler::CallPatchable(const ExternalLabel* label) {
+ ASSERT(allow_constant_pool());
intptr_t call_start = buffer_.GetPosition();
LoadExternalLabel(TMP, label, kPatchable, PP);
call(TMP);
@@ -2368,6 +2370,7 @@
void Assembler::JmpPatchable(const ExternalLabel* label, Register pp) {
+ ASSERT(allow_constant_pool());
intptr_t call_start = buffer_.GetPosition();
LoadExternalLabel(TMP, label, kPatchable, pp);
jmp(TMP);
@@ -2588,7 +2591,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::CanLoadFromObjectPool(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()) {
@@ -2601,10 +2617,7 @@
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));
}
@@ -2672,6 +2685,9 @@
bool Assembler::CanLoadImmediateFromPool(const Immediate& imm, Register pp) {
+ if (!allow_constant_pool()) {
+ return false;
+ }
return !imm.is_int32() &&
(pp != kNoRegister) &&
(Isolate::Current() != Dart::vm_isolate());
« no previous file with comments | « runtime/vm/assembler_x64.h ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698