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

Unified Diff: test/mjsunit/compiler/proto-chain-load.js

Issue 11338030: Improve handling of property loads on the proto chain. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added unit test Created 8 years, 2 months 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 | « src/x64/lithium-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/proto-chain-load.js
diff --git a/test/mjsunit/fast-array-length.js b/test/mjsunit/compiler/proto-chain-load.js
similarity index 76%
copy from test/mjsunit/fast-array-length.js
copy to test/mjsunit/compiler/proto-chain-load.js
index 42f2c38f49b1dd3a3c0ffa867f7db368df78e760..60c6431d2b180f858abecef650b27ddb6a23f4e4 100644
--- a/test/mjsunit/fast-array-length.js
+++ b/test/mjsunit/compiler/proto-chain-load.js
@@ -27,11 +27,18 @@
// Flags: --allow-natives-syntax
-// This is a regression test for overlapping key and value registers.
+// Test HLoadNamedField on the proto chain.
+var obj4 = Object.create(null, { f4: {value: 4} });
+var obj3 = Object.create(obj4, { f3: {value: 3} });
+var obj2 = Object.create(obj3, { f2: {value: 2} });
+var obj1 = Object.create(obj2, { f1: {value: 1} });
+var obj0 = Object.create(obj1, { f0: {value: 0} });
-var a = [0, 1, 2, 3, 4, 5];
-assertTrue(%HasFastSmiElements(a));
-a.length = (1 << 30);
-assertFalse(%HasFastSmiElements(a));
+function get4(obj) { return obj.f4; }
+assertEquals(4, get4(obj0));
+assertEquals(4, get4(obj0));
+%OptimizeFunctionOnNextCall(get4);
+assertEquals(4, get4(obj0));
+assertEquals(4, get4(obj0));
« no previous file with comments | « src/x64/lithium-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698