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

Unified Diff: runtime/vm/flow_graph_compiler_x64.cc

Issue 10398046: Move code for accessing captured variables into the IL. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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_builder.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_x64.cc
===================================================================
--- runtime/vm/flow_graph_compiler_x64.cc (revision 7672)
+++ runtime/vm/flow_graph_compiler_x64.cc (working copy)
@@ -613,47 +613,13 @@
void FlowGraphCompiler::VisitLoadLocal(LoadLocalComp* comp) {
- if (comp->local().is_captured()) {
- // The variable lives in the context.
- intptr_t delta = comp->context_level() -
- comp->local().owner()->context_level();
- ASSERT(delta >= 0);
- Register base = CTX;
- while (delta-- > 0) {
- __ movq(RAX, FieldAddress(base, Context::parent_offset()));
- base = RAX;
- }
- __ movq(RAX,
- FieldAddress(base,
- Context::variable_offset(comp->local().index())));
- } else {
- // The variable lives in the current stack frame.
- __ movq(RAX, Address(RBP, comp->local().index() * kWordSize));
- }
+ __ movq(RAX, Address(RBP, comp->local().index() * kWordSize));
}
void FlowGraphCompiler::VisitStoreLocal(StoreLocalComp* comp) {
LoadValue(RAX, comp->value());
- if (comp->local().is_captured()) {
- // The variable lives in the context.
- Register scratch = R10;
- intptr_t delta = comp->context_level() -
- comp->local().owner()->context_level();
- ASSERT(delta >= 0);
- Register base = CTX;
- while (delta-- > 0) {
- __ movq(scratch, FieldAddress(base, Context::parent_offset()));
- base = scratch;
- }
- __ StoreIntoObject(
- base,
- FieldAddress(base, Context::variable_offset(comp->local().index())),
- RAX);
- } else {
- // The variable lives in the current stack frame.
- __ movq(Address(RBP, comp->local().index() * kWordSize), RAX);
- }
+ __ movq(Address(RBP, comp->local().index() * kWordSize), RAX);
}
@@ -946,11 +912,18 @@
void FlowGraphCompiler::VisitNativeLoadField(NativeLoadFieldComp* comp) {
- __ popq(RAX);
+ LoadValue(RAX, comp->value());
__ movq(RAX, FieldAddress(RAX, comp->offset_in_bytes()));
}
+void FlowGraphCompiler::VisitNativeStoreField(NativeStoreFieldComp* comp) {
+ LoadValue(RBX, comp->dest());
+ LoadValue(RAX, comp->value());
+ __ StoreIntoObject(RBX, FieldAddress(RBX, comp->offset_in_bytes()), RAX);
+}
+
+
void FlowGraphCompiler::VisitInstantiateTypeArguments(
InstantiateTypeArgumentsComp* comp) {
__ popq(RAX); // Instantiator.
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698