Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2007-2009 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 11500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11512 " sum += ext_array[i] = i;" | 11512 " sum += ext_array[i] = i;" |
| 11513 " return sum;" | 11513 " return sum;" |
| 11514 "}" | 11514 "}" |
| 11515 "sum=0;" | 11515 "sum=0;" |
| 11516 "for (var i=0;i<10000;++i) {" | 11516 "for (var i=0;i<10000;++i) {" |
| 11517 " sum=ee_store_test_func(sum);" | 11517 " sum=ee_store_test_func(sum);" |
| 11518 "}" | 11518 "}" |
| 11519 "sum;"); | 11519 "sum;"); |
| 11520 CHECK_EQ(7800000, result->Int32Value()); | 11520 CHECK_EQ(7800000, result->Int32Value()); |
| 11521 | 11521 |
| 11522 for (int i = 0; i < kElementCount; i++) { | |
| 11523 array->set(i, static_cast<ElementType>(i)); | |
| 11524 } | |
| 11525 // Test complex assignments | |
| 11526 result = CompileRun("function ee_op_test_complex_func(sum) {" | |
| 11527 " for (var i=0;i<40;++i) {" | |
|
Mads Ager (chromium)
2011/04/06 16:45:15
Add some spacing in all these loops?
| |
| 11528 " sum += (ext_array[i] += 1);" | |
| 11529 " sum += (ext_array[i] -= 1);" | |
| 11530 " } " | |
| 11531 " return sum;" | |
| 11532 "}" | |
| 11533 "sum=0;" | |
| 11534 "for (var i=0;i<10000;++i) {" | |
| 11535 " sum=ee_op_test_complex_func(sum);" | |
| 11536 "}" | |
| 11537 "sum;"); | |
| 11538 CHECK_EQ(16000000, result->Int32Value()); | |
| 11539 | |
| 11540 // Test count operations | |
| 11541 result = CompileRun("function ee_op_test_count_func(sum) {" | |
| 11542 " for (var i=0;i<40;++i) {" | |
| 11543 " sum += (++ext_array[i]);" | |
| 11544 " sum += (--ext_array[i]);" | |
| 11545 " } " | |
| 11546 " return sum;" | |
| 11547 "}" | |
| 11548 "sum=0;" | |
| 11549 "for (var i=0;i<10000;++i) {" | |
| 11550 " sum=ee_op_test_count_func(sum);" | |
| 11551 "}" | |
| 11552 "sum;"); | |
| 11553 CHECK_EQ(16000000, result->Int32Value()); | |
| 11554 | |
| 11522 result = CompileRun("ext_array[3] = 33;" | 11555 result = CompileRun("ext_array[3] = 33;" |
| 11523 "delete ext_array[3];" | 11556 "delete ext_array[3];" |
| 11524 "ext_array[3];"); | 11557 "ext_array[3];"); |
| 11525 CHECK_EQ(33, result->Int32Value()); | 11558 CHECK_EQ(33, result->Int32Value()); |
| 11526 | 11559 |
| 11527 result = CompileRun("ext_array[0] = 10; ext_array[1] = 11;" | 11560 result = CompileRun("ext_array[0] = 10; ext_array[1] = 11;" |
| 11528 "ext_array[2] = 12; ext_array[3] = 13;" | 11561 "ext_array[2] = 12; ext_array[3] = 13;" |
| 11529 "ext_array.__defineGetter__('2'," | 11562 "ext_array.__defineGetter__('2'," |
| 11530 "function() { return 120; });" | 11563 "function() { return 120; });" |
| 11531 "ext_array[2];"); | 11564 "ext_array[2];"); |
| (...skipping 2090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 13622 v8::Handle<v8::Function> define_property = | 13655 v8::Handle<v8::Function> define_property = |
| 13623 CompileRun("(function() {" | 13656 CompileRun("(function() {" |
| 13624 " Object.defineProperty(" | 13657 " Object.defineProperty(" |
| 13625 " this," | 13658 " this," |
| 13626 " 1," | 13659 " 1," |
| 13627 " { configurable: true, enumerable: true, value: 3 });" | 13660 " { configurable: true, enumerable: true, value: 3 });" |
| 13628 "})").As<Function>(); | 13661 "})").As<Function>(); |
| 13629 context->DetachGlobal(); | 13662 context->DetachGlobal(); |
| 13630 define_property->Call(proxy, 0, NULL); | 13663 define_property->Call(proxy, 0, NULL); |
| 13631 } | 13664 } |
| OLD | NEW |