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

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

Issue 10407019: Extend assembler with ability to produce comments for the generated code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address Srdjan comments Created 8 years, 7 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 | Annotate | Revision Log
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_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 2162 matching lines...) Expand 10 before | Expand all | Expand 10 after
2173 void set_pc_descriptors(const PcDescriptors& descriptors) const { 2173 void set_pc_descriptors(const PcDescriptors& descriptors) const {
2174 StorePointer(&raw_ptr()->pc_descriptors_, descriptors.raw()); 2174 StorePointer(&raw_ptr()->pc_descriptors_, descriptors.raw());
2175 } 2175 }
2176 2176
2177 RawArray* stackmaps() const { 2177 RawArray* stackmaps() const {
2178 return raw_ptr()->stackmaps_; 2178 return raw_ptr()->stackmaps_;
2179 } 2179 }
2180 void set_stackmaps(const Array& maps) const; 2180 void set_stackmaps(const Array& maps) const;
2181 RawStackmap* GetStackmap(uword pc, Array* stackmaps, Stackmap* map) const; 2181 RawStackmap* GetStackmap(uword pc, Array* stackmaps, Stackmap* map) const;
2182 2182
2183 class Comments : public ZoneAllocated {
2184 public:
2185 static Comments& New(intptr_t count);
2186
2187 intptr_t Length() const;
2188
2189 void SetPCOffsetAt(intptr_t idx, intptr_t pc_offset);
2190 void SetCommentAt(intptr_t idx, const String& comment);
2191
2192 intptr_t PCOffsetAt(intptr_t idx) const;
2193 const String& CommentAt(intptr_t idx) const;
2194
2195 private:
2196 explicit Comments(const Array& comments);
2197
2198 // Layout of entries describing comments.
2199 enum {
2200 kPCOffsetEntry = 0, // PC offset to a comment as a Smi.
2201 kCommentEntry, // Comment text as a String.
2202 kNumberOfEntries
2203 };
2204
2205 const Array& comments_;
2206
2207 friend class Code;
2208
2209 DISALLOW_COPY_AND_ASSIGN(Comments);
2210 };
2211
2212
2213 const Comments& comments() const;
2214 void set_comments(const Comments& comments) const;
2215
2183 RawLocalVarDescriptors* var_descriptors() const { 2216 RawLocalVarDescriptors* var_descriptors() const {
2184 return raw_ptr()->var_descriptors_; 2217 return raw_ptr()->var_descriptors_;
2185 } 2218 }
2186 void set_var_descriptors(const LocalVarDescriptors& value) const { 2219 void set_var_descriptors(const LocalVarDescriptors& value) const {
2187 StorePointer(&raw_ptr()->var_descriptors_, value.raw()); 2220 StorePointer(&raw_ptr()->var_descriptors_, value.raw());
2188 } 2221 }
2189 2222
2190 RawExceptionHandlers* exception_handlers() const { 2223 RawExceptionHandlers* exception_handlers() const {
2191 return raw_ptr()->exception_handlers_; 2224 return raw_ptr()->exception_handlers_;
2192 } 2225 }
(...skipping 2723 matching lines...) Expand 10 before | Expand all | Expand 10 after
4916 } 4949 }
4917 4950
4918 4951
4919 intptr_t Stackmap::SizeInBits() const { 4952 intptr_t Stackmap::SizeInBits() const {
4920 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); 4953 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte);
4921 } 4954 }
4922 4955
4923 } // namespace dart 4956 } // namespace dart
4924 4957
4925 #endif // VM_OBJECT_H_ 4958 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698