Commit c153a843 authored by verwaest's avatar verwaest Committed by Commit bot

[crankshaft] Fix property access with proxies in prototype chain

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27911}
parent 7f994ee0
...@@ -6114,8 +6114,9 @@ bool HOptimizedGraphBuilder::PropertyAccessInfo::LookupInPrototypes() { ...@@ -6114,8 +6114,9 @@ bool HOptimizedGraphBuilder::PropertyAccessInfo::LookupInPrototypes() {
LookupDescriptor(*map, *name_); LookupDescriptor(*map, *name_);
if (IsFound()) return LoadResult(map); if (IsFound()) return LoadResult(map);
} }
NotFound(); NotFound();
return true; return !map->prototype()->IsJSReceiver();
} }
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
// overflow the system stack before the simulator stack. // overflow the system stack before the simulator stack.
// Flags: --harmony-proxies --sim-stack-size=500 --turbo-deoptimization // Flags: --harmony-proxies --sim-stack-size=500 --turbo-deoptimization
// Flags: --allow-natives-syntax
// Helper. // Helper.
...@@ -2302,3 +2303,25 @@ function TestConstructorWithProxyPrototype2(create, handler) { ...@@ -2302,3 +2303,25 @@ function TestConstructorWithProxyPrototype2(create, handler) {
} }
TestConstructorWithProxyPrototype(); TestConstructorWithProxyPrototype();
function TestOptWithProxyPrototype() {
var handler = {
getPropertyDescriptor: function(k) {
return {value: 10, configurable: true, enumerable: true, writable: true};
}
};
function C() {};
C.prototype = Proxy.create(handler);
var o = new C();
function f() {
return o.x;
}
assertEquals(10, f());
assertEquals(10, f());
%OptimizeFunctionOnNextCall(f);
assertEquals(10, f());
}
TestOptWithProxyPrototype();
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