Home | History | Annotate | Download | only in src

Lines Matching refs:v8

1 // Copyright 2012 the V8 project authors. All rights reserved.
28 #include "v8.h"
51 #include "../include/v8-debug.h"
53 namespace v8 {
77 static void PrintLn(v8::Local<v8::Value> value) {
78 v8::Local<v8::String> s = value->ToString();
81 V8::FatalProcessOutOfMemory("PrintLn");
95 static v8::Handle<v8::Context> GetDebugEventContext(Isolate* isolate) {
99 if (context.is_null()) return v8::Local<v8::Context>();
101 return v8::Utils::ToLocal(global_context);
662 void ScriptCache::HandleWeakScript(v8::Persistent<v8::Value> obj, void* data) {
695 void Debug::HandleWeakDebugInfo(v8::Persistent<v8::Value> obj, void* data) {
820 v8::Handle<ObjectTemplate>(),
2481 if (!Debugger::EventActive(v8::Exception)) return;
2513 ProcessDebugEvent(v8::Exception, Handle<JSObject>::cast(event_data), false);
2526 if (!Debugger::EventActive(v8::Break)) return;
2545 ProcessDebugEvent(v8::Break,
2557 if (!EventActive(v8::BeforeCompile)) return;
2572 ProcessDebugEvent(v8::BeforeCompile,
2631 if (!Debugger::EventActive(v8::AfterCompile)) return;
2642 ProcessDebugEvent(v8::AfterCompile,
2653 if (!Debugger::EventActive(v8::ScriptCollected)) return;
2669 ProcessDebugEvent(v8::ScriptCollected,
2675 void Debugger::ProcessDebugEvent(v8::DebugEvent event,
2699 // a JavaScript function. Don't call event listener for v8::Break
2701 if ((event != v8::Break || !auto_continue) && !event_listener_.is_null()) {
2705 if (event == v8::Break) {
2709 CallEventCallback(v8::BreakForCommand,
2720 void Debugger::CallEventCallback(v8::DebugEvent event,
2723 v8::Debug::ClientData* client_data) {
2732 void Debugger::CallCEventCallback(v8::DebugEvent event,
2735 v8::Debug::ClientData* client_data) {
2737 v8::Debug::EventCallback2 callback =
2738 FUNCTION_CAST<v8::Debug::EventCallback2>(
2750 void Debugger::CallJSEventCallback(v8::DebugEvent event,
2794 void Debugger::NotifyMessageHandler(v8::DebugEvent event,
2805 case v8::Break:
2806 case v8::BreakForCommand:
2809 case v8::Exception:
2812 case v8::BeforeCompile:
2814 case v8::AfterCompile:
2817 case v8::ScriptCollected:
2820 case v8::NewFunction:
2847 if ((auto_continue && !HasCommands()) || event == v8::ScriptCollected) {
2851 v8::TryCatch try_catch;
2854 v8::Local<v8::Object> cmd_processor;
2856 v8::Local<v8::Object> api_exec_state =
2857 v8::Utils::ToLocal(Handle<JSObject>::cast(exec_state));
2858 v8::Local<v8::String> fun_name =
2859 v8::String::New("debugCommandProcessor");
2860 v8::Local<v8::Function> fun =
2861 v8::Function::Cast(*api_exec_state->Get(fun_name));
2863 v8::Handle<v8::Boolean> running =
2864 auto_continue ? v8::True() : v8::False();
2866 v8::Handle<Value> argv[kArgc] = { running };
2867 cmd_processor = v8::Object::Cast(*fun->Call(api_exec_state, kArgc, argv));
2902 v8::Local<v8::String> fun_name;
2903 v8::Local<v8::Function> fun;
2904 v8::Local<v8::Value> request;
2905 v8::TryCatch try_catch;
2906 fun_name = v8::String::New("processDebugRequest");
2907 fun = v8::Function::Cast(*cmd_processor->Get(fun_name));
2909 request = v8::String::New(command.text().start(),
2912 v8::Handle<Value> argv[kArgc] = { request };
2913 v8::Local<v8::Value> response_val = fun->Call(cmd_processor, kArgc, argv);
2916 v8::Local<v8::String> response;
2920 response = v8::String::Cast(*response_val);
2922 response = v8::String::New("");
2932 fun_name = v8::String::New("isRunning");
2933 fun = v8::Function::Cast(*cmd_processor->Get(fun_name));
2935 v8::Handle<Value> argv[kArgc] = { response };
2936 v8::Local<v8::Value> running_val = fun->Call(cmd_processor, kArgc, argv);
3000 void Debugger::SetMessageHandler(v8::Debug::MessageHandler2 handler) {
3023 // Schedule this for later, because we may be in non-V8 thread.
3029 void Debugger::SetHostDispatchHandler(v8::Debug::HostDispatchHandler handler,
3037 v8::Debug::DebugMessageDispatchHandler handler, bool provide_locker) {
3064 v8::Debug::ClientData* client_data) {
3098 void Debugger::EnqueueDebugCommand(v8::Debug::ClientData* client_data) {
3148 static void StubMessageHandler2(const v8::Debug::Message& message) {
3157 // Suspend V8 if it is already running or set V8 to suspend whenever
3159 // Provide stub message handler; V8 auto-continues each suspend
3161 // Once become suspended, V8 will stay so indefinitely long, until remote
3164 v8::Debug::DebugBreak();
3198 v8::Debug::DebugMessageDispatchHandler handler;
3255 // JavaScript. This can happen if the v8::Debug::Call is used in which
3312 v8::Debug::ClientData* client_data) {
3325 v8::Debug::ClientData* client_data)
3355 v8::Handle<v8::Object> MessageImpl::GetExecutionState() const {
3356 return v8::Utils::ToLocal(exec_state_);
3360 v8::Handle<v8::Object> MessageImpl::GetEventData() const {
3361 return v8::Utils::ToLocal(event_data_);
3365 v8::Handle<v8::String> MessageImpl::GetJSON() const {
3366 v8::HandleScope scope;
3372 return v8::Handle<v8::String>();
3379 return v8::Handle<v8::String>();
3381 return scope.Close(v8::Utils::ToLocal(Handle<String>::cast(json)));
3383 return v8::Utils::ToLocal(response_json_);
3388 v8::Handle<v8::Context> MessageImpl::GetEventContext() const {
3390 v8::Handle<v8::Context> context = GetDebugEventContext(isolate);
3392 ASSERT(!context.IsEmpty() || event_ == v8::ScriptCollected);
3397 v8::Debug::ClientData* MessageImpl::GetClientData() const {
3406 v8::Debug::ClientData* client_data)
3419 v8::Handle<v8::Object> EventDetailsImpl::GetExecutionState() const {
3420 return v8
3424 v8::Handle<v8::Object> EventDetailsImpl::GetEventData() const {
3425 return v8::Utils::ToLocal(event_data_);
3429 v8::Handle<v8::Context> EventDetailsImpl::GetEventContext() const {
3434 v8::Handle<v8::Value> EventDetailsImpl::GetCallbackData() const {
3435 return v8::Utils::ToLocal(callback_data_);
3439 v8::Debug::ClientData* EventDetailsImpl::GetClientData() const {
3450 v8::Debug::ClientData* data)
3468 v8::Debug::ClientData* data) {
3558 : Thread("v8:MsgDispHelpr"),
3598 } } // namespace v8::internal