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

Unified Diff: test/mjsunit/lithium/SeqStringSetChar.js

Issue 23890007: ARM: Improve SeqStringSetChar implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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
« src/arm/lithium-codegen-arm.cc ('K') | « src/arm/lithium-codegen-arm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/lithium/SeqStringSetChar.js
diff --git a/test/mjsunit/array-non-smi-length.js b/test/mjsunit/lithium/SeqStringSetChar.js
similarity index 72%
copy from test/mjsunit/array-non-smi-length.js
copy to test/mjsunit/lithium/SeqStringSetChar.js
index 23a25ee797bd68690ad2a7ce26a9135e23b486e2..3c890a84897f0014f79f07ef624daf8c3bf825a4 100644
--- a/test/mjsunit/array-non-smi-length.js
+++ b/test/mjsunit/lithium/SeqStringSetChar.js
@@ -27,20 +27,20 @@
// Flags: --allow-natives-syntax
-function TestNonSmiArrayLength() {
- function f(a) {
- return a.length+1;
- }
-
- var a = [];
- a.length = 0xFFFF;
- assertSame(0x10000, f(a));
- assertSame(0x10000, f(a));
-
- %OptimizeFunctionOnNextCall(f);
- a.length = 0xFFFFFFFF;
- assertSame(0x100000000, f(a));
+function MyStringFromCharCode(code, i) {
+ var one_byte = %NewString(3, true);
+ %_OneByteSeqStringSetChar(one_byte, 0, code);
+ %_OneByteSeqStringSetChar(one_byte, 1, code);
+ %_OneByteSeqStringSetChar(one_byte, i, code);
+ var two_byte = %NewString(3, false);
+ %_TwoByteSeqStringSetChar(two_byte, 0, code);
+ %_TwoByteSeqStringSetChar(two_byte, 1, code);
+ %_TwoByteSeqStringSetChar(two_byte, i, code);
+ return one_byte + two_byte;
}
-TestNonSmiArrayLength();
-
+MyStringFromCharCode(65, 2);
+var r1 = MyStringFromCharCode(65, 2);
+%OptimizeFunctionOnNextCall(MyStringFromCharCode);
+var r2 = MyStringFromCharCode(65, 2);
+assertEquals(r1, r2);
« src/arm/lithium-codegen-arm.cc ('K') | « src/arm/lithium-codegen-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698