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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 10915022: Implement argument definition test in the vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 11663)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -221,6 +221,35 @@
}
+LocationSummary* ArgumentDefinitionTestComp::MakeLocationSummary() const {
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* locs =
+ new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+ locs->set_in(0, Location::RegisterLocation(EAX));
+ locs->set_out(Location::RegisterLocation(EAX));
+ return locs;
+}
+
+
+void ArgumentDefinitionTestComp::EmitNativeCode(FlowGraphCompiler* compiler) {
+ Register saved_args_desc = locs()->in(0).reg();
+ Register result = locs()->out().reg();
+
+ // Push the result place holder initialized to NULL.
+ __ PushObject(Object::ZoneHandle());
+ __ pushl(Immediate(Smi::RawValue(formal_parameter_index())));
+ __ PushObject(formal_parameter_name());
+ __ pushl(saved_args_desc);
+ compiler->GenerateCallRuntime(deopt_id(),
+ token_pos(),
+ kArgumentDefinitionTestRuntimeEntry,
+ locs());
+ __ Drop(3);
+ __ popl(result); // Pop bool result.
+}
+
+
static Condition TokenKindToSmiCondition(Token::Kind kind) {
switch (kind) {
case Token::kEQ: return EQUAL;

Powered by Google App Engine
This is Rietveld 408576698