Chromium Code Reviews| Index: src/ast.cc |
| =================================================================== |
| --- src/ast.cc (revision 7468) |
| +++ src/ast.cc (working copy) |
| @@ -77,19 +77,22 @@ |
| var_(NULL), // Will be set by the call to BindTo. |
| is_this_(var->is_this()), |
| inside_with_(false), |
| - is_trivial_(false) { |
| + is_trivial_(false), |
| + position_(RelocInfo::kNoPosition) { |
| BindTo(var); |
| } |
| VariableProxy::VariableProxy(Handle<String> name, |
| bool is_this, |
| - bool inside_with) |
| + bool inside_with, |
| + int position) |
| : name_(name), |
| var_(NULL), |
| is_this_(is_this), |
| inside_with_(inside_with), |
| - is_trivial_(false) { |
| + is_trivial_(false), |
| + position_(position) { |
| // names must be canonicalized for fast equality checks |
|
fschneider
2011/04/01 11:38:57
-->Names must be canonicalized for fast equality c
Søren Thygesen Gjesse
2011/04/01 11:47:32
Done.
|
| ASSERT(name->IsSymbol()); |
| } |
| @@ -622,24 +625,21 @@ |
| bool Call::ComputeGlobalTarget(Handle<GlobalObject> global, |
| - Handle<String> name) { |
| + LookupResult* lookup) { |
| target_ = Handle<JSFunction>::null(); |
| cell_ = Handle<JSGlobalPropertyCell>::null(); |
| - LookupResult lookup; |
| - global->Lookup(*name, &lookup); |
| - if (lookup.IsProperty() && |
| - lookup.type() == NORMAL && |
| - lookup.holder() == *global) { |
| - cell_ = Handle<JSGlobalPropertyCell>(global->GetPropertyCell(&lookup)); |
| - if (cell_->value()->IsJSFunction()) { |
| - Handle<JSFunction> candidate(JSFunction::cast(cell_->value())); |
| - // If the function is in new space we assume it's more likely to |
| - // change and thus prefer the general IC code. |
| - if (!HEAP->InNewSpace(*candidate) && |
| - CanCallWithoutIC(candidate, arguments()->length())) { |
| - target_ = candidate; |
| - return true; |
| - } |
| + ASSERT(lookup->IsProperty() && |
| + lookup->type() == NORMAL && |
| + lookup->holder() == *global); |
| + cell_ = Handle<JSGlobalPropertyCell>(global->GetPropertyCell(lookup)); |
| + if (cell_->value()->IsJSFunction()) { |
| + Handle<JSFunction> candidate(JSFunction::cast(cell_->value())); |
| + // If the function is in new space we assume it's more likely to |
| + // change and thus prefer the general IC code. |
| + if (!HEAP->InNewSpace(*candidate) && |
| + CanCallWithoutIC(candidate, arguments()->length())) { |
| + target_ = candidate; |
| + return true; |
| } |
| } |
| return false; |