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

Unified Diff: runtime/vm/parser.cc

Issue 18272027: Add debugging info for 'this' (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 24749)
+++ runtime/vm/parser.cc (working copy)
@@ -448,11 +448,9 @@
this->parameters->Add(param);
}
- void AddReceiver(const Type* receiver_type) {
+ void AddReceiver(const Type* receiver_type, intptr_t token_pos) {
ASSERT(this->parameters->is_empty());
- AddFinalParameter(receiver_type->token_pos(),
- &Symbols::This(),
- receiver_type);
+ AddFinalParameter(token_pos, &Symbols::This(), receiver_type);
}
void SetImplicitlyFinal() {
@@ -1008,7 +1006,7 @@
// func.token_pos() points to the name of the field.
intptr_t ident_pos = func.token_pos();
ASSERT(current_class().raw() == func.Owner());
- params.AddReceiver(ReceiverType(ident_pos));
+ params.AddReceiver(ReceiverType(ident_pos), ident_pos);
ASSERT(func.num_fixed_parameters() == 1); // receiver.
ASSERT(!func.HasOptionalParameters());
ASSERT(AbstractType::Handle(func.result_type()).IsResolved());
@@ -1052,7 +1050,7 @@
ParamList params;
ASSERT(current_class().raw() == func.Owner());
- params.AddReceiver(ReceiverType(ident_pos));
+ params.AddReceiver(ReceiverType(ident_pos), ident_pos);
params.AddFinalParameter(ident_pos,
&Symbols::Value(),
&field_type);
@@ -1085,7 +1083,7 @@
const intptr_t ident_pos = func.token_pos();
ASSERT(func.token_pos() == 0);
ASSERT(current_class().raw() == func.Owner());
- params.AddReceiver(ReceiverType(ident_pos));
+ params.AddReceiver(ReceiverType(ident_pos), ident_pos);
ASSERT(func.num_fixed_parameters() == 1); // Receiver.
ASSERT(!func.HasOptionalParameters());
@@ -1117,7 +1115,7 @@
intptr_t token_pos = func.token_pos();
ASSERT(func.token_pos() == 0);
ASSERT(current_class().raw() == func.Owner());
- params.AddReceiver(ReceiverType(token_pos));
+ params.AddReceiver(ReceiverType(token_pos), token_pos);
ASSERT(func.num_fixed_parameters() == 1); // Receiver.
ASSERT(!func.HasOptionalParameters());
@@ -2222,7 +2220,7 @@
// Add implicit receiver parameter which is passed the allocated
// but uninitialized instance to construct.
ASSERT(current_class().raw() == func.Owner());
- params.AddReceiver(ReceiverType(TokenPos()));
+ params.AddReceiver(ReceiverType(TokenPos()), func.token_pos());
// Add implicit parameter for construction phase.
params.AddFinalParameter(
@@ -2481,7 +2479,7 @@
} else if (!func.is_static()) {
// Static functions do not have a receiver.
ASSERT(current_class().raw() == func.Owner());
- params.AddReceiver(ReceiverType(TokenPos()));
+ params.AddReceiver(ReceiverType(TokenPos()), func.token_pos());
} else if (func.IsFactory()) {
// The first parameter of a factory is the AbstractTypeArguments vector of
// the type of the instance to be allocated.
@@ -2698,7 +2696,8 @@
// The first parameter of a factory is the AbstractTypeArguments vector of
// the type of the instance to be allocated.
if (!method->has_static || method->IsConstructor()) {
- method->params.AddReceiver(ReceiverType(formal_param_pos));
+ method->params.AddReceiver(ReceiverType(formal_param_pos),
+ formal_param_pos);
} else if (method->IsFactory()) {
method->params.AddFinalParameter(
formal_param_pos,
@@ -3049,7 +3048,7 @@
field->name_pos);
ParamList params;
ASSERT(current_class().raw() == getter.Owner());
- params.AddReceiver(ReceiverType(TokenPos()));
+ params.AddReceiver(ReceiverType(TokenPos()), field->name_pos);
getter.set_result_type(*field->type);
AddFormalParamsToFunction(&params, getter);
members->AddFunction(getter);
@@ -3065,7 +3064,7 @@
field->name_pos);
ParamList params;
ASSERT(current_class().raw() == setter.Owner());
- params.AddReceiver(ReceiverType(TokenPos()));
+ params.AddReceiver(ReceiverType(TokenPos()), field->name_pos);
params.AddFinalParameter(TokenPos(),
&Symbols::Value(),
field->type);
@@ -3552,7 +3551,7 @@
// Add implicit 'this' parameter. We don't care about the specific type
// and just specify dynamic.
const Type& receiver_type = Type::Handle(Type::DynamicType());
- params.AddReceiver(&receiver_type);
+ params.AddReceiver(&receiver_type, cls.token_pos());
// Add implicit parameter for construction phase.
params.AddFinalParameter(cls.token_pos(),
&Symbols::PhaseParameter(),
« no previous file with comments | « no previous file | runtime/vm/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698