| 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 8907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8918 } | 8918 } |
| 8919 Local<Value> result; | 8919 Local<Value> result; |
| 8920 has_pending_exception = | 8920 has_pending_exception = |
| 8921 !ToLocal<Value>(isolate->debug()->Call(Utils::OpenHandle(*fun), data_obj), | 8921 !ToLocal<Value>(isolate->debug()->Call(Utils::OpenHandle(*fun), data_obj), |
| 8922 &result); | 8922 &result); |
| 8923 RETURN_ON_FAILED_EXECUTION(Value); | 8923 RETURN_ON_FAILED_EXECUTION(Value); |
| 8924 RETURN_ESCAPED(result); | 8924 RETURN_ESCAPED(result); |
| 8925 } | 8925 } |
| 8926 | 8926 |
| 8927 | 8927 |
| 8928 MaybeLocal<Value> Debug::GetMirror(Local<Context> context, | |
| 8929 v8::Local<v8::Value> obj) { | |
| 8930 PREPARE_FOR_EXECUTION(context, Debug, GetMirror, Value); | |
| 8931 i::Debug* isolate_debug = isolate->debug(); | |
| 8932 has_pending_exception = !isolate_debug->Load(); | |
| 8933 RETURN_ON_FAILED_EXECUTION(Value); | |
| 8934 i::Handle<i::JSObject> debug(isolate_debug->debug_context()->global_object()); | |
| 8935 auto name = isolate->factory()->NewStringFromStaticChars("MakeMirror"); | |
| 8936 auto fun_obj = i::JSReceiver::GetProperty(debug, name).ToHandleChecked(); | |
| 8937 auto v8_fun = Utils::CallableToLocal(i::Handle<i::JSFunction>::cast(fun_obj)); | |
| 8938 const int kArgc = 1; | |
| 8939 v8::Local<v8::Value> argv[kArgc] = {obj}; | |
| 8940 Local<Value> result; | |
| 8941 has_pending_exception = | |
| 8942 !v8_fun->Call(context, Utils::ToLocal(debug), kArgc, argv) | |
| 8943 .ToLocal(&result); | |
| 8944 RETURN_ON_FAILED_EXECUTION(Value); | |
| 8945 RETURN_ESCAPED(result); | |
| 8946 } | |
| 8947 | |
| 8948 void Debug::ProcessDebugMessages(Isolate* isolate) {} | 8928 void Debug::ProcessDebugMessages(Isolate* isolate) {} |
| 8949 | 8929 |
| 8950 Local<Context> Debug::GetDebugContext(Isolate* isolate) { | 8930 Local<Context> Debug::GetDebugContext(Isolate* isolate) { |
| 8951 return debug::GetDebugContext(isolate); | 8931 return debug::GetDebugContext(isolate); |
| 8952 } | 8932 } |
| 8953 | 8933 |
| 8954 | 8934 |
| 8955 MaybeLocal<Context> Debug::GetDebuggedContext(Isolate* isolate) { | 8935 MaybeLocal<Context> Debug::GetDebuggedContext(Isolate* isolate) { |
| 8956 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 8936 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| 8957 ENTER_V8(i_isolate); | 8937 ENTER_V8(i_isolate); |
| (...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10055 Address callback_address = | 10035 Address callback_address = |
| 10056 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10036 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 10057 VMState<EXTERNAL> state(isolate); | 10037 VMState<EXTERNAL> state(isolate); |
| 10058 ExternalCallbackScope call_scope(isolate, callback_address); | 10038 ExternalCallbackScope call_scope(isolate, callback_address); |
| 10059 callback(info); | 10039 callback(info); |
| 10060 } | 10040 } |
| 10061 | 10041 |
| 10062 | 10042 |
| 10063 } // namespace internal | 10043 } // namespace internal |
| 10064 } // namespace v8 | 10044 } // namespace v8 |
| OLD | NEW |