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

Side by Side Diff: src/api.cc

Issue 6733030: Allow calling stats API functions before we have an isolate. (Closed)
Patch Set: Created 9 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4380 matching lines...) Expand 10 before | Expand all | Expand 10 after
4391 int frame_limit, 4391 int frame_limit,
4392 StackTrace::StackTraceOptions options) { 4392 StackTrace::StackTraceOptions options) {
4393 i::Isolate::Current()->SetCaptureStackTraceForUncaughtExceptions( 4393 i::Isolate::Current()->SetCaptureStackTraceForUncaughtExceptions(
4394 capture, 4394 capture,
4395 frame_limit, 4395 frame_limit,
4396 options); 4396 options);
4397 } 4397 }
4398 4398
4399 4399
4400 void V8::SetCounterFunction(CounterLookupCallback callback) { 4400 void V8::SetCounterFunction(CounterLookupCallback callback) {
4401 i::Isolate* isolate = i::Isolate::Current(); 4401 i::Isolate* isolate = EnterIsolateIfNeeded();
4402 if (IsDeadCheck(isolate, "v8::V8::SetCounterFunction()")) return; 4402 if (IsDeadCheck(isolate, "v8::V8::SetCounterFunction()")) return;
4403 isolate->stats_table()->SetCounterFunction(callback); 4403 isolate->stats_table()->SetCounterFunction(callback);
4404 } 4404 }
4405 4405
4406 void V8::SetCreateHistogramFunction(CreateHistogramCallback callback) { 4406 void V8::SetCreateHistogramFunction(CreateHistogramCallback callback) {
4407 i::Isolate* isolate = i::Isolate::Current(); 4407 i::Isolate* isolate = EnterIsolateIfNeeded();
4408 if (IsDeadCheck(isolate, "v8::V8::SetCreateHistogramFunction()")) return; 4408 if (IsDeadCheck(isolate, "v8::V8::SetCreateHistogramFunction()")) return;
4409 isolate->stats_table()->SetCreateHistogramFunction(callback); 4409 isolate->stats_table()->SetCreateHistogramFunction(callback);
4410 } 4410 }
4411 4411
4412 void V8::SetAddHistogramSampleFunction(AddHistogramSampleCallback callback) { 4412 void V8::SetAddHistogramSampleFunction(AddHistogramSampleCallback callback) {
4413 i::Isolate* isolate = i::Isolate::Current(); 4413 i::Isolate* isolate = EnterIsolateIfNeeded();
4414 if (IsDeadCheck(isolate, "v8::V8::SetAddHistogramSampleFunction()")) return; 4414 if (IsDeadCheck(isolate, "v8::V8::SetAddHistogramSampleFunction()")) return;
4415 isolate->stats_table()-> 4415 isolate->stats_table()->
4416 SetAddHistogramSampleFunction(callback); 4416 SetAddHistogramSampleFunction(callback);
4417 } 4417 }
4418 4418
4419 void V8::EnableSlidingStateWindow() { 4419 void V8::EnableSlidingStateWindow() {
4420 i::Isolate* isolate = i::Isolate::Current(); 4420 i::Isolate* isolate = i::Isolate::Current();
4421 if (IsDeadCheck(isolate, "v8::V8::EnableSlidingStateWindow()")) return; 4421 if (IsDeadCheck(isolate, "v8::V8::EnableSlidingStateWindow()")) return;
4422 isolate->logger()->EnableSlidingStateWindow(); 4422 isolate->logger()->EnableSlidingStateWindow();
4423 } 4423 }
(...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after
5722 5722
5723 5723
5724 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 5724 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
5725 HandleScopeImplementer* thread_local = 5725 HandleScopeImplementer* thread_local =
5726 reinterpret_cast<HandleScopeImplementer*>(storage); 5726 reinterpret_cast<HandleScopeImplementer*>(storage);
5727 thread_local->IterateThis(v); 5727 thread_local->IterateThis(v);
5728 return storage + ArchiveSpacePerThread(); 5728 return storage + ArchiveSpacePerThread();
5729 } 5729 }
5730 5730
5731 } } // namespace v8::internal 5731 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698