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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 StackTraceFrameIterator it(this); | 1056 StackTraceFrameIterator it(this); |
1057 if (!it.done()) { | 1057 if (!it.done()) { |
1058 JavaScriptFrame* frame = it.frame(); | 1058 JavaScriptFrame* frame = it.frame(); |
1059 JSFunction* fun = frame->function(); | 1059 JSFunction* fun = frame->function(); |
1060 Object* script = fun->shared()->script(); | 1060 Object* script = fun->shared()->script(); |
1061 if (script->IsScript() && | 1061 if (script->IsScript() && |
1062 !(Script::cast(script)->source()->IsUndefined())) { | 1062 !(Script::cast(script)->source()->IsUndefined())) { |
1063 int pos = frame->LookupCode()->SourcePosition(frame->pc()); | 1063 int pos = frame->LookupCode()->SourcePosition(frame->pc()); |
1064 // Compute the location from the function and the reloc info. | 1064 // Compute the location from the function and the reloc info. |
1065 Handle<Script> casted_script(Script::cast(script)); | 1065 Handle<Script> casted_script(Script::cast(script)); |
1066 *target = MessageLocation(casted_script, pos, pos + 1); | 1066 *target = MessageLocation(casted_script, pos, pos + 1, handle(fun)); |
1067 } | 1067 } |
1068 } | 1068 } |
1069 } | 1069 } |
1070 | 1070 |
1071 | 1071 |
1072 bool Isolate::ComputeLocationFromStackTrace(MessageLocation* target, | 1072 bool Isolate::ComputeLocationFromStackTrace(MessageLocation* target, |
1073 Handle<Object> exception) { | 1073 Handle<Object> exception) { |
1074 *target = MessageLocation(Handle<Script>(heap_.empty_script()), -1, -1); | 1074 *target = MessageLocation(Handle<Script>(heap_.empty_script()), -1, -1); |
1075 | 1075 |
1076 if (!exception->IsJSObject()) return false; | 1076 if (!exception->IsJSObject()) return false; |
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2569 if (prev_ && prev_->Intercept(flag)) return true; | 2569 if (prev_ && prev_->Intercept(flag)) return true; |
2570 // Then check whether this scope intercepts. | 2570 // Then check whether this scope intercepts. |
2571 if ((flag & intercept_mask_)) { | 2571 if ((flag & intercept_mask_)) { |
2572 intercepted_flags_ |= flag; | 2572 intercepted_flags_ |= flag; |
2573 return true; | 2573 return true; |
2574 } | 2574 } |
2575 return false; | 2575 return false; |
2576 } | 2576 } |
2577 | 2577 |
2578 } } // namespace v8::internal | 2578 } } // namespace v8::internal |
OLD | NEW |