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 11625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11636 " (ext_array[5] == expected_results[i]);" | 11636 " (ext_array[5] == expected_results[i]);" |
11637 "}" | 11637 "}" |
11638 "all_passed;", | 11638 "all_passed;", |
11639 (is_unsigned ? | 11639 (is_unsigned ? |
11640 unsigned_data : | 11640 unsigned_data : |
11641 (is_pixel_data ? pixel_data : signed_data))); | 11641 (is_pixel_data ? pixel_data : signed_data))); |
11642 result = CompileRun(test_buf.start()); | 11642 result = CompileRun(test_buf.start()); |
11643 CHECK_EQ(true, result->BooleanValue()); | 11643 CHECK_EQ(true, result->BooleanValue()); |
11644 } | 11644 } |
11645 | 11645 |
11646 // Test crankshaft external array loads | |
11647 for (int i = 0; i < kElementCount; i++) { | |
11648 array->set(i, static_cast<ElementType>(i)); | |
11649 } | |
11650 result = CompileRun("function ee_load_test_func(sum) {" | |
11651 " for (var i = 0; i < 40; ++i)" | |
11652 " sum += ext_array[i];" | |
11653 " return sum;" | |
11654 "}" | |
11655 "sum=0;" | |
11656 "for (var i=0;i<10000;++i) {" | |
11657 " sum=ee_load_test_func(sum);" | |
11658 "}" | |
11659 "sum;"); | |
11660 CHECK_EQ(7800000, result->Int32Value()); | |
11661 | |
11662 // Test crankshaft external array stores | |
11663 result = CompileRun("function ee_store_test_func(sum) {" | |
11664 " for (var i = 0; i < 40; ++i)" | |
11665 " sum += ext_array[i] = i;" | |
11666 " return sum;" | |
11667 "}" | |
11668 "sum=0;" | |
11669 "for (var i=0;i<10000;++i) {" | |
11670 " sum=ee_store_test_func(sum);" | |
11671 "}" | |
11672 "sum;"); | |
11673 CHECK_EQ(7800000, result->Int32Value()); | |
11674 | |
11675 for (int i = 0; i < kElementCount; i++) { | 11646 for (int i = 0; i < kElementCount; i++) { |
11676 array->set(i, static_cast<ElementType>(i)); | 11647 array->set(i, static_cast<ElementType>(i)); |
11677 } | 11648 } |
11678 // Test complex assignments | 11649 // Test complex assignments |
11679 result = CompileRun("function ee_op_test_complex_func(sum) {" | 11650 result = CompileRun("function ee_op_test_complex_func(sum) {" |
11680 " for (var i = 0; i < 40; ++i) {" | 11651 " for (var i = 0; i < 40; ++i) {" |
11681 " sum += (ext_array[i] += 1);" | 11652 " sum += (ext_array[i] += 1);" |
11682 " sum += (ext_array[i] -= 1);" | 11653 " sum += (ext_array[i] -= 1);" |
11683 " } " | 11654 " } " |
11684 " return sum;" | 11655 " return sum;" |
(...skipping 2331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14016 { // Check that query wins on disagreement. | 13987 { // Check that query wins on disagreement. |
14017 Handle<ObjectTemplate> templ = ObjectTemplate::New(); | 13988 Handle<ObjectTemplate> templ = ObjectTemplate::New(); |
14018 templ->SetNamedPropertyHandler(HasOwnPropertyNamedPropertyGetter, | 13989 templ->SetNamedPropertyHandler(HasOwnPropertyNamedPropertyGetter, |
14019 0, | 13990 0, |
14020 HasOwnPropertyNamedPropertyQuery2); | 13991 HasOwnPropertyNamedPropertyQuery2); |
14021 Handle<Object> instance = templ->NewInstance(); | 13992 Handle<Object> instance = templ->NewInstance(); |
14022 CHECK(!instance->HasOwnProperty(v8_str("foo"))); | 13993 CHECK(!instance->HasOwnProperty(v8_str("foo"))); |
14023 CHECK(instance->HasOwnProperty(v8_str("bar"))); | 13994 CHECK(instance->HasOwnProperty(v8_str("bar"))); |
14024 } | 13995 } |
14025 } | 13996 } |
OLD | NEW |