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 6971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6982 | 6982 |
6983 #undef DEFINE_ERROR | 6983 #undef DEFINE_ERROR |
6984 | 6984 |
6985 | 6985 |
6986 Local<StackTrace> Exception::GetStackTrace(Handle<Value> exception) { | 6986 Local<StackTrace> Exception::GetStackTrace(Handle<Value> exception) { |
6987 i::Handle<i::Object> obj = Utils::OpenHandle(*exception); | 6987 i::Handle<i::Object> obj = Utils::OpenHandle(*exception); |
6988 if (!obj->IsJSObject()) return Local<StackTrace>(); | 6988 if (!obj->IsJSObject()) return Local<StackTrace>(); |
6989 i::Handle<i::JSObject> js_obj = i::Handle<i::JSObject>::cast(obj); | 6989 i::Handle<i::JSObject> js_obj = i::Handle<i::JSObject>::cast(obj); |
6990 i::Isolate* isolate = js_obj->GetIsolate(); | 6990 i::Isolate* isolate = js_obj->GetIsolate(); |
6991 ENTER_V8(isolate); | 6991 ENTER_V8(isolate); |
6992 i::Handle<i::Name> key = isolate->factory()->detailed_stack_trace_symbol(); | 6992 return Utils::StackTraceToLocal(isolate->GetDetailedStackTrace(js_obj)); |
6993 i::Handle<i::Object> property = i::JSObject::GetDataProperty(js_obj, key); | |
6994 if (property->IsJSArray()) { | |
6995 return Utils::StackTraceToLocal(i::Handle<i::JSArray>::cast(property)); | |
6996 } | |
6997 return Local<StackTrace>(); | |
6998 } | 6993 } |
6999 | 6994 |
7000 | 6995 |
7001 // --- D e b u g S u p p o r t --- | 6996 // --- D e b u g S u p p o r t --- |
7002 | 6997 |
7003 bool Debug::SetDebugEventListener(EventCallback that, Handle<Value> data) { | 6998 bool Debug::SetDebugEventListener(EventCallback that, Handle<Value> data) { |
7004 i::Isolate* isolate = i::Isolate::Current(); | 6999 i::Isolate* isolate = i::Isolate::Current(); |
7005 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener()", return false); | 7000 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener()", return false); |
7006 ENTER_V8(isolate); | 7001 ENTER_V8(isolate); |
7007 i::HandleScope scope(isolate); | 7002 i::HandleScope scope(isolate); |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7765 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7760 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7766 Address callback_address = | 7761 Address callback_address = |
7767 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7762 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7768 VMState<EXTERNAL> state(isolate); | 7763 VMState<EXTERNAL> state(isolate); |
7769 ExternalCallbackScope call_scope(isolate, callback_address); | 7764 ExternalCallbackScope call_scope(isolate, callback_address); |
7770 callback(info); | 7765 callback(info); |
7771 } | 7766 } |
7772 | 7767 |
7773 | 7768 |
7774 } } // namespace v8::internal | 7769 } } // namespace v8::internal |
OLD | NEW |