| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 11621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11632 " (ext_array[5] == expected_results[i]);" | 11632 " (ext_array[5] == expected_results[i]);" |
| 11633 "}" | 11633 "}" |
| 11634 "all_passed;", | 11634 "all_passed;", |
| 11635 (is_unsigned ? | 11635 (is_unsigned ? |
| 11636 unsigned_data : | 11636 unsigned_data : |
| 11637 (is_pixel_data ? pixel_data : signed_data))); | 11637 (is_pixel_data ? pixel_data : signed_data))); |
| 11638 result = CompileRun(test_buf.start()); | 11638 result = CompileRun(test_buf.start()); |
| 11639 CHECK_EQ(true, result->BooleanValue()); | 11639 CHECK_EQ(true, result->BooleanValue()); |
| 11640 } | 11640 } |
| 11641 | 11641 |
| 11642 #if 0 |
| 11642 // Test crankshaft external array loads | 11643 // Test crankshaft external array loads |
| 11643 for (int i = 0; i < kElementCount; i++) { | 11644 for (int i = 0; i < kElementCount; i++) { |
| 11644 array->set(i, static_cast<ElementType>(i)); | 11645 array->set(i, static_cast<ElementType>(i)); |
| 11645 } | 11646 } |
| 11646 result = CompileRun("function ee_load_test_func(sum) {" | 11647 result = CompileRun("function ee_load_test_func(sum) {" |
| 11647 " for (var i = 0; i < 40; ++i)" | 11648 " for (var i = 0; i < 40; ++i)" |
| 11648 " sum += ext_array[i];" | 11649 " sum += ext_array[i];" |
| 11649 " return sum;" | 11650 " return sum;" |
| 11650 "}" | 11651 "}" |
| 11651 "sum=0;" | 11652 "sum=0;" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11693 " sum += (--ext_array[i]);" | 11694 " sum += (--ext_array[i]);" |
| 11694 " } " | 11695 " } " |
| 11695 " return sum;" | 11696 " return sum;" |
| 11696 "}" | 11697 "}" |
| 11697 "sum=0;" | 11698 "sum=0;" |
| 11698 "for (var i=0;i<10000;++i) {" | 11699 "for (var i=0;i<10000;++i) {" |
| 11699 " sum=ee_op_test_count_func(sum);" | 11700 " sum=ee_op_test_count_func(sum);" |
| 11700 "}" | 11701 "}" |
| 11701 "sum;"); | 11702 "sum;"); |
| 11702 CHECK_EQ(16000000, result->Int32Value()); | 11703 CHECK_EQ(16000000, result->Int32Value()); |
| 11704 #endif |
| 11705 |
| 11706 // Test assignment to non integer values in crankshaft |
| 11707 result = CompileRun("function ee_store_non_int(sum) {" |
| 11708 " for (var i = 0; i < 40; ++i) {" |
| 11709 " ext_array[i] = 2.523;" |
| 11710 " sum += ext_array[i];" |
| 11711 " }" |
| 11712 " return sum;" |
| 11713 "}" |
| 11714 "sum=0;" |
| 11715 "for (var i=0;i<1000000;++i) {" |
| 11716 " sum = ee_store_non_int(sum);" |
| 11717 "}" |
| 11718 "sum;"); |
| 11719 if (array_type == v8::kExternalPixelArray) { |
| 11720 CHECK_EQ(120000000, result->Int32Value()); |
| 11721 } else if (array_type == v8::kExternalFloatArray) { |
| 11722 CHECK_EQ(100920000, result->Int32Value()); |
| 11723 } else { |
| 11724 CHECK_EQ(80000000, result->Int32Value()); |
| 11725 } |
| 11703 | 11726 |
| 11704 result = CompileRun("ext_array[3] = 33;" | 11727 result = CompileRun("ext_array[3] = 33;" |
| 11705 "delete ext_array[3];" | 11728 "delete ext_array[3];" |
| 11706 "ext_array[3];"); | 11729 "ext_array[3];"); |
| 11707 CHECK_EQ(33, result->Int32Value()); | 11730 CHECK_EQ(33, result->Int32Value()); |
| 11708 | 11731 |
| 11709 result = CompileRun("ext_array[0] = 10; ext_array[1] = 11;" | 11732 result = CompileRun("ext_array[0] = 10; ext_array[1] = 11;" |
| 11710 "ext_array[2] = 12; ext_array[3] = 13;" | 11733 "ext_array[2] = 12; ext_array[3] = 13;" |
| 11711 "ext_array.__defineGetter__('2'," | 11734 "ext_array.__defineGetter__('2'," |
| 11712 "function() { return 120; });" | 11735 "function() { return 120; });" |
| (...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13889 CHECK(func2->CreationContext() == context2); | 13912 CHECK(func2->CreationContext() == context2); |
| 13890 CheckContextId(func2, 2); | 13913 CheckContextId(func2, 2); |
| 13891 CHECK(instance2->CreationContext() == context2); | 13914 CHECK(instance2->CreationContext() == context2); |
| 13892 CheckContextId(instance2, 2); | 13915 CheckContextId(instance2, 2); |
| 13893 } | 13916 } |
| 13894 | 13917 |
| 13895 context1.Dispose(); | 13918 context1.Dispose(); |
| 13896 context2.Dispose(); | 13919 context2.Dispose(); |
| 13897 context3.Dispose(); | 13920 context3.Dispose(); |
| 13898 } | 13921 } |
| OLD | NEW |