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

Unified Diff: src/hydrogen.cc

Issue 95583002: Follow-up fix for r18135 in TryCallApply. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index e2c92300d262454b55814b554d37e16e546832a4..424c25714bd2ff11639a5c5ac92a817c19af990b 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -7560,12 +7560,6 @@ bool HOptimizedGraphBuilder::TryCallApply(Call* expr) {
// Found pattern f.apply(receiver, arguments).
CHECK_ALIVE_OR_RETURN(VisitForValue(prop->obj()), true);
HValue* function = Top();
- // The function get here may be an undefined constant if lookup fails.
- if (function->IsConstant() &&
- !HConstant::cast(function)->handle(isolate())->IsJSFunction()) {
- Drop(1);
- return false;
- }
AddCheckConstantFunction(expr->holder(), function, function_map);
Drop(1);
@@ -7597,10 +7591,10 @@ bool HOptimizedGraphBuilder::TryCallApply(Call* expr) {
}
Handle<JSFunction> known_function;
- if (function->IsConstant()) {
- HConstant* constant_function = HConstant::cast(function);
+ if (function->IsConstant() &&
+ HConstant::cast(function)->handle(isolate())->IsJSFunction()) {
known_function = Handle<JSFunction>::cast(
- constant_function->handle(isolate()));
+ HConstant::cast(function)->handle(isolate()));
int args_count = arguments_count - 1; // Excluding receiver.
if (TryInlineApply(known_function, expr, args_count)) return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698