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

Unified Diff: src/hydrogen.cc

Issue 95123003: Fix bug in inlining Function.apply. (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 | test/mjsunit/regress/regress-crbug-323942.js » ('j') | 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 5b9e42f9979195104780f8c89e5cb5ca061b8932..be41de57e68751e32feef978eaf8fec12b6d2c70 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -7560,6 +7560,13 @@ 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;
Michael Starzinger 2013/11/28 16:01:25 I don't think it is safe to bail out at this point
+ }
+
AddCheckConstantFunction(expr->holder(), function, function_map);
Drop(1);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-323942.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698