Commit f40c4635 authored by whesse@chromium.org's avatar whesse@chromium.org

Fix bug 1396: Optimized calls to API functions assumed that the receiver was a...

Fix bug 1396: Optimized calls to API functions assumed that the receiver was a JSObject, failed when compiling stub otherwise.

BUG=v8:1396
Review URL: http://codereview.chromium.org/7045002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7929 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 66911961
......@@ -2262,6 +2262,7 @@ MaybeObject* CallStubCompiler::CompileFastApiCall(
// repatch it to global receiver.
if (object->IsGlobalObject()) return heap()->undefined_value();
if (cell != NULL) return heap()->undefined_value();
if (!object->IsJSObject()) return heap()->undefined_value();
int depth = optimization.GetPrototypeDepthOfExpectedType(
JSObject::cast(object), holder);
if (depth == kInvalidProtoDepth) return heap()->undefined_value();
......
......@@ -2115,6 +2115,7 @@ MaybeObject* CallStubCompiler::CompileFastApiCall(
// repatch it to global receiver.
if (object->IsGlobalObject()) return heap()->undefined_value();
if (cell != NULL) return heap()->undefined_value();
if (!object->IsJSObject()) return heap()->undefined_value();
int depth = optimization.GetPrototypeDepthOfExpectedType(
JSObject::cast(object), holder);
if (depth == kInvalidProtoDepth) return heap()->undefined_value();
......
......@@ -2255,6 +2255,7 @@ MaybeObject* CallStubCompiler::CompileFastApiCall(
// repatch it to global receiver.
if (object->IsGlobalObject()) return heap->undefined_value();
if (cell != NULL) return heap->undefined_value();
if (!object->IsJSObject()) return heap()->undefined_value();
int depth = optimization.GetPrototypeDepthOfExpectedType(
JSObject::cast(object), holder);
if (depth == kInvalidProtoDepth) return heap->undefined_value();
......
......@@ -1954,6 +1954,7 @@ MaybeObject* CallStubCompiler::CompileFastApiCall(
// repatch it to global receiver.
if (object->IsGlobalObject()) return heap()->undefined_value();
if (cell != NULL) return heap()->undefined_value();
if (!object->IsJSObject()) return heap()->undefined_value();
int depth = optimization.GetPrototypeDepthOfExpectedType(
JSObject::cast(object), holder);
if (depth == kInvalidProtoDepth) return heap()->undefined_value();
......
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