| 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 8809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8820 RETURN_ON_FAILED_EXECUTION(Value); | 8820 RETURN_ON_FAILED_EXECUTION(Value); |
| 8821 RETURN_ESCAPED(result); | 8821 RETURN_ESCAPED(result); |
| 8822 } | 8822 } |
| 8823 | 8823 |
| 8824 void Debug::ProcessDebugMessages(Isolate* isolate) { | 8824 void Debug::ProcessDebugMessages(Isolate* isolate) { |
| 8825 reinterpret_cast<i::Isolate*>(isolate)->debug()->ProcessDebugMessages(true); | 8825 reinterpret_cast<i::Isolate*>(isolate)->debug()->ProcessDebugMessages(true); |
| 8826 } | 8826 } |
| 8827 | 8827 |
| 8828 | 8828 |
| 8829 Local<Context> Debug::GetDebugContext(Isolate* isolate) { | 8829 Local<Context> Debug::GetDebugContext(Isolate* isolate) { |
| 8830 return debug::GetDebugContext(isolate); | 8830 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| 8831 ENTER_V8(i_isolate); |
| 8832 return Utils::ToLocal(i_isolate->debug()->GetDebugContext()); |
| 8831 } | 8833 } |
| 8832 | 8834 |
| 8833 | 8835 |
| 8834 MaybeLocal<Context> Debug::GetDebuggedContext(Isolate* isolate) { | 8836 MaybeLocal<Context> Debug::GetDebuggedContext(Isolate* isolate) { |
| 8835 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 8837 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| 8836 ENTER_V8(i_isolate); | 8838 ENTER_V8(i_isolate); |
| 8837 if (!i_isolate->debug()->in_debug_scope()) return MaybeLocal<Context>(); | 8839 if (!i_isolate->debug()->in_debug_scope()) return MaybeLocal<Context>(); |
| 8838 i::Handle<i::Object> calling = i_isolate->GetCallingNativeContext(); | 8840 i::Handle<i::Object> calling = i_isolate->GetCallingNativeContext(); |
| 8839 if (calling.is_null()) return MaybeLocal<Context>(); | 8841 if (calling.is_null()) return MaybeLocal<Context>(); |
| 8840 return Utils::ToLocal(i::Handle<i::Context>::cast(calling)); | 8842 return Utils::ToLocal(i::Handle<i::Context>::cast(calling)); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8873 i::HandleScope scope(i_isolate); | 8875 i::HandleScope scope(i_isolate); |
| 8874 i::Handle<i::Object> foreign = i_isolate->factory()->undefined_value(); | 8876 i::Handle<i::Object> foreign = i_isolate->factory()->undefined_value(); |
| 8875 if (that != NULL) { | 8877 if (that != NULL) { |
| 8876 foreign = i_isolate->factory()->NewForeign(FUNCTION_ADDR(that)); | 8878 foreign = i_isolate->factory()->NewForeign(FUNCTION_ADDR(that)); |
| 8877 } | 8879 } |
| 8878 i_isolate->debug()->SetEventListener(foreign, Utils::OpenHandle(*data, true)); | 8880 i_isolate->debug()->SetEventListener(foreign, Utils::OpenHandle(*data, true)); |
| 8879 return true; | 8881 return true; |
| 8880 } | 8882 } |
| 8881 | 8883 |
| 8882 Local<Context> debug::GetDebugContext(Isolate* isolate) { | 8884 Local<Context> debug::GetDebugContext(Isolate* isolate) { |
| 8883 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 8885 return Debug::GetDebugContext(isolate); |
| 8884 ENTER_V8(i_isolate); | |
| 8885 return Utils::ToLocal(i_isolate->debug()->GetDebugContext()); | |
| 8886 } | 8886 } |
| 8887 | 8887 |
| 8888 MaybeLocal<Value> debug::Call(Local<Context> context, | 8888 MaybeLocal<Value> debug::Call(Local<Context> context, |
| 8889 v8::Local<v8::Function> fun, | 8889 v8::Local<v8::Function> fun, |
| 8890 v8::Local<v8::Value> data) { | 8890 v8::Local<v8::Value> data) { |
| 8891 return Debug::Call(context, fun, data); | 8891 return Debug::Call(context, fun, data); |
| 8892 } | 8892 } |
| 8893 | 8893 |
| 8894 void debug::SetLiveEditEnabled(Isolate* isolate, bool enable) { | 8894 void debug::SetLiveEditEnabled(Isolate* isolate, bool enable) { |
| 8895 Debug::SetLiveEditEnabled(isolate, enable); | 8895 Debug::SetLiveEditEnabled(isolate, enable); |
| (...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9904 Address callback_address = | 9904 Address callback_address = |
| 9905 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9905 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 9906 VMState<EXTERNAL> state(isolate); | 9906 VMState<EXTERNAL> state(isolate); |
| 9907 ExternalCallbackScope call_scope(isolate, callback_address); | 9907 ExternalCallbackScope call_scope(isolate, callback_address); |
| 9908 callback(info); | 9908 callback(info); |
| 9909 } | 9909 } |
| 9910 | 9910 |
| 9911 | 9911 |
| 9912 } // namespace internal | 9912 } // namespace internal |
| 9913 } // namespace v8 | 9913 } // namespace v8 |
| OLD | NEW |