| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/api.h" | 5 #include "src/api.h" |
| 6 | 6 |
| 7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
| 8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
| 9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
| 10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
| (...skipping 6996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7007 return internal_isolate->stack_guard()->CheckDebugBreak(); | 7007 return internal_isolate->stack_guard()->CheckDebugBreak(); |
| 7008 } | 7008 } |
| 7009 | 7009 |
| 7010 | 7010 |
| 7011 void Debug::DebugBreakForCommand(Isolate* isolate, ClientData* data) { | 7011 void Debug::DebugBreakForCommand(Isolate* isolate, ClientData* data) { |
| 7012 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); | 7012 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| 7013 internal_isolate->debug()->EnqueueDebugCommand(data); | 7013 internal_isolate->debug()->EnqueueDebugCommand(data); |
| 7014 } | 7014 } |
| 7015 | 7015 |
| 7016 | 7016 |
| 7017 void Debug::BreakAndRun(Isolate* isolate, Task* task) { |
| 7018 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| 7019 internal_isolate->debug()->EnqueueEmbedderTask(task); |
| 7020 } |
| 7021 |
| 7022 |
| 7017 void Debug::SetMessageHandler(v8::Debug::MessageHandler handler) { | 7023 void Debug::SetMessageHandler(v8::Debug::MessageHandler handler) { |
| 7018 i::Isolate* isolate = i::Isolate::Current(); | 7024 i::Isolate* isolate = i::Isolate::Current(); |
| 7019 ENTER_V8(isolate); | 7025 ENTER_V8(isolate); |
| 7020 isolate->debug()->SetMessageHandler(handler); | 7026 isolate->debug()->SetMessageHandler(handler); |
| 7021 } | 7027 } |
| 7022 | 7028 |
| 7023 | 7029 |
| 7024 void Debug::SendCommand(Isolate* isolate, | 7030 void Debug::SendCommand(Isolate* isolate, |
| 7025 const uint16_t* command, | 7031 const uint16_t* command, |
| 7026 int length, | 7032 int length, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7074 v8::Handle<v8::Value> argv[kArgc] = { obj }; | 7080 v8::Handle<v8::Value> argv[kArgc] = { obj }; |
| 7075 result = v8_fun->Call(Utils::ToLocal(debug), kArgc, argv); | 7081 result = v8_fun->Call(Utils::ToLocal(debug), kArgc, argv); |
| 7076 has_pending_exception = result.IsEmpty(); | 7082 has_pending_exception = result.IsEmpty(); |
| 7077 } | 7083 } |
| 7078 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>()); | 7084 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>()); |
| 7079 return scope.Escape(result); | 7085 return scope.Escape(result); |
| 7080 } | 7086 } |
| 7081 | 7087 |
| 7082 | 7088 |
| 7083 void Debug::ProcessDebugMessages() { | 7089 void Debug::ProcessDebugMessages() { |
| 7084 i::Isolate::Current()->debug()->ProcessDebugMessages(true); | 7090 i::Debug* isolate_debug = i::Isolate::Current()->debug(); |
| 7091 isolate_debug->ProcessEmbedderTasks(); |
| 7092 isolate_debug->ProcessDebugMessages(true); |
| 7085 } | 7093 } |
| 7086 | 7094 |
| 7087 | 7095 |
| 7088 Local<Context> Debug::GetDebugContext() { | 7096 Local<Context> Debug::GetDebugContext() { |
| 7089 i::Isolate* isolate = i::Isolate::Current(); | 7097 i::Isolate* isolate = i::Isolate::Current(); |
| 7090 ENTER_V8(isolate); | 7098 ENTER_V8(isolate); |
| 7091 return Utils::ToLocal(i::Isolate::Current()->debug()->GetDebugContext()); | 7099 return Utils::ToLocal(i::Isolate::Current()->debug()->GetDebugContext()); |
| 7092 } | 7100 } |
| 7093 | 7101 |
| 7094 | 7102 |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7754 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7762 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7755 Address callback_address = | 7763 Address callback_address = |
| 7756 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7764 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7757 VMState<EXTERNAL> state(isolate); | 7765 VMState<EXTERNAL> state(isolate); |
| 7758 ExternalCallbackScope call_scope(isolate, callback_address); | 7766 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7759 callback(info); | 7767 callback(info); |
| 7760 } | 7768 } |
| 7761 | 7769 |
| 7762 | 7770 |
| 7763 } } // namespace v8::internal | 7771 } } // namespace v8::internal |
| OLD | NEW |