Follow-up fix for r18135 in TryCallApply.

R=yangguo@chromium.org
BUG=chromium:323942
TEST=mjsunit/regress/regress-crbug-323942
LOG=N

Review URL: https://codereview.chromium.org/95583002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18152 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 55674264
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment