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 "src/frames.h" | 5 #include "src/frames.h" |
6 | 6 |
| 7 #include <memory> |
7 #include <sstream> | 8 #include <sstream> |
8 | 9 |
9 #include "src/ast/ast.h" | 10 #include "src/ast/ast.h" |
10 #include "src/ast/scopeinfo.h" | 11 #include "src/ast/scopeinfo.h" |
11 #include "src/base/bits.h" | 12 #include "src/base/bits.h" |
12 #include "src/deoptimizer.h" | 13 #include "src/deoptimizer.h" |
13 #include "src/frames-inl.h" | 14 #include "src/frames-inl.h" |
14 #include "src/full-codegen/full-codegen.h" | 15 #include "src/full-codegen/full-codegen.h" |
15 #include "src/register-configuration.h" | 16 #include "src/register-configuration.h" |
16 #include "src/safepoint-table.h" | 17 #include "src/safepoint-table.h" |
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 if (print_line_number) { | 999 if (print_line_number) { |
999 SharedFunctionInfo* shared = function->shared(); | 1000 SharedFunctionInfo* shared = function->shared(); |
1000 int source_pos = AbstractCode::cast(code)->SourcePosition(code_offset); | 1001 int source_pos = AbstractCode::cast(code)->SourcePosition(code_offset); |
1001 Object* maybe_script = shared->script(); | 1002 Object* maybe_script = shared->script(); |
1002 if (maybe_script->IsScript()) { | 1003 if (maybe_script->IsScript()) { |
1003 Script* script = Script::cast(maybe_script); | 1004 Script* script = Script::cast(maybe_script); |
1004 int line = script->GetLineNumber(source_pos) + 1; | 1005 int line = script->GetLineNumber(source_pos) + 1; |
1005 Object* script_name_raw = script->name(); | 1006 Object* script_name_raw = script->name(); |
1006 if (script_name_raw->IsString()) { | 1007 if (script_name_raw->IsString()) { |
1007 String* script_name = String::cast(script->name()); | 1008 String* script_name = String::cast(script->name()); |
1008 base::SmartArrayPointer<char> c_script_name = | 1009 std::unique_ptr<char[]> c_script_name = |
1009 script_name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 1010 script_name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
1010 PrintF(file, " at %s:%d", c_script_name.get(), line); | 1011 PrintF(file, " at %s:%d", c_script_name.get(), line); |
1011 } else { | 1012 } else { |
1012 PrintF(file, " at <unknown>:%d", line); | 1013 PrintF(file, " at <unknown>:%d", line); |
1013 } | 1014 } |
1014 } else { | 1015 } else { |
1015 PrintF(file, " at <unknown>:<unknown>"); | 1016 PrintF(file, " at <unknown>:<unknown>"); |
1016 } | 1017 } |
1017 } | 1018 } |
1018 } | 1019 } |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1909 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1910 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1910 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1911 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1911 list.Add(frame, zone); | 1912 list.Add(frame, zone); |
1912 } | 1913 } |
1913 return list.ToVector(); | 1914 return list.ToVector(); |
1914 } | 1915 } |
1915 | 1916 |
1916 | 1917 |
1917 } // namespace internal | 1918 } // namespace internal |
1918 } // namespace v8 | 1919 } // namespace v8 |
OLD | NEW |