Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index ded42b4b2ece73b907a841540d58665152ec3079..41cdb4c9c73b617a464ded994fb4a8151e2cca03 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -10790,6 +10790,24 @@ THREADED_TEST(PixelArray) { |
"result"); |
CHECK_EQ(32640, result->Int32Value()); |
+ // Make sure that pixel array stores are optimized by crankshaft. |
+ result = CompileRun("function pa_init(p) {" |
+ "for (var i = 0; i < 256; ++i) { p[i] = i; }" |
+ "}" |
+ "function pa_load(p) {" |
+ " var sum = 0;" |
+ " for (var i=0; i<256; ++i) {" |
+ " sum += p[i];" |
+ " }" |
+ " return sum; " |
+ "}" |
+ "for (var i = 0; i < 100000; ++i) {" |
+ " pa_init(pixels);" |
+ "}" |
+ "result = pa_load(pixels);" |
+ "result"); |
+ CHECK_EQ(32640, result->Int32Value()); |
+ |
free(pixel_data); |
} |