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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 12328019: - Improve the message for NoSuchMethodErrors that are (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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_builder.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 18846)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -4,6 +4,7 @@
#include "vm/flow_graph_builder.h"
+#include "lib/invocation_mirror.h"
#include "vm/ast_printer.h"
#include "vm/code_descriptors.h"
#include "vm/dart_entry.h"
@@ -2374,9 +2375,15 @@
// NoSuchMethodError.
// Throw a NoSuchMethodError.
- StaticCallInstr* call = BuildThrowNoSuchMethodError(node->token_pos(),
- node->cls(),
- getter_name);
+ StaticCallInstr* call = BuildThrowNoSuchMethodError(
+ node->token_pos(),
+ node->cls(),
+ getter_name,
+ InvocationMirror::EncodeType(
+ node->cls().IsTopLevel() ?
+ InvocationMirror::kTopLevel :
+ InvocationMirror::kStatic,
+ InvocationMirror::kGetter));
ReturnDefinition(call);
return;
}
@@ -2418,9 +2425,15 @@
arguments);
} else {
// Throw a NoSuchMethodError.
- call = BuildThrowNoSuchMethodError(node->token_pos(),
- node->cls(),
- setter_name);
+ call = BuildThrowNoSuchMethodError(
+ node->token_pos(),
+ node->cls(),
+ setter_name,
+ InvocationMirror::EncodeType(
+ node->cls().IsTopLevel() ?
+ InvocationMirror::kTopLevel :
+ InvocationMirror::kStatic,
+ InvocationMirror::kGetter));
}
} else {
if (is_super_setter) {
@@ -3097,7 +3110,8 @@
StaticCallInstr* EffectGraphVisitor::BuildThrowNoSuchMethodError(
intptr_t token_pos,
const Class& function_class,
- const String& function_name) {
+ const String& function_name,
+ int invocation_type) {
ZoneGrowableArray<PushArgumentInstr*>* arguments =
new ZoneGrowableArray<PushArgumentInstr*>();
// Object receiver.
@@ -3116,6 +3130,10 @@
const String& member_name = String::ZoneHandle(Symbols::New(function_name));
Value* member_name_value = Bind(new ConstantInstr(member_name));
arguments->Add(PushArgument(member_name_value));
+ // Smi invocation_type.
+ Value* invocation_type_value = Bind(new ConstantInstr(
+ Smi::ZoneHandle(Smi::New(invocation_type))));
+ arguments->Add(PushArgument(invocation_type_value));
// List arguments.
Value* arguments_value = Bind(new ConstantInstr(Array::ZoneHandle()));
arguments->Add(PushArgument(arguments_value));
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698