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

Unified Diff: test/mjsunit/regress/regress-crbug-125148.js

Issue 10735054: Perform HasFastProperties check on prototypes when computing call targets in Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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/ast.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-crbug-125148.js
diff --git a/test/mjsunit/regress/regress-2030.js b/test/mjsunit/regress/regress-crbug-125148.js
similarity index 80%
copy from test/mjsunit/regress/regress-2030.js
copy to test/mjsunit/regress/regress-crbug-125148.js
index fb5a3d0c4633e2350f6ff0185f13416248296c29..ed884652dd0eb90baf029fe3a8533c5b311446d2 100644
--- a/test/mjsunit/regress/regress-2030.js
+++ b/test/mjsunit/regress/regress-crbug-125148.js
@@ -25,29 +25,26 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --allow-natives-syntax
-
-function a() {
- this.x = 1;
+var A = {
+ foo: function() { assertUnreachable(); }
}
-var aa = new a();
-%DebugPrint(aa);
-function b() {
- this.z = 23;
- this.x = 2;
+var B = {
+ b: 2,
+ foo: function() { return 1; }
}
-var bb = new b();
-%DebugPrint(bb);
+B.__proto__ = A;
+
+var C = {};
+C.__proto__ = B;
-function f(o) {
- return o.x;
+function bar(x) {
+ return x.foo();
}
-assertSame(1, f(aa));
-assertSame(1, f(aa));
-assertSame(2, f(bb));
-assertSame(2, f(bb));
-%OptimizeFunctionOnNextCall(f);
-assertSame(1, f(aa));
-assertSame(2, f(bb));
+for (var i = 0; i < 3; i++) {
+ assertEquals(1, bar(C));
+}
+%OptimizeObjectForAddingMultipleProperties(B, 100); // Force dictionary mode.
+%OptimizeFunctionOnNextCall(bar);
+assertEquals(1, bar(C));
« no previous file with comments | « src/ast.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698