Commit b0943ce1 authored by yurys@chromium.org's avatar yurys@chromium.org

Use stored Isolate pointer instead of Isolate::Current()

Fixed a couple of places where stored pointer to the isolate can be used instead of reading from thread local storage.

BUG=None
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/18418003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15457 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6d8f6080
...@@ -62,10 +62,9 @@ void ProfilerEventsProcessor::Enqueue(const CodeEventsContainer& event) { ...@@ -62,10 +62,9 @@ void ProfilerEventsProcessor::Enqueue(const CodeEventsContainer& event) {
} }
void ProfilerEventsProcessor::AddCurrentStack() { void ProfilerEventsProcessor::AddCurrentStack(Isolate* isolate) {
TickSampleEventRecord record(enqueue_order_); TickSampleEventRecord record(enqueue_order_);
TickSample* sample = &record.sample; TickSample* sample = &record.sample;
Isolate* isolate = Isolate::Current();
sample->state = isolate->current_vm_state(); sample->state = isolate->current_vm_state();
sample->pc = reinterpret_cast<Address>(sample); // Not NULL. sample->pc = reinterpret_cast<Address>(sample); // Not NULL.
for (StackTraceFrameIterator it(isolate); for (StackTraceFrameIterator it(isolate);
...@@ -428,7 +427,7 @@ void CpuProfiler::StartProfiling(const char* title, bool record_samples) { ...@@ -428,7 +427,7 @@ void CpuProfiler::StartProfiling(const char* title, bool record_samples) {
if (profiles_->StartProfiling(title, next_profile_uid_++, record_samples)) { if (profiles_->StartProfiling(title, next_profile_uid_++, record_samples)) {
StartProcessorIfNotStarted(); StartProcessorIfNotStarted();
} }
processor_->AddCurrentStack(); processor_->AddCurrentStack(isolate_);
} }
......
...@@ -161,7 +161,7 @@ class ProfilerEventsProcessor : public Thread { ...@@ -161,7 +161,7 @@ class ProfilerEventsProcessor : public Thread {
void Enqueue(const CodeEventsContainer& event); void Enqueue(const CodeEventsContainer& event);
// Puts current stack into tick sample events buffer. // Puts current stack into tick sample events buffer.
void AddCurrentStack(); void AddCurrentStack(Isolate* isolate);
// Tick sample events are filled directly in the buffer of the circular // Tick sample events are filled directly in the buffer of the circular
// queue (because the structure is of fixed width, but usually not all // queue (because the structure is of fixed width, but usually not all
......
...@@ -1041,7 +1041,7 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag, ...@@ -1041,7 +1041,7 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag,
} }
if (!FLAG_log_code || !log_->IsEnabled()) return; if (!FLAG_log_code || !log_->IsEnabled()) return;
if (code == Isolate::Current()->builtins()->builtin( if (code == isolate_->builtins()->builtin(
Builtins::kLazyCompile)) Builtins::kLazyCompile))
return; return;
...@@ -1698,7 +1698,7 @@ void Logger::LogCompiledFunctions() { ...@@ -1698,7 +1698,7 @@ void Logger::LogCompiledFunctions() {
// During iteration, there can be heap allocation due to // During iteration, there can be heap allocation due to
// GetScriptLineNumber call. // GetScriptLineNumber call.
for (int i = 0; i < compiled_funcs_count; ++i) { for (int i = 0; i < compiled_funcs_count; ++i) {
if (*code_objects[i] == Isolate::Current()->builtins()->builtin( if (*code_objects[i] == isolate_->builtins()->builtin(
Builtins::kLazyCompile)) Builtins::kLazyCompile))
continue; continue;
LogExistingFunction(sfis[i], code_objects[i]); LogExistingFunction(sfis[i], code_objects[i]);
...@@ -1778,7 +1778,7 @@ void Logger::SetCodeEventHandler(uint32_t options, ...@@ -1778,7 +1778,7 @@ void Logger::SetCodeEventHandler(uint32_t options,
code_event_handler_ = event_handler; code_event_handler_ = event_handler;
if (code_event_handler_ != NULL && (options & kJitCodeEventEnumExisting)) { if (code_event_handler_ != NULL && (options & kJitCodeEventEnumExisting)) {
HandleScope scope(Isolate::Current()); HandleScope scope(isolate_);
LogCodeObjects(); LogCodeObjects();
LogCompiledFunctions(); LogCompiledFunctions();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment