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

Unified Diff: runtime/vm/locations.cc

Issue 11791051: Support immediate and memory operands for PushArgumentInstr in optimized code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: really handle constant operands Created 7 years, 11 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/locations.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/locations.cc
===================================================================
--- runtime/vm/locations.cc (revision 16802)
+++ runtime/vm/locations.cc (working copy)
@@ -4,6 +4,7 @@
#include "vm/locations.h"
+#include "vm/assembler.h"
#include "vm/il_printer.h"
#include "vm/intermediate_language.h"
#include "vm/flow_graph_compiler.h"
@@ -77,6 +78,27 @@
}
+Location Location::AnyOrConstant(Value* value) {
+ ConstantInstr* constant = value->definition()->AsConstant();
+ return (constant != NULL)
+ ? Location::Constant(constant->value())
+ : Location::Any();
+}
+
+
+Address Location::ToStackSlotAddress() const {
+ const intptr_t index = stack_index();
+ if (index < 0) {
+ const intptr_t offset = (1 - index) * kWordSize;
+ return Address(FPREG, offset);
+ } else {
+ const intptr_t offset =
+ (ParsedFunction::kFirstLocalSlotIndex - index) * kWordSize;
+ return Address(FPREG, offset);
+ }
+}
+
+
const char* Location::Name() const {
switch (kind()) {
case kInvalid: return "?";
« no previous file with comments | « runtime/vm/locations.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698