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

Side by Side Diff: src/api.cc

Issue 238803002: Removed GetDefaultIsolate{Debugger,ForLocking,StackGuard}. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 6 years, 8 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 6504 matching lines...) Expand 10 before | Expand all | Expand 10 after
6515 reinterpret_cast<i::Isolate*>(isolate)->set_autorun_microtasks(autorun); 6515 reinterpret_cast<i::Isolate*>(isolate)->set_autorun_microtasks(autorun);
6516 } 6516 }
6517 6517
6518 6518
6519 void V8::RemoveCallCompletedCallback(CallCompletedCallback callback) { 6519 void V8::RemoveCallCompletedCallback(CallCompletedCallback callback) {
6520 i::V8::RemoveCallCompletedCallback(callback); 6520 i::V8::RemoveCallCompletedCallback(callback);
6521 } 6521 }
6522 6522
6523 6523
6524 void V8::TerminateExecution(Isolate* isolate) { 6524 void V8::TerminateExecution(Isolate* isolate) {
6525 // If no isolate is supplied, use the default isolate. 6525 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->TerminateExecution();
6526 if (isolate != NULL) {
6527 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->TerminateExecution();
6528 } else {
6529 i::Isolate::GetDefaultIsolateStackGuard()->TerminateExecution();
6530 }
6531 } 6526 }
6532 6527
6533 6528
6534 bool V8::IsExecutionTerminating(Isolate* isolate) { 6529 bool V8::IsExecutionTerminating(Isolate* isolate) {
6535 i::Isolate* i_isolate = isolate != NULL ? 6530 i::Isolate* i_isolate = isolate != NULL ?
6536 reinterpret_cast<i::Isolate*>(isolate) : i::Isolate::Current(); 6531 reinterpret_cast<i::Isolate*>(isolate) : i::Isolate::Current();
6537 return IsExecutionTerminatingCheck(i_isolate); 6532 return IsExecutionTerminatingCheck(i_isolate);
6538 } 6533 }
6539 6534
6540 6535
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
6837 i::Isolate* isolate = i::Isolate::Current(); 6832 i::Isolate* isolate = i::Isolate::Current();
6838 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener()", return false); 6833 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener()", return false);
6839 ENTER_V8(isolate); 6834 ENTER_V8(isolate);
6840 isolate->debugger()->SetEventListener(Utils::OpenHandle(*that), 6835 isolate->debugger()->SetEventListener(Utils::OpenHandle(*that),
6841 Utils::OpenHandle(*data, true)); 6836 Utils::OpenHandle(*data, true));
6842 return true; 6837 return true;
6843 } 6838 }
6844 6839
6845 6840
6846 void Debug::DebugBreak(Isolate* isolate) { 6841 void Debug::DebugBreak(Isolate* isolate) {
6847 // If no isolate is supplied, use the default isolate. 6842 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->DebugBreak();
6848 if (isolate != NULL) {
6849 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->DebugBreak();
6850 } else {
6851 i::Isolate::GetDefaultIsolateStackGuard()->DebugBreak();
6852 }
6853 } 6843 }
6854 6844
6855 6845
6856 void Debug::CancelDebugBreak(Isolate* isolate) { 6846 void Debug::CancelDebugBreak(Isolate* isolate) {
6857 // If no isolate is supplied, use the default isolate. 6847 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
6858 if (isolate != NULL) { 6848 internal_isolate->stack_guard()->Continue(i::DEBUGBREAK);
6859 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
6860 internal_isolate->stack_guard()->Continue(i::DEBUGBREAK);
6861 } else {
6862 i::Isolate::GetDefaultIsolateStackGuard()->Continue(i::DEBUGBREAK);
6863 }
6864 } 6849 }
6865 6850
6866 6851
6867 void Debug::DebugBreakForCommand(ClientData* data, Isolate* isolate) { 6852 void Debug::DebugBreakForCommand(Isolate* isolate, ClientData* data) {
6868 // If no isolate is supplied, use the default isolate. 6853 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
6869 if (isolate != NULL) { 6854 internal_isolate->debugger()->EnqueueDebugCommand(data);
6870 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
6871 internal_isolate->debugger()->EnqueueDebugCommand(data);
6872 } else {
6873 i::Isolate::GetDefaultIsolateDebugger()->EnqueueDebugCommand(data);
6874 }
6875 } 6855 }
6876 6856
6877 6857
6878 void Debug::SetMessageHandler2(v8::Debug::MessageHandler2 handler) { 6858 void Debug::SetMessageHandler2(v8::Debug::MessageHandler2 handler) {
6879 i::Isolate* isolate = i::Isolate::Current(); 6859 i::Isolate* isolate = i::Isolate::Current();
6880 EnsureInitializedForIsolate(isolate, "v8::Debug::SetMessageHandler"); 6860 EnsureInitializedForIsolate(isolate, "v8::Debug::SetMessageHandler");
6881 ENTER_V8(isolate); 6861 ENTER_V8(isolate);
6882 isolate->debugger()->SetMessageHandler(handler); 6862 isolate->debugger()->SetMessageHandler(handler);
6883 } 6863 }
6884 6864
6885 6865
6886 void Debug::SendCommand(Isolate* isolate, 6866 void Debug::SendCommand(Isolate* isolate,
6887 const uint16_t* command, 6867 const uint16_t* command,
6888 int length, 6868 int length,
6889 ClientData* client_data) { 6869 ClientData* client_data) {
6890 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); 6870 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
6891 internal_isolate->debugger()->ProcessCommand( 6871 internal_isolate->debugger()->ProcessCommand(
6892 i::Vector<const uint16_t>(command, length), client_data); 6872 i::Vector<const uint16_t>(command, length), client_data);
6893 } 6873 }
6894 6874
6895 6875
6896 void Debug::SendCommand(const uint16_t* command, int length,
6897 ClientData* client_data,
6898 Isolate* isolate) {
6899 // If no isolate is supplied, use the default isolate.
6900 if (isolate != NULL) {
6901 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
6902 internal_isolate->debugger()->ProcessCommand(
6903 i::Vector<const uint16_t>(command, length), client_data);
6904 } else {
6905 i::Isolate::GetDefaultIsolateDebugger()->ProcessCommand(
6906 i::Vector<const uint16_t>(command, length), client_data);
6907 }
6908 }
6909
6910
6911 void Debug::SetHostDispatchHandler(HostDispatchHandler handler, 6876 void Debug::SetHostDispatchHandler(HostDispatchHandler handler,
6912 int period) { 6877 int period) {
6913 i::Isolate* isolate = i::Isolate::Current(); 6878 i::Isolate* isolate = i::Isolate::Current();
6914 EnsureInitializedForIsolate(isolate, "v8::Debug::SetHostDispatchHandler"); 6879 EnsureInitializedForIsolate(isolate, "v8::Debug::SetHostDispatchHandler");
6915 ENTER_V8(isolate); 6880 ENTER_V8(isolate);
6916 isolate->debugger()->SetHostDispatchHandler( 6881 isolate->debugger()->SetHostDispatchHandler(
6917 handler, i::TimeDelta::FromMilliseconds(period)); 6882 handler, i::TimeDelta::FromMilliseconds(period));
6918 } 6883 }
6919 6884
6920 6885
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
6997 6962
6998 6963
6999 Local<Context> Debug::GetDebugContext() { 6964 Local<Context> Debug::GetDebugContext() {
7000 i::Isolate* isolate = i::Isolate::Current(); 6965 i::Isolate* isolate = i::Isolate::Current();
7001 EnsureInitializedForIsolate(isolate, "v8::Debug::GetDebugContext()"); 6966 EnsureInitializedForIsolate(isolate, "v8::Debug::GetDebugContext()");
7002 ENTER_V8(isolate); 6967 ENTER_V8(isolate);
7003 return Utils::ToLocal(i::Isolate::Current()->debugger()->GetDebugContext()); 6968 return Utils::ToLocal(i::Isolate::Current()->debugger()->GetDebugContext());
7004 } 6969 }
7005 6970
7006 6971
7007 void Debug::SetLiveEditEnabled(bool enable, Isolate* isolate) { 6972 void Debug::SetLiveEditEnabled(Isolate* isolate, bool enable) {
7008 // If no isolate is supplied, use the default isolate. 6973 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
7009 i::Debugger* debugger; 6974 internal_isolate->debugger()->set_live_edit_enabled(enable);
7010 if (isolate != NULL) {
7011 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
7012 debugger = internal_isolate->debugger();
7013 } else {
7014 debugger = i::Isolate::GetDefaultIsolateDebugger();
7015 }
7016 debugger->set_live_edit_enabled(enable);
7017 } 6975 }
7018 6976
7019 6977
7020 #endif // ENABLE_DEBUGGER_SUPPORT 6978 #endif // ENABLE_DEBUGGER_SUPPORT
7021 6979
7022 6980
7023 Handle<String> CpuProfileNode::GetFunctionName() const { 6981 Handle<String> CpuProfileNode::GetFunctionName() const {
7024 i::Isolate* isolate = i::Isolate::Current(); 6982 i::Isolate* isolate = i::Isolate::Current();
7025 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); 6983 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this);
7026 const i::CodeEntry* entry = node->entry(); 6984 const i::CodeEntry* entry = node->entry();
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
7656 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7614 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7657 Address callback_address = 7615 Address callback_address =
7658 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7616 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7659 VMState<EXTERNAL> state(isolate); 7617 VMState<EXTERNAL> state(isolate);
7660 ExternalCallbackScope call_scope(isolate, callback_address); 7618 ExternalCallbackScope call_scope(isolate, callback_address);
7661 callback(info); 7619 callback(info);
7662 } 7620 }
7663 7621
7664 7622
7665 } } // namespace v8::internal 7623 } } // namespace v8::internal
OLDNEW
« include/v8-debug.h ('K') | « include/v8-debug.h ('k') | src/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698