OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 RefPtr<ScriptState> script_state = ScriptState::Create( | 458 RefPtr<ScriptState> script_state = ScriptState::Create( |
459 v8::Context::New(isolate), | 459 v8::Context::New(isolate), |
460 DOMWrapperWorld::Create(isolate, | 460 DOMWrapperWorld::Create(isolate, |
461 DOMWrapperWorld::WorldType::kGarbageCollector)); | 461 DOMWrapperWorld::WorldType::kGarbageCollector)); |
462 ScriptState::Scope scope(script_state.Get()); | 462 ScriptState::Scope scope(script_state.Get()); |
463 StringBuilder builder; | 463 StringBuilder builder; |
464 builder.Append("if (gc) gc("); | 464 builder.Append("if (gc) gc("); |
465 builder.Append(only_minor_gc ? "true" : "false"); | 465 builder.Append(only_minor_gc ? "true" : "false"); |
466 builder.Append(")"); | 466 builder.Append(")"); |
467 V8ScriptRunner::CompileAndRunInternalScript( | 467 V8ScriptRunner::CompileAndRunInternalScript( |
| 468 ExecutionContext::From(script_state.Get()), |
468 V8String(isolate, builder.ToString()), isolate); | 469 V8String(isolate, builder.ToString()), isolate); |
469 script_state->DisposePerContextData(); | 470 script_state->DisposePerContextData(); |
470 } | 471 } |
471 | 472 |
472 void V8GCController::CollectAllGarbageForTesting(v8::Isolate* isolate) { | 473 void V8GCController::CollectAllGarbageForTesting(v8::Isolate* isolate) { |
473 for (unsigned i = 0; i < 5; i++) | 474 for (unsigned i = 0; i < 5; i++) |
474 isolate->RequestGarbageCollectionForTesting( | 475 isolate->RequestGarbageCollectionForTesting( |
475 v8::Isolate::kFullGarbageCollection); | 476 v8::Isolate::kFullGarbageCollection); |
476 } | 477 } |
477 | 478 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 double start_time = WTF::CurrentTimeMS(); | 558 double start_time = WTF::CurrentTimeMS(); |
558 v8::HandleScope scope(isolate); | 559 v8::HandleScope scope(isolate); |
559 PendingActivityVisitor visitor(isolate, execution_context); | 560 PendingActivityVisitor visitor(isolate, execution_context); |
560 ToIsolate(execution_context)->VisitHandlesWithClassIds(&visitor); | 561 ToIsolate(execution_context)->VisitHandlesWithClassIds(&visitor); |
561 scan_pending_activity_histogram.Count( | 562 scan_pending_activity_histogram.Count( |
562 static_cast<int>(WTF::CurrentTimeMS() - start_time)); | 563 static_cast<int>(WTF::CurrentTimeMS() - start_time)); |
563 return visitor.PendingActivityFound(); | 564 return visitor.PendingActivityFound(); |
564 } | 565 } |
565 | 566 |
566 } // namespace blink | 567 } // namespace blink |
OLD | NEW |