Chromium Code Reviews| 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 267 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8MajorGC"); | 267 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8MajorGC"); |
| 268 } else { | 268 } else { |
| 269 objectGroupingForMajorGC(isolate, constructRetainedObjectInfos); | 269 objectGroupingForMajorGC(isolate, constructRetainedObjectInfos); |
| 270 } | 270 } |
| 271 } | 271 } |
| 272 | 272 |
| 273 } | 273 } |
| 274 | 274 |
| 275 void V8GCController::gcPrologue(v8::GCType type, v8::GCCallbackFlags flags) | 275 void V8GCController::gcPrologue(v8::GCType type, v8::GCCallbackFlags flags) |
| 276 { | 276 { |
| 277 if (ThreadState::current()) | |
| 278 ThreadState::current()->willStartV8GC(); | |
| 279 | |
|
haraken
2015/11/20 15:11:35
Would you move this to after ScriptForbiddenScope:
| |
| 280 if (isMainThread()) { | 277 if (isMainThread()) { |
| 281 ScriptForbiddenScope::enter(); | 278 ScriptForbiddenScope::enter(); |
| 282 } | 279 } |
| 283 | 280 |
| 284 // TODO(haraken): It would be nice if the GC callbacks passed the Isolate | 281 // TODO(haraken): It would be nice if the GC callbacks passed the Isolate |
| 285 // directly. | 282 // directly. |
| 286 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 283 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 287 v8::HandleScope scope(isolate); | 284 v8::HandleScope scope(isolate); |
| 288 switch (type) { | 285 switch (type) { |
| 289 case v8::kGCTypeScavenge: | 286 case v8::kGCTypeScavenge: |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 439 Visitor* m_visitor; | 436 Visitor* m_visitor; |
| 440 }; | 437 }; |
| 441 | 438 |
| 442 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) | 439 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) |
| 443 { | 440 { |
| 444 DOMWrapperTracer tracer(visitor); | 441 DOMWrapperTracer tracer(visitor); |
| 445 v8::V8::VisitHandlesWithClassIds(isolate, &tracer); | 442 v8::V8::VisitHandlesWithClassIds(isolate, &tracer); |
| 446 } | 443 } |
| 447 | 444 |
| 448 } // namespace blink | 445 } // namespace blink |
| OLD | NEW |