Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: runtime/vm/code_descriptors.h

Issue 1634863002: Introduce CodeSourceMap object to hold pc -> token position mappings (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/code_descriptors.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_CODE_DESCRIPTORS_H_ 5 #ifndef VM_CODE_DESCRIPTORS_H_
6 #define VM_CODE_DESCRIPTORS_H_ 6 #define VM_CODE_DESCRIPTORS_H_
7 7
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 24 matching lines...) Expand all
35 GrowableArray<uint8_t> encoded_data_; 35 GrowableArray<uint8_t> encoded_data_;
36 36
37 intptr_t prev_pc_offset; 37 intptr_t prev_pc_offset;
38 intptr_t prev_deopt_id; 38 intptr_t prev_deopt_id;
39 intptr_t prev_token_pos; 39 intptr_t prev_token_pos;
40 40
41 DISALLOW_COPY_AND_ASSIGN(DescriptorList); 41 DISALLOW_COPY_AND_ASSIGN(DescriptorList);
42 }; 42 };
43 43
44 44
45 class CodeSourceMapBuilder : public ZoneAllocated {
46 public:
47 explicit CodeSourceMapBuilder(intptr_t initial_capacity = 64)
48 : encoded_data_(initial_capacity),
49 prev_pc_offset(0),
50 prev_token_pos(0) {}
51
52 ~CodeSourceMapBuilder() { }
53
54 void AddEntry(intptr_t pc_offset, intptr_t token_pos);
55
56 RawCodeSourceMap* Finalize();
57
58 private:
59 GrowableArray<uint8_t> encoded_data_;
60
61 intptr_t prev_pc_offset;
62 intptr_t prev_token_pos;
63
64 DISALLOW_COPY_AND_ASSIGN(CodeSourceMapBuilder);
65 };
66
67
45 class StackmapTableBuilder : public ZoneAllocated { 68 class StackmapTableBuilder : public ZoneAllocated {
46 public: 69 public:
47 StackmapTableBuilder() 70 StackmapTableBuilder()
48 : stack_map_(Stackmap::ZoneHandle()), 71 : stack_map_(Stackmap::ZoneHandle()),
49 list_(GrowableObjectArray::ZoneHandle( 72 list_(GrowableObjectArray::ZoneHandle(
50 GrowableObjectArray::New(Heap::kOld))) { } 73 GrowableObjectArray::New(Heap::kOld))) { }
51 ~StackmapTableBuilder() { } 74 ~StackmapTableBuilder() { }
52 75
53 void AddEntry(intptr_t pc_offset, 76 void AddEntry(intptr_t pc_offset,
54 BitmapBuilder* bitmap, 77 BitmapBuilder* bitmap,
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 RawExceptionHandlers* FinalizeExceptionHandlers(uword entry_point) const; 159 RawExceptionHandlers* FinalizeExceptionHandlers(uword entry_point) const;
137 160
138 private: 161 private:
139 GrowableArray<struct HandlerDesc> list_; 162 GrowableArray<struct HandlerDesc> list_;
140 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); 163 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList);
141 }; 164 };
142 165
143 } // namespace dart 166 } // namespace dart
144 167
145 #endif // VM_CODE_DESCRIPTORS_H_ 168 #endif // VM_CODE_DESCRIPTORS_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/code_descriptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698