Index: src/ast.cc |
=================================================================== |
--- src/ast.cc (revision 7218) |
+++ src/ast.cc (working copy) |
@@ -621,21 +621,24 @@ |
bool Call::ComputeGlobalTarget(Handle<GlobalObject> global, |
- LookupResult* lookup) { |
+ Handle<String> name) { |
target_ = Handle<JSFunction>::null(); |
cell_ = Handle<JSGlobalPropertyCell>::null(); |
- 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; |
+ 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; |
+ } |
} |
} |
return false; |