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 "api.h" | 5 #include "api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #include <cmath> // For isnan. | 8 #include <cmath> // For isnan. |
9 #include "../include/v8-debug.h" | 9 #include "../include/v8-debug.h" |
10 #include "../include/v8-profiler.h" | 10 #include "../include/v8-profiler.h" |
(...skipping 2097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2108 return Utils::ToLocal(Utils::OpenHandle(this)); | 2108 return Utils::ToLocal(Utils::OpenHandle(this)); |
2109 } | 2109 } |
2110 | 2110 |
2111 | 2111 |
2112 Local<StackTrace> StackTrace::CurrentStackTrace( | 2112 Local<StackTrace> StackTrace::CurrentStackTrace( |
2113 Isolate* isolate, | 2113 Isolate* isolate, |
2114 int frame_limit, | 2114 int frame_limit, |
2115 StackTraceOptions options) { | 2115 StackTraceOptions options) { |
2116 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 2116 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
2117 ENTER_V8(i_isolate); | 2117 ENTER_V8(i_isolate); |
| 2118 // TODO(dcarney): remove when ScriptDebugServer is fixed. |
| 2119 options = static_cast<StackTraceOptions>( |
| 2120 static_cast<int>(options) | kExposeFramesAcrossSecurityOrigins); |
2118 i::Handle<i::JSArray> stackTrace = | 2121 i::Handle<i::JSArray> stackTrace = |
2119 i_isolate->CaptureCurrentStackTrace(frame_limit, options); | 2122 i_isolate->CaptureCurrentStackTrace(frame_limit, options); |
2120 return Utils::StackTraceToLocal(stackTrace); | 2123 return Utils::StackTraceToLocal(stackTrace); |
2121 } | 2124 } |
2122 | 2125 |
2123 | 2126 |
2124 // --- S t a c k F r a m e --- | 2127 // --- S t a c k F r a m e --- |
2125 | 2128 |
2126 int StackFrame::GetLineNumber() const { | 2129 int StackFrame::GetLineNumber() const { |
2127 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 2130 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
(...skipping 5410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7538 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7541 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7539 Address callback_address = | 7542 Address callback_address = |
7540 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7543 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7541 VMState<EXTERNAL> state(isolate); | 7544 VMState<EXTERNAL> state(isolate); |
7542 ExternalCallbackScope call_scope(isolate, callback_address); | 7545 ExternalCallbackScope call_scope(isolate, callback_address); |
7543 callback(info); | 7546 callback(info); |
7544 } | 7547 } |
7545 | 7548 |
7546 | 7549 |
7547 } } // namespace v8::internal | 7550 } } // namespace v8::internal |
OLD | NEW |