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 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 *target = MessageLocation(casted_script, pos, pos + 1); | 1044 *target = MessageLocation(casted_script, pos, pos + 1); |
1045 } | 1045 } |
1046 } | 1046 } |
1047 } | 1047 } |
1048 | 1048 |
1049 | 1049 |
1050 void Isolate::ComputeLocationFromStackTrace(MessageLocation* target, | 1050 void Isolate::ComputeLocationFromStackTrace(MessageLocation* target, |
1051 Handle<Object> exception) { | 1051 Handle<Object> exception) { |
1052 *target = MessageLocation(Handle<Script>(heap_.empty_script()), -1, -1); | 1052 *target = MessageLocation(Handle<Script>(heap_.empty_script()), -1, -1); |
1053 | 1053 |
| 1054 if (!exception->IsJSObject()) return; |
1054 Handle<Name> key = factory()->stack_trace_symbol(); | 1055 Handle<Name> key = factory()->stack_trace_symbol(); |
1055 Handle<Object> property = JSObject::GetDataProperty(exception, key); | 1056 Handle<Object> property = |
| 1057 JSObject::GetDataProperty(Handle<JSObject>::cast(exception), key); |
1056 if (!property->IsJSArray()) return; | 1058 if (!property->IsJSArray()) return; |
1057 Handle<JSArray> simple_stack_trace = Handle<JSArray>::cast(property); | 1059 Handle<JSArray> simple_stack_trace = Handle<JSArray>::cast(property); |
1058 | 1060 |
1059 Handle<FixedArray> elements(FixedArray::cast(simple_stack_trace->elements())); | 1061 Handle<FixedArray> elements(FixedArray::cast(simple_stack_trace->elements())); |
1060 int elements_limit = Smi::cast(simple_stack_trace->length())->value(); | 1062 int elements_limit = Smi::cast(simple_stack_trace->length())->value(); |
1061 | 1063 |
1062 for (int i = 1; i < elements_limit; i += 4) { | 1064 for (int i = 1; i < elements_limit; i += 4) { |
1063 Handle<JSFunction> fun = | 1065 Handle<JSFunction> fun = |
1064 handle(JSFunction::cast(elements->get(i + 1)), this); | 1066 handle(JSFunction::cast(elements->get(i + 1)), this); |
1065 if (fun->IsFromNativeScript()) continue; | 1067 if (fun->IsFromNativeScript()) continue; |
(...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2534 if (prev_ && prev_->Intercept(flag)) return true; | 2536 if (prev_ && prev_->Intercept(flag)) return true; |
2535 // Then check whether this scope intercepts. | 2537 // Then check whether this scope intercepts. |
2536 if ((flag & intercept_mask_)) { | 2538 if ((flag & intercept_mask_)) { |
2537 intercepted_flags_ |= flag; | 2539 intercepted_flags_ |= flag; |
2538 return true; | 2540 return true; |
2539 } | 2541 } |
2540 return false; | 2542 return false; |
2541 } | 2543 } |
2542 | 2544 |
2543 } } // namespace v8::internal | 2545 } } // namespace v8::internal |
OLD | NEW |