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

Unified Diff: test/mjsunit/regress/string-set-char-deopt.js

Issue 185653004: Experimental parser: merge to r19637 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 10 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 | « test/mjsunit/regress/setvalueof-deopt.js ('k') | test/mjsunit/shift-for-integer-div.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/string-set-char-deopt.js
diff --git a/test/mjsunit/compiler/property-static.js b/test/mjsunit/regress/string-set-char-deopt.js
similarity index 59%
copy from test/mjsunit/compiler/property-static.js
copy to test/mjsunit/regress/string-set-char-deopt.js
index 07021340cd7aa94440638f925eeed921ee78c9c7..9f6d43453840e41d73c4a4f5702346d0fe6e16fa 100644
--- a/test/mjsunit/compiler/property-static.js
+++ b/test/mjsunit/regress/string-set-char-deopt.js
@@ -1,4 +1,4 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
+// Copyright 2014 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -27,43 +27,59 @@
// Flags: --allow-natives-syntax
-// Test usage of static type information for loads that would otherwise
-// turn into polymorphic or generic loads.
-
-// Prepare a highly polymorphic load to be used by all tests.
-Object.prototype.load = function() { return this.property; };
-Object.prototype.load.call({ A:0, property:10 });
-Object.prototype.load.call({ A:0, B:0, property:11 });
-Object.prototype.load.call({ A:0, B:0, C:0, property:12 });
-Object.prototype.load.call({ A:0, B:0, C:0, D:0, property:13 });
-Object.prototype.load.call({ A:0, B:0, C:0, D:0, E:0, property:14 });
-Object.prototype.load.call({ A:0, B:0, C:0, D:0, E:0, F:0, property:15 });
-
-// Test for object literals.
-(function() {
- function f(x) {
- var object = { property:x };
- return object.load();
+(function OneByteSeqStringSetCharDeoptOsr() {
+ function deopt() {
+ %DeoptimizeFunction(f);
}
- assertSame(1, f(1));
- assertSame(2, f(2));
+ function f(string, osr) {
+ var world = " world";
+ %_OneByteSeqStringSetChar(string, 0, (deopt(), 0x48));
+
+ if (osr) while (%GetOptimizationStatus(f) == 2) {}
+
+ return string + world;
+ }
+
+ assertEquals("Hello " + "world", f("hello", false));
+ %OptimizeFunctionOnNextCall(f);
+ assertEquals("Hello " + "world", f("hello", true));
+})();
+
+
+(function OneByteSeqStringSetCharDeopt() {
+ function deopt() {
+ %DeoptimizeFunction(f);
+ }
+
+ function g(x) {
+ }
+
+ function f(string) {
+ g(%_OneByteSeqStringSetChar(string, 0, (deopt(), 0x48)));
+ return string;
+ }
+
+ assertEquals("Hell" + "o", f("hello"));
%OptimizeFunctionOnNextCall(f);
- assertSame(3, f(3));
+ assertEquals("Hell" + "o", f("hello"));
})();
-// Test for inlined constructors.
-(function() {
- function c(x) {
- this.property = x;
+
+(function TwoByteSeqStringSetCharDeopt() {
+ function deopt() {
+ %DeoptimizeFunction(f);
+ }
+
+ function g(x) {
}
- function f(x) {
- var object = new c(x);
- return object.load();
+
+ function f(string) {
+ g(%_TwoByteSeqStringSetChar(string, 0, (deopt(), 0x48)));
+ return string;
}
- assertSame(1, f(1));
- assertSame(2, f(2));
+ assertEquals("Hell" + "o", f("\u20ACello"));
%OptimizeFunctionOnNextCall(f);
- assertSame(3, f(3));
+ assertEquals("Hell" + "o", f("\u20ACello"));
})();
« no previous file with comments | « test/mjsunit/regress/setvalueof-deopt.js ('k') | test/mjsunit/shift-for-integer-div.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698