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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 10538024: Implemented missing instructions in ia32, more sharing, removed bailouts, enable optimiziations on … (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
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 8400)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -299,7 +299,6 @@
LocationSummary* InstanceSetterComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 2;
return LocationSummary::Make(kNumInputs, Location::RequiresRegister());
- return NULL;
}
@@ -332,22 +331,46 @@
LocationSummary* StaticSetterComp::MakeLocationSummary() const {
- return NULL;
+ const intptr_t kNumInputs = 1;
+ return LocationSummary::Make(kNumInputs, Location::RequiresRegister());
}
void StaticSetterComp::EmitNativeCode(FlowGraphCompiler* compiler) {
- UNIMPLEMENTED();
+ Register value = locs()->in(0).reg();
+ Register result = locs()->out().reg();
+
+ // Preserve the argument as the result of the computation,
+ // then call the setter.
+
+ // Duplicate the argument.
+ // TODO(fschneider): Avoid preserving the value if the result is not used.
+ __ pushl(value);
+ __ pushl(value);
+ compiler->GenerateStaticCall(cid(),
+ token_index(),
+ try_index(),
+ setter_function(),
+ 1,
+ Array::ZoneHandle());
+ __ popl(result);
}
LocationSummary* LoadInstanceFieldComp::MakeLocationSummary() const {
- return NULL;
+ // TODO(fschneider): For this instruction the input register may be
+ // reused for the result (but is not required to) because the input
+ // is not used after the result is defined. We should consider adding
+ // this information to the input policy.
+ return LocationSummary::Make(1, Location::RequiresRegister());
}
void LoadInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
- UNIMPLEMENTED();
+ Register instance = locs()->in(0).reg();
+ Register result = locs()->out().reg();
+
+ __ movl(result, FieldAddress(instance, field().Offset()));
}
@@ -693,12 +716,27 @@
LocationSummary* CatchEntryComp::MakeLocationSummary() const {
- return NULL;
+ return LocationSummary::Make(0, Location::NoLocation());
}
+// Restore stack and initialize the two exception variables:
+// exception and stack trace variables.
void CatchEntryComp::EmitNativeCode(FlowGraphCompiler* compiler) {
- UNIMPLEMENTED();
+ // Restore RSP from RBP as we are coming from a throw and the code for
+ // popping arguments has not been run.
+ const intptr_t locals_space_size = compiler->StackSize() * kWordSize;
+ ASSERT(locals_space_size >= 0);
+ const intptr_t offset_size =
+ -locals_space_size + FlowGraphCompiler::kLocalsOffsetFromFP;
+ __ leal(ESP, Address(EBP, offset_size));
+
+ ASSERT(!exception_var().is_captured());
+ ASSERT(!stacktrace_var().is_captured());
+ __ movl(Address(EBP, exception_var().index() * kWordSize),
+ kExceptionObjectReg);
+ __ movl(Address(EBP, stacktrace_var().index() * kWordSize),
+ kStackTraceObjectReg);
}
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698