Index: test/mjsunit/regress/regress-3183.js |
diff --git a/test/mjsunit/regress/string-set-char-deopt.js b/test/mjsunit/regress/regress-3183.js |
similarity index 57% |
copy from test/mjsunit/regress/string-set-char-deopt.js |
copy to test/mjsunit/regress/regress-3183.js |
index 9f6d43453840e41d73c4a4f5702346d0fe6e16fa..0c915b0aec6890faba6d70026f1b465fcd9ee36e 100644 |
--- a/test/mjsunit/regress/string-set-char-deopt.js |
+++ b/test/mjsunit/regress/regress-3183.js |
@@ -27,59 +27,70 @@ |
// Flags: --allow-natives-syntax |
-(function OneByteSeqStringSetCharDeoptOsr() { |
- function deopt() { |
- %DeoptimizeFunction(f); |
- } |
+(function DeoptimizeArgCallFunctionGeneric() { |
+ var a = []; |
- function f(string, osr) { |
- var world = " world"; |
- %_OneByteSeqStringSetChar(string, 0, (deopt(), 0x48)); |
+ function f1(method, array, elem, deopt) { |
+ assertEquals('push', method); |
+ } |
- if (osr) while (%GetOptimizationStatus(f) == 2) {} |
+ function f2() { } |
- return string + world; |
+ function bar(x, deopt, f) { |
+ f('push', a, [x], deopt + 0); |
} |
- assertEquals("Hello " + "world", f("hello", false)); |
- %OptimizeFunctionOnNextCall(f); |
- assertEquals("Hello " + "world", f("hello", true)); |
+ function foo() { return bar(arguments[0], arguments[1], arguments[2]); } |
+ function baz(f, deopt) { return foo("x", deopt, f); } |
+ |
+ baz(f1, 0); |
+ baz(f2, 0); |
+ %OptimizeFunctionOnNextCall(baz); |
+ baz(f1, "deopt"); |
})(); |
-(function OneByteSeqStringSetCharDeopt() { |
- function deopt() { |
- %DeoptimizeFunction(f); |
- } |
+(function DeoptimizeArgGlobalFunctionGeneric() { |
+ var a = []; |
+ |
+ var f1; |
- function g(x) { |
+ f1 = function(method, array, elem, deopt) { |
+ assertEquals('push', method); |
} |
- function f(string) { |
- g(%_OneByteSeqStringSetChar(string, 0, (deopt(), 0x48))); |
- return string; |
+ function bar(x, deopt, f) { |
+ f1('push', a, [x], deopt + 0); |
} |
- assertEquals("Hell" + "o", f("hello")); |
- %OptimizeFunctionOnNextCall(f); |
- assertEquals("Hell" + "o", f("hello")); |
+ function foo() { return bar(arguments[0], arguments[1]); } |
+ function baz(deopt) { return foo("x", deopt); } |
+ |
+ baz(0); |
+ baz(0); |
+ %OptimizeFunctionOnNextCall(baz); |
+ baz("deopt"); |
})(); |
-(function TwoByteSeqStringSetCharDeopt() { |
- function deopt() { |
- %DeoptimizeFunction(f); |
- } |
+(function DeoptimizeArgCallFunctionRuntime() { |
+ var a = []; |
- function g(x) { |
+ var f1; |
+ |
+ f1 = function(method, array, elem, deopt) { |
+ assertEquals('push', method); |
} |
- function f(string) { |
- g(%_TwoByteSeqStringSetChar(string, 0, (deopt(), 0x48))); |
- return string; |
+ function bar(x, deopt) { |
+ %_CallFunction(null, 'push', [x][0], ((deopt + 0), 1), f1); |
} |
- assertEquals("Hell" + "o", f("\u20ACello")); |
- %OptimizeFunctionOnNextCall(f); |
- assertEquals("Hell" + "o", f("\u20ACello")); |
+ function foo() { return bar(arguments[0], arguments[1]); } |
+ function baz(deopt) { return foo(0, deopt); } |
+ |
+ baz(0); |
+ baz(0); |
+ %OptimizeFunctionOnNextCall(baz); |
+ baz("deopt"); |
})(); |