Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: src/api.cc

Issue 674423002: Get stack trace for uncaught exceptions/promise rejections from the simple stack when available. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/isolate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6942 matching lines...) Expand 10 before | Expand all | Expand 10 after
6953 6953
6954 #undef DEFINE_ERROR 6954 #undef DEFINE_ERROR
6955 6955
6956 6956
6957 Local<StackTrace> Exception::GetStackTrace(Handle<Value> exception) { 6957 Local<StackTrace> Exception::GetStackTrace(Handle<Value> exception) {
6958 i::Handle<i::Object> obj = Utils::OpenHandle(*exception); 6958 i::Handle<i::Object> obj = Utils::OpenHandle(*exception);
6959 if (!obj->IsJSObject()) return Local<StackTrace>(); 6959 if (!obj->IsJSObject()) return Local<StackTrace>();
6960 i::Handle<i::JSObject> js_obj = i::Handle<i::JSObject>::cast(obj); 6960 i::Handle<i::JSObject> js_obj = i::Handle<i::JSObject>::cast(obj);
6961 i::Isolate* isolate = js_obj->GetIsolate(); 6961 i::Isolate* isolate = js_obj->GetIsolate();
6962 ENTER_V8(isolate); 6962 ENTER_V8(isolate);
6963 i::Handle<i::Name> key = isolate->factory()->detailed_stack_trace_symbol(); 6963 return Utils::StackTraceToLocal(isolate->GetDetailedStackTrace(js_obj));
6964 i::Handle<i::Object> property = i::JSObject::GetDataProperty(js_obj, key);
6965 if (property->IsJSArray()) {
6966 return Utils::StackTraceToLocal(i::Handle<i::JSArray>::cast(property));
6967 }
6968 return Local<StackTrace>();
6969 } 6964 }
6970 6965
6971 6966
6972 // --- D e b u g S u p p o r t --- 6967 // --- D e b u g S u p p o r t ---
6973 6968
6974 bool Debug::SetDebugEventListener(EventCallback that, Handle<Value> data) { 6969 bool Debug::SetDebugEventListener(EventCallback that, Handle<Value> data) {
6975 i::Isolate* isolate = i::Isolate::Current(); 6970 i::Isolate* isolate = i::Isolate::Current();
6976 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener()", return false); 6971 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener()", return false);
6977 ENTER_V8(isolate); 6972 ENTER_V8(isolate);
6978 i::HandleScope scope(isolate); 6973 i::HandleScope scope(isolate);
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
7736 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7731 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7737 Address callback_address = 7732 Address callback_address =
7738 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7733 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7739 VMState<EXTERNAL> state(isolate); 7734 VMState<EXTERNAL> state(isolate);
7740 ExternalCallbackScope call_scope(isolate, callback_address); 7735 ExternalCallbackScope call_scope(isolate, callback_address);
7741 callback(info); 7736 callback(info);
7742 } 7737 }
7743 7738
7744 7739
7745 } } // namespace v8::internal 7740 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698