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/debug/liveedit.h" | 5 #include "src/debug/liveedit.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/compilation-cache.h" | 9 #include "src/compilation-cache.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 | 1104 |
1105 void TranslateSourcePositionTable(Handle<AbstractCode> code, | 1105 void TranslateSourcePositionTable(Handle<AbstractCode> code, |
1106 Handle<JSArray> position_change_array) { | 1106 Handle<JSArray> position_change_array) { |
1107 Isolate* isolate = code->GetIsolate(); | 1107 Isolate* isolate = code->GetIsolate(); |
1108 Zone zone(isolate->allocator(), ZONE_NAME); | 1108 Zone zone(isolate->allocator(), ZONE_NAME); |
1109 SourcePositionTableBuilder builder(&zone); | 1109 SourcePositionTableBuilder builder(&zone); |
1110 | 1110 |
1111 Handle<ByteArray> source_position_table(code->source_position_table()); | 1111 Handle<ByteArray> source_position_table(code->source_position_table()); |
1112 for (SourcePositionTableIterator iterator(*source_position_table); | 1112 for (SourcePositionTableIterator iterator(*source_position_table); |
1113 !iterator.done(); iterator.Advance()) { | 1113 !iterator.done(); iterator.Advance()) { |
1114 int position = iterator.source_position(); | 1114 SourcePosition position = iterator.source_position(); |
1115 int new_position = TranslatePosition(position, position_change_array); | 1115 position.SetScriptOffset( |
1116 builder.AddPosition(iterator.code_offset(), new_position, | 1116 TranslatePosition(position.ScriptOffset(), position_change_array)); |
| 1117 builder.AddPosition(iterator.code_offset(), position, |
1117 iterator.is_statement()); | 1118 iterator.is_statement()); |
1118 } | 1119 } |
1119 | 1120 |
1120 Handle<ByteArray> new_source_position_table( | 1121 Handle<ByteArray> new_source_position_table( |
1121 builder.ToSourcePositionTable(isolate, code)); | 1122 builder.ToSourcePositionTable(isolate, code)); |
1122 code->set_source_position_table(*new_source_position_table); | 1123 code->set_source_position_table(*new_source_position_table); |
1123 } | 1124 } |
1124 } // namespace | 1125 } // namespace |
1125 | 1126 |
1126 void LiveEdit::PatchFunctionPositions(Handle<JSArray> shared_info_array, | 1127 void LiveEdit::PatchFunctionPositions(Handle<JSArray> shared_info_array, |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1916 scope_info_length++; | 1917 scope_info_length++; |
1917 | 1918 |
1918 current_scope = current_scope->outer_scope(); | 1919 current_scope = current_scope->outer_scope(); |
1919 } | 1920 } |
1920 | 1921 |
1921 return scope_info_list; | 1922 return scope_info_list; |
1922 } | 1923 } |
1923 | 1924 |
1924 } // namespace internal | 1925 } // namespace internal |
1925 } // namespace v8 | 1926 } // namespace v8 |
OLD | NEW |