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

Unified Diff: runtime/vm/flow_graph_compiler_x64.cc

Issue 9624025: Implement strict comparison and native calls in flow graph compiler x64. (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 | « no previous file | 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 5134)
+++ runtime/vm/flow_graph_compiler_x64.cc (working copy)
@@ -149,7 +149,23 @@
void FlowGraphCompiler::VisitStrictCompare(StrictCompareComp* comp) {
- Bailout("StrictCompareComp");
+ const Bool& bool_true = Bool::ZoneHandle(Bool::True());
+ const Bool& bool_false = Bool::ZoneHandle(Bool::False());
+ LoadValue(comp->left());
+ __ movq(RDX, RAX);
+ LoadValue(comp->right());
+ __ cmpq(RAX, RDX);
+ Label load_true, done;
+ if (comp->kind() == Token::kEQ_STRICT) {
+ __ j(EQUAL, &load_true, Assembler::kNearJump);
+ } else {
+ __ j(NOT_EQUAL, &load_true, Assembler::kNearJump);
+ }
+ __ LoadObject(RAX, bool_false);
+ __ jmp(&done, Assembler::kNearJump);
+ __ Bind(&load_true);
+ __ LoadObject(RAX, bool_true);
+ __ Bind(&done);
}
@@ -189,7 +205,20 @@
void FlowGraphCompiler::VisitNativeCall(NativeCallComp* comp) {
- Bailout("NativeCallComp");
+ // Push the result place holder initialized to NULL.
+ __ PushObject(Object::ZoneHandle());
+ // Pass a pointer to the first argument in RAX.
+ if (!comp->has_optional_parameters()) {
+ __ leaq(RAX, Address(RBP, (1 + comp->argument_count()) * kWordSize));
+ } else {
+ __ leaq(RAX, Address(RBP, -1 * kWordSize));
+ }
+ __ movq(RBX, Immediate(reinterpret_cast<uword>(comp->native_c_function())));
+ __ movq(R10, Immediate(comp->argument_count()));
+ GenerateCall(comp->token_index(),
+ &StubCode::CallNativeCFunctionLabel(),
+ PcDescriptors::kOther);
+ __ popq(RAX);
}
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698