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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 10540040: Inline setters, getters, various cleanups & restructuring. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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
Index: runtime/vm/intermediate_language_x64.cc
===================================================================
--- runtime/vm/intermediate_language_x64.cc (revision 8372)
+++ runtime/vm/intermediate_language_x64.cc (working copy)
@@ -21,7 +21,6 @@
DECLARE_FLAG(int, optimization_counter_threshold);
DECLARE_FLAG(bool, trace_functions);
-
void BindInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
computation()->EmitNativeCode(compiler);
__ pushq(locs()->out().reg());
@@ -309,7 +308,7 @@
LocationSummary* InstanceSetterComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 2;
- return LocationSummary::Make(kNumInputs, Location::RequiresRegister());
+ return LocationSummary::Make(kNumInputs, Location::NoLocation());
return NULL;
}
@@ -317,16 +316,12 @@
void InstanceSetterComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register receiver = locs()->in(0).reg();
Register value = locs()->in(1).reg();
- Register result = locs()->out().reg();
// Preserve the value (second argument) under the arguments as the result
// of the computation, then call the setter.
const String& function_name =
String::ZoneHandle(Field::SetterSymbol(field_name()));
- // Insert a copy of the second (last) argument under the arguments.
- // TODO(fschneider): Avoid preserving the value if the result is not used.
- __ pushq(value);
__ pushq(receiver);
__ pushq(value);
const intptr_t kArgumentCount = 2;
@@ -338,7 +333,6 @@
kArgumentCount,
Array::ZoneHandle(),
kCheckedArgumentCount);
- __ popq(result);
}
@@ -382,6 +376,19 @@
Register instance = locs()->in(0).reg();
Register result = locs()->out().reg();
+ if (class_ids() != NULL) {
+ ASSERT(original() != NULL);
+ Label* deopt = compiler->AddDeoptStub(original()->cid(),
+ original()->token_index(),
+ original()->try_index(),
+ kDeoptInstanceGetterSameTarget,
+ instance,
+ kNoRegister);
+ // Smis do not have instance fields (Smi class is always first).
+ // Use 'result' as temporary register.
+ ASSERT(result != instance);
+ compiler->EmitClassChecksNoSmi(*class_ids(), instance, result, deopt);
+ }
__ movq(result, FieldAddress(instance, field().Offset()));
}

Powered by Google App Engine
This is Rietveld 408576698