| 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 | 6 |
| 7 #include <fstream> // NOLINT(readability/streams) | 7 #include <fstream> // NOLINT(readability/streams) |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "src/v8.h" | 10 #include "src/v8.h" |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 if (!(*seen_caller)) return false; | 313 if (!(*seen_caller)) return false; |
| 314 // Also, skip non-visible built-in functions and any call with the builtins | 314 // Also, skip non-visible built-in functions and any call with the builtins |
| 315 // object as receiver, so as to not reveal either the builtins object or | 315 // object as receiver, so as to not reveal either the builtins object or |
| 316 // an internal function. | 316 // an internal function. |
| 317 // The --builtins-in-stack-traces command line flag allows including | 317 // The --builtins-in-stack-traces command line flag allows including |
| 318 // internal call sites in the stack trace for debugging purposes. | 318 // internal call sites in the stack trace for debugging purposes. |
| 319 if (!FLAG_builtins_in_stack_traces) { | 319 if (!FLAG_builtins_in_stack_traces) { |
| 320 if (receiver->IsJSBuiltinsObject()) return false; | 320 if (receiver->IsJSBuiltinsObject()) return false; |
| 321 if (fun->IsBuiltin()) { | 321 if (fun->IsBuiltin()) { |
| 322 return fun->shared()->native(); | 322 return fun->shared()->native(); |
| 323 } else if (fun->IsFromNativeScript() || fun->IsFromExtensionScript()) { | 323 } else if (!fun->IsSubjectToDebugging()) { |
| 324 return false; | 324 return false; |
| 325 } | 325 } |
| 326 } | 326 } |
| 327 return true; | 327 return true; |
| 328 } | 328 } |
| 329 | 329 |
| 330 | 330 |
| 331 Handle<Object> Isolate::CaptureSimpleStackTrace(Handle<JSObject> error_object, | 331 Handle<Object> Isolate::CaptureSimpleStackTrace(Handle<JSObject> error_object, |
| 332 Handle<Object> caller) { | 332 Handle<Object> caller) { |
| 333 // Get stack trace limit. | 333 // Get stack trace limit. |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1317 JSReceiver::GetDataProperty(Handle<JSObject>::cast(exception), key); | 1317 JSReceiver::GetDataProperty(Handle<JSObject>::cast(exception), key); |
| 1318 if (!property->IsJSArray()) return false; | 1318 if (!property->IsJSArray()) return false; |
| 1319 Handle<JSArray> simple_stack_trace = Handle<JSArray>::cast(property); | 1319 Handle<JSArray> simple_stack_trace = Handle<JSArray>::cast(property); |
| 1320 | 1320 |
| 1321 Handle<FixedArray> elements(FixedArray::cast(simple_stack_trace->elements())); | 1321 Handle<FixedArray> elements(FixedArray::cast(simple_stack_trace->elements())); |
| 1322 int elements_limit = Smi::cast(simple_stack_trace->length())->value(); | 1322 int elements_limit = Smi::cast(simple_stack_trace->length())->value(); |
| 1323 | 1323 |
| 1324 for (int i = 1; i < elements_limit; i += 4) { | 1324 for (int i = 1; i < elements_limit; i += 4) { |
| 1325 Handle<JSFunction> fun = | 1325 Handle<JSFunction> fun = |
| 1326 handle(JSFunction::cast(elements->get(i + 1)), this); | 1326 handle(JSFunction::cast(elements->get(i + 1)), this); |
| 1327 if (fun->IsFromNativeScript()) continue; | 1327 if (!fun->IsSubjectToDebugging()) continue; |
| 1328 | 1328 |
| 1329 Object* script = fun->shared()->script(); | 1329 Object* script = fun->shared()->script(); |
| 1330 if (script->IsScript() && | 1330 if (script->IsScript() && |
| 1331 !(Script::cast(script)->source()->IsUndefined())) { | 1331 !(Script::cast(script)->source()->IsUndefined())) { |
| 1332 int pos = PositionFromStackTrace(elements, i); | 1332 int pos = PositionFromStackTrace(elements, i); |
| 1333 Handle<Script> casted_script(Script::cast(script)); | 1333 Handle<Script> casted_script(Script::cast(script)); |
| 1334 *target = MessageLocation(casted_script, pos, pos + 1); | 1334 *target = MessageLocation(casted_script, pos, pos + 1); |
| 1335 return true; | 1335 return true; |
| 1336 } | 1336 } |
| 1337 } | 1337 } |
| (...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2801 // Then check whether this scope intercepts. | 2801 // Then check whether this scope intercepts. |
| 2802 if ((flag & intercept_mask_)) { | 2802 if ((flag & intercept_mask_)) { |
| 2803 intercepted_flags_ |= flag; | 2803 intercepted_flags_ |= flag; |
| 2804 return true; | 2804 return true; |
| 2805 } | 2805 } |
| 2806 return false; | 2806 return false; |
| 2807 } | 2807 } |
| 2808 | 2808 |
| 2809 } // namespace internal | 2809 } // namespace internal |
| 2810 } // namespace v8 | 2810 } // namespace v8 |
| OLD | NEW |