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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 23482004: Evaluates arguments before throwing a NoSuchMethodError in constructor (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 26748)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -2797,10 +2797,13 @@
result_is_needed); // Save last arg if result is needed.
} else {
// Throw a NoSuchMethodError.
+ ArgumentListNode* arguments = new ArgumentListNode(node->token_pos());
+ arguments->Add(node->value());
call = BuildThrowNoSuchMethodError(
node->token_pos(),
node->cls(),
setter_name,
+ arguments,
InvocationMirror::EncodeType(
node->cls().IsTopLevel() ?
InvocationMirror::kTopLevel :
@@ -3566,6 +3569,7 @@
intptr_t token_pos,
const Class& function_class,
const String& function_name,
+ ArgumentListNode* actuals,
regis 2013/08/28 21:10:54 function_arguments
zra 2013/08/28 22:47:00 Done.
int invocation_type) {
ZoneGrowableArray<PushArgumentInstr*>* arguments =
new ZoneGrowableArray<PushArgumentInstr*>();
@@ -3590,13 +3594,25 @@
Smi::ZoneHandle(Smi::New(invocation_type))));
arguments->Add(PushArgument(invocation_type_value));
// List arguments.
- // TODO(regis): Pass arguments.
- Value* arguments_value = Bind(new ConstantInstr(Array::ZoneHandle()));
- arguments->Add(PushArgument(arguments_value));
+ if (actuals == NULL) {
+ Value* arguments_value = Bind(new ConstantInstr(Array::ZoneHandle()));
+ arguments->Add(PushArgument(arguments_value));
+ } else {
+ ValueGraphVisitor array_val(owner(), temp_index());
+ ArrayNode* array = new ArrayNode(
+ token_pos, Type::ZoneHandle(Type::ArrayType()), actuals->nodes());
+ array->Visit(&array_val);
+ Append(array_val);
+ arguments->Add(PushArgument(array_val.value()));
+ }
// List argumentNames.
- Value* argument_names_value =
- Bind(new ConstantInstr(Array::ZoneHandle()));
- arguments->Add(PushArgument(argument_names_value));
+ if (actuals == NULL) {
+ Value* argument_names_value = Bind(new ConstantInstr(Array::ZoneHandle()));
+ arguments->Add(PushArgument(argument_names_value));
+ } else {
+ Value* argument_names_value = Bind(new ConstantInstr(actuals->names()));
+ arguments->Add(PushArgument(argument_names_value));
+ }
srdjan 2013/08/28 21:43:15 The code above could be: ConstantInstr* cinstr = n
zra 2013/08/28 22:47:00 Done.
// List existingArgumentNames.
Value* existing_argument_names_value =
Bind(new ConstantInstr(Array::ZoneHandle()));

Powered by Google App Engine
This is Rietveld 408576698