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

Unified Diff: runtime/vm/flow_graph_compiler_x64.cc

Issue 9726011: Implement StaticGetter and StaticSetter in new compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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.h ('k') | runtime/vm/intermediate_language.h » ('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 5662)
+++ runtime/vm/flow_graph_compiler_x64.cc (working copy)
@@ -170,6 +170,22 @@
}
+void FlowGraphCompiler::EmitStaticCall(intptr_t token_index,
+ const Function& function,
+ intptr_t argument_count,
+ const Array& argument_names) {
+ const Array& arguments_descriptor =
+ CodeGenerator::ArgumentsDescriptor(argument_count, argument_names);
+ __ LoadObject(RBX, function);
+ __ LoadObject(R10, arguments_descriptor);
+
+ GenerateCall(token_index,
+ &StubCode::CallStaticFunctionLabel(),
+ PcDescriptors::kFuncCall);
+ __ addq(RSP, Immediate(argument_count * kWordSize));
+}
+
+
void FlowGraphCompiler::VisitCurrentContext(CurrentContextComp* comp) {
__ movq(RAX, CTX);
}
@@ -226,21 +242,12 @@
}
-
void FlowGraphCompiler::VisitStaticCall(StaticCallComp* comp) {
ASSERT(VerifyCallComputation(comp));
-
- int argument_count = comp->ArgumentCount();
- const Array& arguments_descriptor =
- CodeGenerator::ArgumentsDescriptor(argument_count,
- comp->argument_names());
- __ LoadObject(RBX, comp->function());
- __ LoadObject(R10, arguments_descriptor);
-
- GenerateCall(comp->token_index(),
- &StubCode::CallStaticFunctionLabel(),
- PcDescriptors::kFuncCall);
- __ addq(RSP, Immediate(argument_count * kWordSize));
+ EmitStaticCall(comp->token_index(),
+ comp->function(),
+ comp->ArgumentCount(),
+ comp->argument_names());
}
@@ -329,13 +336,13 @@
void FlowGraphCompiler::VisitInstanceSetter(InstanceSetterComp* comp) {
// Preserve the second argument under the arguments as the result of the
- // computation, then call the getter.
+ // computation, then call the setter.
const String& function_name =
String::ZoneHandle(Field::SetterSymbol(comp->field_name()));
// Insert a copy of the second (last) argument under the arguments.
__ popq(RAX); // Value.
- __ popq(RBX); // Reciever.
+ __ popq(RBX); // Receiver.
__ pushq(RAX);
__ pushq(RBX);
__ pushq(RAX);
@@ -345,6 +352,19 @@
}
+void FlowGraphCompiler::VisitStaticSetter(StaticSetterComp* comp) {
+ // Preserve the argument as the result of the computation,
+ // then call the setter.
+
+ // Duplicate the argument.
+ __ movq(RAX, Address(RSP, 0));
+ __ pushq(RAX);
+ EmitStaticCall(comp->token_index(), comp->setter_function(), 1,
+ Array::ZoneHandle());
+ __ popq(RAX);
+}
+
+
void FlowGraphCompiler::VisitBooleanNegate(BooleanNegateComp* comp) {
const Bool& bool_true = Bool::ZoneHandle(Bool::True());
const Bool& bool_false = Bool::ZoneHandle(Bool::False());
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698