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