Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: src/log.cc

Issue 12254007: Make the Isolate parameter mandatory for internal HandleScopes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/log.h ('k') | src/messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index 8b8376e1e8146e37d07fcb0d1db1cd896e8ffc6c..99425a68d761c61bfe003cf4b5da3e4cfb21dbec 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -440,8 +440,9 @@ class Logger::NameBuffer {
};
-Logger::Logger()
- : ticker_(NULL),
+Logger::Logger(Isolate* isolate)
+ : isolate_(isolate),
+ ticker_(NULL),
profiler_(NULL),
log_events_(NULL),
logging_nesting_(0),
@@ -718,9 +719,11 @@ void Logger::RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache) {
}
-void Logger::LogRuntime(Vector<const char> format, JSArray* args) {
+void Logger::LogRuntime(Isolate* isolate,
+ Vector<const char> format,
+ JSArray* args) {
if (!log_->IsEnabled() || !FLAG_log_runtime) return;
- HandleScope scope;
+ HandleScope scope(isolate);
LogMessageBuilder msg(this);
for (int i = 0; i < format.length(); i++) {
char c = format[i];
@@ -1217,7 +1220,7 @@ void Logger::SuspectReadEvent(String* name, Object* obj) {
LogMessageBuilder msg(this);
String* class_name = obj->IsJSObject()
? JSObject::cast(obj)->class_name()
- : HEAP->empty_string();
+ : isolate_->heap()->empty_string();
msg.Append("suspect-read,");
msg.Append(class_name);
msg.Append(',');
@@ -1563,7 +1566,7 @@ void Logger::LowLevelLogWriteBytes(const char* bytes, int size) {
void Logger::LogCodeObjects() {
- Heap* heap = HEAP;
+ Heap* heap = isolate_->heap();
heap->CollectAllGarbage(Heap::kMakeHeapIterableMask,
"Logger::LogCodeObjects");
HeapIterator iterator(heap);
@@ -1620,10 +1623,10 @@ void Logger::LogExistingFunction(Handle<SharedFunctionInfo> shared,
void Logger::LogCompiledFunctions() {
- Heap* heap = HEAP;
+ Heap* heap = isolate_->heap();
heap->CollectAllGarbage(Heap::kMakeHeapIterableMask,
"Logger::LogCompiledFunctions");
- HandleScope scope;
+ HandleScope scope(isolate_);
const int compiled_funcs_count = EnumerateCompiledFunctions(heap, NULL, NULL);
ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count);
ScopedVector< Handle<Code> > code_objects(compiled_funcs_count);
@@ -1641,7 +1644,7 @@ void Logger::LogCompiledFunctions() {
void Logger::LogAccessorCallbacks() {
- Heap* heap = HEAP;
+ Heap* heap = isolate_->heap();
heap->CollectAllGarbage(Heap::kMakeHeapIterableMask,
"Logger::LogAccessorCallbacks");
HeapIterator iterator(heap);
@@ -1722,7 +1725,7 @@ void Logger::SetCodeEventHandler(uint32_t options,
code_event_handler_ = event_handler;
if (code_event_handler_ != NULL && (options & kJitCodeEventEnumExisting)) {
- HandleScope scope;
+ HandleScope scope(Isolate::Current());
LogCodeObjects();
LogCompiledFunctions();
}
« no previous file with comments | « src/log.h ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698