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

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

Issue 159983008: Fix for (One|Two)ByteSeqStringSetChar evaluation order/deopt. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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 | « src/hydrogen.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/string-set-char-deopt.js
diff --git a/test/mjsunit/regress/binop-in-effect-context-deopt.js b/test/mjsunit/regress/string-set-char-deopt.js
similarity index 65%
copy from test/mjsunit/regress/binop-in-effect-context-deopt.js
copy to test/mjsunit/regress/string-set-char-deopt.js
index fb7280a0d1128c6baad81e759aad6b6bec3c6528..9f6d43453840e41d73c4a4f5702346d0fe6e16fa 100644
--- a/test/mjsunit/regress/binop-in-effect-context-deopt.js
+++ b/test/mjsunit/regress/string-set-char-deopt.js
@@ -27,39 +27,59 @@
// Flags: --allow-natives-syntax
-(function BinopInEffectContextDeoptAndOsr() {
- function f(a, deopt, osr) {
- var result = (a + 10, "result");
- var dummy = deopt + 0;
+(function OneByteSeqStringSetCharDeoptOsr() {
+ function deopt() {
+ %DeoptimizeFunction(f);
+ }
+
+ function f(string, osr) {
+ var world = " world";
+ %_OneByteSeqStringSetChar(string, 0, (deopt(), 0x48));
+
if (osr) while (%GetOptimizationStatus(f) == 2) {}
- return result;
+
+ return string + world;
}
- assertEquals("result", f(true, 3, false));
- assertEquals("result", f(true, 3, false));
+ assertEquals("Hello " + "world", f("hello", false));
%OptimizeFunctionOnNextCall(f);
- assertEquals("result", f(true, "foo", true));
+ assertEquals("Hello " + "world", f("hello", true));
})();
-(function BinopInEffectContextLazyDeopt() {
- function deopt_f() {
+(function OneByteSeqStringSetCharDeopt() {
+ function deopt() {
%DeoptimizeFunction(f);
- return "dummy";
}
- function h() {
- return { toString : deopt_f };
+ function g(x) {
+ }
+
+ function f(string) {
+ g(%_OneByteSeqStringSetChar(string, 0, (deopt(), 0x48)));
+ return string;
+ }
+
+ assertEquals("Hell" + "o", f("hello"));
+ %OptimizeFunctionOnNextCall(f);
+ assertEquals("Hell" + "o", f("hello"));
+})();
+
+
+(function TwoByteSeqStringSetCharDeopt() {
+ function deopt() {
+ %DeoptimizeFunction(f);
}
function g(x) {
}
- function f() {
- return g(void(h() + ""));
- };
+ function f(string) {
+ g(%_TwoByteSeqStringSetChar(string, 0, (deopt(), 0x48)));
+ return string;
+ }
- f();
+ assertEquals("Hell" + "o", f("\u20ACello"));
%OptimizeFunctionOnNextCall(f);
- f();
+ assertEquals("Hell" + "o", f("\u20ACello"));
})();
« no previous file with comments | « src/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698