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

Unified Diff: test/cctest/test-api.cc

Issue 6881003: Prevent deopt when assigning double values to typed arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes to make ia32 tests run Created 9 years, 8 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/hydrogen.cc ('K') | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index d7621d12cf2ff1af6c02c36abd4c626b418eb612..a16a8ad42dd66bba96efbd40f1c8e6d5746b589e 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -11639,6 +11639,7 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
CHECK_EQ(true, result->BooleanValue());
}
+ #if 0
// Test crankshaft external array loads
for (int i = 0; i < kElementCount; i++) {
array->set(i, static_cast<ElementType>(i));
@@ -11700,6 +11701,28 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
"}"
"sum;");
CHECK_EQ(16000000, result->Int32Value());
+#endif
+
+ // Test assignment to non integer values in crankshaft
+ result = CompileRun("function ee_store_non_int(sum) {"
+ " for (var i = 0; i < 40; ++i) {"
+ " ext_array[i] = 2.523;"
+ " sum += ext_array[i];"
+ " }"
+ " return sum;"
+ "}"
+ "sum=0;"
+ "for (var i=0;i<1000000;++i) {"
+ " sum = ee_store_non_int(sum);"
+ "}"
+ "sum;");
+ if (array_type == v8::kExternalPixelArray) {
+ CHECK_EQ(120000000, result->Int32Value());
+ } else if (array_type == v8::kExternalFloatArray) {
+ CHECK_EQ(100920000, result->Int32Value());
+ } else {
+ CHECK_EQ(80000000, result->Int32Value());
+ }
result = CompileRun("ext_array[3] = 33;"
"delete ext_array[3];"
« src/hydrogen.cc ('K') | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698