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 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 int chunk_changed_end = Handle<Smi>::cast(element)->value(); | 1098 int chunk_changed_end = Handle<Smi>::cast(element)->value(); |
1099 position_diff = chunk_changed_end - chunk_end; | 1099 position_diff = chunk_changed_end - chunk_end; |
1100 } | 1100 } |
1101 | 1101 |
1102 return original_position + position_diff; | 1102 return original_position + position_diff; |
1103 } | 1103 } |
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()); | 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 int position = iterator.source_position(); |
1115 int new_position = TranslatePosition(position, position_change_array); | 1115 int new_position = TranslatePosition(position, position_change_array); |
1116 builder.AddPosition(iterator.code_offset(), new_position, | 1116 builder.AddPosition(iterator.code_offset(), new_position, |
1117 iterator.is_statement()); | 1117 iterator.is_statement()); |
1118 } | 1118 } |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 Handle<JSArray> result_; | 1510 Handle<JSArray> result_; |
1511 }; | 1511 }; |
1512 | 1512 |
1513 | 1513 |
1514 // Drops all call frame matched by target and all frames above them. | 1514 // Drops all call frame matched by target and all frames above them. |
1515 template <typename TARGET> | 1515 template <typename TARGET> |
1516 static const char* DropActivationsInActiveThreadImpl(Isolate* isolate, | 1516 static const char* DropActivationsInActiveThreadImpl(Isolate* isolate, |
1517 TARGET& target, // NOLINT | 1517 TARGET& target, // NOLINT |
1518 bool do_drop) { | 1518 bool do_drop) { |
1519 Debug* debug = isolate->debug(); | 1519 Debug* debug = isolate->debug(); |
1520 Zone zone(isolate->allocator()); | 1520 Zone zone(isolate->allocator(), ZONE_NAME); |
1521 Vector<StackFrame*> frames = CreateStackMap(isolate, &zone); | 1521 Vector<StackFrame*> frames = CreateStackMap(isolate, &zone); |
1522 | 1522 |
1523 | 1523 |
1524 int top_frame_index = -1; | 1524 int top_frame_index = -1; |
1525 int frame_index = 0; | 1525 int frame_index = 0; |
1526 for (; frame_index < frames.length(); frame_index++) { | 1526 for (; frame_index < frames.length(); frame_index++) { |
1527 StackFrame* frame = frames[frame_index]; | 1527 StackFrame* frame = frames[frame_index]; |
1528 if (frame->id() == debug->break_frame_id()) { | 1528 if (frame->id() == debug->break_frame_id()) { |
1529 top_frame_index = frame_index; | 1529 top_frame_index = frame_index; |
1530 break; | 1530 break; |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1916 scope_info_length++; | 1916 scope_info_length++; |
1917 | 1917 |
1918 current_scope = current_scope->outer_scope(); | 1918 current_scope = current_scope->outer_scope(); |
1919 } | 1919 } |
1920 | 1920 |
1921 return scope_info_list; | 1921 return scope_info_list; |
1922 } | 1922 } |
1923 | 1923 |
1924 } // namespace internal | 1924 } // namespace internal |
1925 } // namespace v8 | 1925 } // namespace v8 |
OLD | NEW |