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 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 | 1493 |
1494 // Simulate incremental marking so that the function is enqueued as | 1494 // Simulate incremental marking so that the function is enqueued as |
1495 // code flushing candidate. | 1495 // code flushing candidate. |
1496 SimulateIncrementalMarking(heap); | 1496 SimulateIncrementalMarking(heap); |
1497 | 1497 |
1498 // Enable the debugger and add a breakpoint while incremental marking | 1498 // Enable the debugger and add a breakpoint while incremental marking |
1499 // is running so that incremental marking aborts and code flushing is | 1499 // is running so that incremental marking aborts and code flushing is |
1500 // disabled. | 1500 // disabled. |
1501 int position = 0; | 1501 int position = 0; |
1502 Handle<Object> breakpoint_object(Smi::FromInt(0), isolate); | 1502 Handle<Object> breakpoint_object(Smi::FromInt(0), isolate); |
1503 EnableDebugger(); | 1503 EnableDebugger(CcTest::isolate()); |
1504 isolate->debug()->SetBreakPoint(function, breakpoint_object, &position); | 1504 isolate->debug()->SetBreakPoint(function, breakpoint_object, &position); |
1505 isolate->debug()->ClearAllBreakPoints(); | 1505 isolate->debug()->ClearAllBreakPoints(); |
1506 DisableDebugger(); | 1506 DisableDebugger(CcTest::isolate()); |
1507 | 1507 |
1508 // Force optimization now that code flushing is disabled. | 1508 // Force optimization now that code flushing is disabled. |
1509 { v8::HandleScope scope(CcTest::isolate()); | 1509 { v8::HandleScope scope(CcTest::isolate()); |
1510 CompileRun("%OptimizeFunctionOnNextCall(foo); foo();"); | 1510 CompileRun("%OptimizeFunctionOnNextCall(foo); foo();"); |
1511 } | 1511 } |
1512 | 1512 |
1513 // Simulate one final GC to make sure the candidate queue is sane. | 1513 // Simulate one final GC to make sure the candidate queue is sane. |
1514 heap->CollectAllGarbage(); | 1514 heap->CollectAllGarbage(); |
1515 CHECK(function->shared()->is_compiled() || !function->IsOptimized()); | 1515 CHECK(function->shared()->is_compiled() || !function->IsOptimized()); |
1516 CHECK(function->is_compiled() || !function->IsOptimized()); | 1516 CHECK(function->is_compiled() || !function->IsOptimized()); |
(...skipping 4929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6446 isolate->IncrementJsCallsFromApiCounter(); | 6446 isolate->IncrementJsCallsFromApiCounter(); |
6447 isolate->IncrementJsCallsFromApiCounter(); | 6447 isolate->IncrementJsCallsFromApiCounter(); |
6448 isolate->IncrementJsCallsFromApiCounter(); | 6448 isolate->IncrementJsCallsFromApiCounter(); |
6449 calls_per_ms = memory_reducer->SampleAndGetJsCallsPerMs(4); | 6449 calls_per_ms = memory_reducer->SampleAndGetJsCallsPerMs(4); |
6450 CheckDoubleEquals(2, calls_per_ms); | 6450 CheckDoubleEquals(2, calls_per_ms); |
6451 } | 6451 } |
6452 | 6452 |
6453 | 6453 |
6454 } // namespace internal | 6454 } // namespace internal |
6455 } // namespace v8 | 6455 } // namespace v8 |
OLD | NEW |