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

Side by Side Diff: src/api.cc

Issue 24220003: Remove default isolate usage from almost all tests (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 5406 matching lines...) Expand 10 before | Expand all | Expand 10 after
5417 // Leave V8. 5417 // Leave V8.
5418 5418
5419 return env; 5419 return env;
5420 } 5420 }
5421 5421
5422 Local<Context> v8::Context::New( 5422 Local<Context> v8::Context::New(
5423 v8::Isolate* external_isolate, 5423 v8::Isolate* external_isolate,
5424 v8::ExtensionConfiguration* extensions, 5424 v8::ExtensionConfiguration* extensions,
5425 v8::Handle<ObjectTemplate> global_template, 5425 v8::Handle<ObjectTemplate> global_template,
5426 v8::Handle<Value> global_object) { 5426 v8::Handle<Value> global_object) {
5427 i::Isolate::EnsureDefaultIsolate();
Sven Panne 2013/09/19 06:42:36 Let's hope that there are no arcane assumptions in
5428 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate); 5427 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate);
5429 EnsureInitializedForIsolate(isolate, "v8::Context::New()"); 5428 EnsureInitializedForIsolate(isolate, "v8::Context::New()");
5430 LOG_API(isolate, "Context::New"); 5429 LOG_API(isolate, "Context::New");
5431 ON_BAILOUT(isolate, "v8::Context::New()", return Local<Context>()); 5430 ON_BAILOUT(isolate, "v8::Context::New()", return Local<Context>());
5432 i::HandleScope scope(isolate); 5431 i::HandleScope scope(isolate);
5433 i::Handle<i::Context> env = 5432 i::Handle<i::Context> env =
5434 CreateEnvironment(isolate, extensions, global_template, global_object); 5433 CreateEnvironment(isolate, extensions, global_template, global_object);
5435 if (env.is_null()) return Local<Context>(); 5434 if (env.is_null()) return Local<Context>();
5436 return Utils::ToLocal(scope.CloseAndEscape(env)); 5435 return Utils::ToLocal(scope.CloseAndEscape(env));
5437 } 5436 }
(...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after
6761 void V8::RemoveMemoryAllocationCallback(MemoryAllocationCallback callback) { 6760 void V8::RemoveMemoryAllocationCallback(MemoryAllocationCallback callback) {
6762 i::Isolate* isolate = i::Isolate::Current(); 6761 i::Isolate* isolate = i::Isolate::Current();
6763 if (IsDeadCheck(isolate, "v8::V8::RemoveMemoryAllocationCallback()")) return; 6762 if (IsDeadCheck(isolate, "v8::V8::RemoveMemoryAllocationCallback()")) return;
6764 isolate->memory_allocator()->RemoveMemoryAllocationCallback( 6763 isolate->memory_allocator()->RemoveMemoryAllocationCallback(
6765 callback); 6764 callback);
6766 } 6765 }
6767 6766
6768 6767
6769 void V8::AddCallCompletedCallback(CallCompletedCallback callback) { 6768 void V8::AddCallCompletedCallback(CallCompletedCallback callback) {
6770 if (callback == NULL) return; 6769 if (callback == NULL) return;
6771 i::Isolate::EnsureDefaultIsolate();
6772 i::Isolate* isolate = i::Isolate::Current(); 6770 i::Isolate* isolate = i::Isolate::Current();
6773 if (IsDeadCheck(isolate, "v8::V8::AddLeaveScriptCallback()")) return; 6771 if (IsDeadCheck(isolate, "v8::V8::AddLeaveScriptCallback()")) return;
6774 i::V8::AddCallCompletedCallback(callback); 6772 i::V8::AddCallCompletedCallback(callback);
6775 } 6773 }
6776 6774
6777 6775
6778 void V8::RemoveCallCompletedCallback(CallCompletedCallback callback) { 6776 void V8::RemoveCallCompletedCallback(CallCompletedCallback callback) {
6779 i::Isolate::EnsureDefaultIsolate();
6780 i::Isolate* isolate = i::Isolate::Current(); 6777 i::Isolate* isolate = i::Isolate::Current();
6781 if (IsDeadCheck(isolate, "v8::V8::RemoveLeaveScriptCallback()")) return; 6778 if (IsDeadCheck(isolate, "v8::V8::RemoveLeaveScriptCallback()")) return;
6782 i::V8::RemoveCallCompletedCallback(callback); 6779 i::V8::RemoveCallCompletedCallback(callback);
6783 } 6780 }
6784 6781
6785 6782
6786 void V8::TerminateExecution(Isolate* isolate) { 6783 void V8::TerminateExecution(Isolate* isolate) {
6787 // If no isolate is supplied, use the default isolate. 6784 // If no isolate is supplied, use the default isolate.
6788 if (isolate != NULL) { 6785 if (isolate != NULL) {
6789 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->TerminateExecution(); 6786 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->TerminateExecution();
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
7076 7073
7077 7074
7078 void Debug::SetMessageHandler2(v8::Debug::MessageHandler2 handler) { 7075 void Debug::SetMessageHandler2(v8::Debug::MessageHandler2 handler) {
7079 i::Isolate* isolate = i::Isolate::Current(); 7076 i::Isolate* isolate = i::Isolate::Current();
7080 EnsureInitializedForIsolate(isolate, "v8::Debug::SetMessageHandler"); 7077 EnsureInitializedForIsolate(isolate, "v8::Debug::SetMessageHandler");
7081 ENTER_V8(isolate); 7078 ENTER_V8(isolate);
7082 isolate->debugger()->SetMessageHandler(handler); 7079 isolate->debugger()->SetMessageHandler(handler);
7083 } 7080 }
7084 7081
7085 7082
7083 void Debug::SendCommand(Isolate* isolate,
7084 const uint16_t* command,
7085 int length,
7086 ClientData* client_data) {
7087 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
7088 internal_isolate->debugger()->ProcessCommand(
7089 i::Vector<const uint16_t>(command, length), client_data);
7090 }
7091
7092
7086 void Debug::SendCommand(const uint16_t* command, int length, 7093 void Debug::SendCommand(const uint16_t* command, int length,
7087 ClientData* client_data, 7094 ClientData* client_data,
7088 Isolate* isolate) { 7095 Isolate* isolate) {
7089 // If no isolate is supplied, use the default isolate. 7096 // If no isolate is supplied, use the default isolate.
7090 if (isolate != NULL) { 7097 if (isolate != NULL) {
7091 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); 7098 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
7092 internal_isolate->debugger()->ProcessCommand( 7099 internal_isolate->debugger()->ProcessCommand(
7093 i::Vector<const uint16_t>(command, length), client_data); 7100 i::Vector<const uint16_t>(command, length), client_data);
7094 } else { 7101 } else {
7095 i::Isolate::GetDefaultIsolateDebugger()->ProcessCommand( 7102 i::Isolate::GetDefaultIsolateDebugger()->ProcessCommand(
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
7885 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7892 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7886 Address callback_address = 7893 Address callback_address =
7887 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7894 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7888 VMState<EXTERNAL> state(isolate); 7895 VMState<EXTERNAL> state(isolate);
7889 ExternalCallbackScope call_scope(isolate, callback_address); 7896 ExternalCallbackScope call_scope(isolate, callback_address);
7890 callback(info); 7897 callback(info);
7891 } 7898 }
7892 7899
7893 7900
7894 } } // namespace v8::internal 7901 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-debug.h ('k') | src/isolate.h » ('j') | test/cctest/test-debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698