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

Unified Diff: runtime/vm/flow_graph_builder.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/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 11663)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -1322,6 +1322,16 @@
}
+void EffectGraphVisitor::VisitArgumentDefinitionTestNode(
+ ArgumentDefinitionTestNode* node) {
+ Computation* load = BuildLoadLocal(node->saved_arguments_descriptor());
+ Value* arguments_descriptor = Bind(load);
+ ArgumentDefinitionTestComp* arg_def_test =
+ new ArgumentDefinitionTestComp(node, arguments_descriptor);
+ ReturnComputation(arg_def_test);
+}
+
+
void EffectGraphVisitor::VisitArrayNode(ArrayNode* node) {
InlineBailout("EffectGraphVisitor::VisitArrayNode");
// Translate the array elements and collect their values.
@@ -1354,6 +1364,7 @@
// The context scope may have already been set by the non-optimizing
// compiler. If it was not, set it here.
if (function.context_scope() == ContextScope::null()) {
+ // TODO(regis): Why are we not doing this in the parser?
const ContextScope& context_scope = ContextScope::ZoneHandle(
node->scope()->PreserveOuterScope(owner()->context_level()));
ASSERT(!function.HasCode());
@@ -2233,9 +2244,14 @@
if (node == owner()->parsed_function().node_sequence()) {
ASSERT(scope->context_level() == 1);
const Function& function = owner()->parsed_function().function();
- const int num_params = function.NumberOfParameters();
+ int num_params = function.NumberOfParameters();
int param_frame_index = (num_params == function.num_fixed_parameters()) ?
(1 + num_params) : ParsedFunction::kFirstLocalSlotIndex;
+ // Handle the saved arguments descriptor as an additional parameter.
+ if (owner()->parsed_function().GetSavedArgumentsDescriptorVar() != NULL) {
+ ASSERT(param_frame_index == ParsedFunction::kFirstLocalSlotIndex);
+ num_params++;
+ }
for (int pos = 0; pos < num_params; param_frame_index--, pos++) {
const LocalVariable& parameter = *scope->VariableAt(pos);
ASSERT(parameter.owner() == scope);

Powered by Google App Engine
This is Rietveld 408576698