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

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

Issue 2687143005: Include metadata in AOT to expand inline frames in stack traces and provide line numbers. (Closed)
Patch Set: collect invisible code frames Created 3 years, 10 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
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 RUNTIME_VM_OBJECT_H_ 5 #ifndef RUNTIME_VM_OBJECT_H_
6 #define RUNTIME_VM_OBJECT_H_ 6 #define RUNTIME_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 3558 matching lines...) Expand 10 before | Expand all | Expand 10 after
3569 RawString* GetLine(intptr_t line_number, 3569 RawString* GetLine(intptr_t line_number,
3570 Heap::Space space = Heap::kNew) const; 3570 Heap::Space space = Heap::kNew) const;
3571 RawString* GetSnippet(TokenPosition from, TokenPosition to) const; 3571 RawString* GetSnippet(TokenPosition from, TokenPosition to) const;
3572 RawString* GetSnippet(intptr_t from_line, 3572 RawString* GetSnippet(intptr_t from_line,
3573 intptr_t from_column, 3573 intptr_t from_column,
3574 intptr_t to_line, 3574 intptr_t to_line,
3575 intptr_t to_column) const; 3575 intptr_t to_column) const;
3576 3576
3577 void SetLocationOffset(intptr_t line_offset, intptr_t col_offset) const; 3577 void SetLocationOffset(intptr_t line_offset, intptr_t col_offset) const;
3578 3578
3579 intptr_t GetTokenLineUsingLineStarts(TokenPosition token_pos) const;
3579 void GetTokenLocation(TokenPosition token_pos, 3580 void GetTokenLocation(TokenPosition token_pos,
3580 intptr_t* line, 3581 intptr_t* line,
3581 intptr_t* column, 3582 intptr_t* column,
3582 intptr_t* token_len = NULL) const; 3583 intptr_t* token_len = NULL) const;
3583 3584
3584 // Returns index of first and last token on the given line. Returns both 3585 // Returns index of first and last token on the given line. Returns both
3585 // indices < 0 if no token exists on or after the line. If a token exists 3586 // indices < 0 if no token exists on or after the line. If a token exists
3586 // after, but not on given line, returns in *first_token_index the index of 3587 // after, but not on given line, returns in *first_token_index the index of
3587 // the first token after the line, and a negative value in *last_token_index. 3588 // the first token after the line, and a negative value in *last_token_index.
3588 void TokenRangeAtLine(intptr_t line_number, 3589 void TokenRangeAtLine(intptr_t line_number,
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
4401 return RoundedAllocationSize(sizeof(RawCodeSourceMap) + len); 4402 return RoundedAllocationSize(sizeof(RawCodeSourceMap) + len);
4402 } 4403 }
4403 4404
4404 static RawCodeSourceMap* New(intptr_t length); 4405 static RawCodeSourceMap* New(intptr_t length);
4405 4406
4406 intptr_t Length() const { return raw_ptr()->length_; } 4407 intptr_t Length() const { return raw_ptr()->length_; }
4407 uint8_t* Data() const { 4408 uint8_t* Data() const {
4408 return UnsafeMutableNonPointer(&raw_ptr()->data()[0]); 4409 return UnsafeMutableNonPointer(&raw_ptr()->data()[0]);
4409 } 4410 }
4410 4411
4412 bool Equals(const CodeSourceMap& other) const {
4413 if (Length() != other.Length()) {
4414 return false;
4415 }
4416 NoSafepointScope no_safepoint;
4417 return memcmp(raw_ptr(), other.raw_ptr(), InstanceSize(Length())) == 0;
4418 }
4419
4411 void PrintToJSONObject(JSONObject* jsobj, bool ref) const; 4420 void PrintToJSONObject(JSONObject* jsobj, bool ref) const;
4412 4421
4413 private: 4422 private:
4414 void SetLength(intptr_t value) const; 4423 void SetLength(intptr_t value) const;
4415 4424
4416 FINAL_HEAP_OBJECT_IMPLEMENTATION(CodeSourceMap, Object); 4425 FINAL_HEAP_OBJECT_IMPLEMENTATION(CodeSourceMap, Object);
4417 friend class Class; 4426 friend class Class;
4418 friend class Object; 4427 friend class Object;
4419 }; 4428 };
4420 4429
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
4654 4663
4655 RawPcDescriptors* pc_descriptors() const { 4664 RawPcDescriptors* pc_descriptors() const {
4656 return raw_ptr()->pc_descriptors_; 4665 return raw_ptr()->pc_descriptors_;
4657 } 4666 }
4658 void set_pc_descriptors(const PcDescriptors& descriptors) const { 4667 void set_pc_descriptors(const PcDescriptors& descriptors) const {
4659 ASSERT(descriptors.IsOld()); 4668 ASSERT(descriptors.IsOld());
4660 StorePointer(&raw_ptr()->pc_descriptors_, descriptors.raw()); 4669 StorePointer(&raw_ptr()->pc_descriptors_, descriptors.raw());
4661 } 4670 }
4662 4671
4663 RawCodeSourceMap* code_source_map() const { 4672 RawCodeSourceMap* code_source_map() const {
4664 #if defined(DART_PRECOMPILED_RUNTIME)
4665 return CodeSourceMap::null();
4666 #else
4667 return raw_ptr()->code_source_map_; 4673 return raw_ptr()->code_source_map_;
4668 #endif
4669 } 4674 }
4670 4675
4671 void set_code_source_map(const CodeSourceMap& code_source_map) const { 4676 void set_code_source_map(const CodeSourceMap& code_source_map) const {
4672 #if defined(DART_PRECOMPILED_RUNTIME)
4673 UNREACHABLE();
4674 #else
4675 ASSERT(code_source_map.IsOld()); 4677 ASSERT(code_source_map.IsOld());
4676 StorePointer(&raw_ptr()->code_source_map_, code_source_map.raw()); 4678 StorePointer(&raw_ptr()->code_source_map_, code_source_map.raw());
4677 #endif
4678 } 4679 }
4679 4680
4680 // Used during reloading (see object_reload.cc). Calls Reset on all ICDatas 4681 // Used during reloading (see object_reload.cc). Calls Reset on all ICDatas
4681 // that are embedded inside the Code object. 4682 // that are embedded inside the Code object.
4682 void ResetICDatas(Zone* zone) const; 4683 void ResetICDatas(Zone* zone) const;
4683 4684
4684 // Array of DeoptInfo objects. 4685 // Array of DeoptInfo objects.
4685 RawArray* deopt_info_array() const { 4686 RawArray* deopt_info_array() const {
4686 #if defined(DART_PRECOMPILED_RUNTIME) 4687 #if defined(DART_PRECOMPILED_RUNTIME)
4687 UNREACHABLE(); 4688 UNREACHABLE();
(...skipping 4224 matching lines...) Expand 10 before | Expand all | Expand 10 after
8912 8913
8913 inline void TypeArguments::SetHash(intptr_t value) const { 8914 inline void TypeArguments::SetHash(intptr_t value) const {
8914 // This is only safe because we create a new Smi, which does not cause 8915 // This is only safe because we create a new Smi, which does not cause
8915 // heap allocation. 8916 // heap allocation.
8916 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8917 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8917 } 8918 }
8918 8919
8919 } // namespace dart 8920 } // namespace dart
8920 8921
8921 #endif // RUNTIME_VM_OBJECT_H_ 8922 #endif // RUNTIME_VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698