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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 { | 406 { |
407 v8::HandleScope scope(isolate); | 407 v8::HandleScope scope(isolate); |
408 | 408 |
409 TRACE_EVENT_END0("v8", "majorGC"); | 409 TRACE_EVENT_END0("v8", "majorGC"); |
410 if (isMainThread()) | 410 if (isMainThread()) |
411 TRACE_EVENT_SET_NONCONST_SAMPLING_STATE(V8PerIsolateData::from(isolate)-
>previousSamplingState()); | 411 TRACE_EVENT_SET_NONCONST_SAMPLING_STATE(V8PerIsolateData::from(isolate)-
>previousSamplingState()); |
412 } | 412 } |
413 | 413 |
414 void V8GCController::collectGarbage(v8::Isolate* isolate) | 414 void V8GCController::collectGarbage(v8::Isolate* isolate) |
415 { | 415 { |
416 V8ExecutionScope scope(isolate); | 416 v8::HandleScope handleScope(isolate); |
| 417 RefPtr<ScriptState> scriptState = ScriptState::create(v8::Context::New(isola
te), DOMWrapperWorld::create()); |
| 418 ScriptState::Scope scope(scriptState.get()); |
417 V8ScriptRunner::compileAndRunInternalScript(v8String(isolate, "if (gc) gc();
"), isolate); | 419 V8ScriptRunner::compileAndRunInternalScript(v8String(isolate, "if (gc) gc();
"), isolate); |
| 420 scriptState->disposePerContextData(); |
418 } | 421 } |
419 | 422 |
420 } // namespace WebCore | 423 } // namespace WebCore |
OLD | NEW |