OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2367 | 2367 |
2368 TEST(OptimizedPretenuringdoubleArrayLiterals) { | 2368 TEST(OptimizedPretenuringdoubleArrayLiterals) { |
2369 i::FLAG_allow_natives_syntax = true; | 2369 i::FLAG_allow_natives_syntax = true; |
2370 i::FLAG_max_new_space_size = 2048; | 2370 i::FLAG_max_new_space_size = 2048; |
2371 CcTest::InitializeVM(); | 2371 CcTest::InitializeVM(); |
2372 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; | 2372 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; |
2373 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; | 2373 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; |
2374 v8::HandleScope scope(CcTest::isolate()); | 2374 v8::HandleScope scope(CcTest::isolate()); |
2375 | 2375 |
2376 v8::Local<v8::Value> res = CompileRun( | 2376 v8::Local<v8::Value> res = CompileRun( |
2377 "var number_elements = 20000;" | 2377 "var number_elements = 30000;" |
2378 "var elements = new Array(number_elements);" | 2378 "var elements = new Array(number_elements);" |
2379 "function f() {" | 2379 "function f() {" |
2380 " for (var i = 0; i < number_elements; i++) {" | 2380 " for (var i = 0; i < number_elements; i++) {" |
2381 " elements[i] = [1.1, 2.2, 3.3];" | 2381 " elements[i] = [1.1, 2.2, 3.3];" |
2382 " }" | 2382 " }" |
2383 " return elements[number_elements - 1];" | 2383 " return elements[number_elements - 1];" |
2384 "};" | 2384 "};" |
2385 "f(); f(); f();" | 2385 "f(); f(); f();" |
2386 "%OptimizeFunctionOnNextCall(f);" | 2386 "%OptimizeFunctionOnNextCall(f);" |
2387 "f();"); | 2387 "f();"); |
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3740 code = scope.CloseAndEscape(Handle<Code>(bar->code())); | 3740 code = scope.CloseAndEscape(Handle<Code>(bar->code())); |
3741 } | 3741 } |
3742 | 3742 |
3743 // Now make sure that a gc should get rid of the function | 3743 // Now make sure that a gc should get rid of the function |
3744 for (int i = 0; i < 4; i++) { | 3744 for (int i = 0; i < 4; i++) { |
3745 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); | 3745 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
3746 } | 3746 } |
3747 | 3747 |
3748 ASSERT(code->marked_for_deoptimization()); | 3748 ASSERT(code->marked_for_deoptimization()); |
3749 } | 3749 } |
OLD | NEW |