OLD | NEW |
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 4033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4044 static RawCodeSourceMap* New(GrowableArray<uint8_t>* delta_encoded_data); | 4044 static RawCodeSourceMap* New(GrowableArray<uint8_t>* delta_encoded_data); |
4045 | 4045 |
4046 void PrintToJSONObject(JSONObject* jsobj, bool ref) const; | 4046 void PrintToJSONObject(JSONObject* jsobj, bool ref) const; |
4047 | 4047 |
4048 // Encode integer in SLEB128 format. | 4048 // Encode integer in SLEB128 format. |
4049 static void EncodeInteger(GrowableArray<uint8_t>* data, intptr_t value); | 4049 static void EncodeInteger(GrowableArray<uint8_t>* data, intptr_t value); |
4050 | 4050 |
4051 // Decode SLEB128 encoded integer. Update byte_index to the next integer. | 4051 // Decode SLEB128 encoded integer. Update byte_index to the next integer. |
4052 intptr_t DecodeInteger(intptr_t* byte_index) const; | 4052 intptr_t DecodeInteger(intptr_t* byte_index) const; |
4053 | 4053 |
| 4054 TokenPosition TokenPositionForPCOffset(uword pc_offset) const; |
| 4055 RawFunction* FunctionForPCOffset(const Code& code, |
| 4056 const Function& function, |
| 4057 uword pc_offset) const; |
| 4058 RawScript* ScriptForPCOffset(const Code& code, |
| 4059 const Function& function, |
| 4060 uword pc_offset) const; |
| 4061 |
| 4062 static void Dump(const CodeSourceMap& code_source_map, |
| 4063 const Code& code, |
| 4064 const Function& function); |
| 4065 |
4054 class Iterator : ValueObject { | 4066 class Iterator : ValueObject { |
4055 public: | 4067 public: |
4056 explicit Iterator(const CodeSourceMap& code_source_map) | 4068 explicit Iterator(const CodeSourceMap& code_source_map) |
4057 : code_source_map_(code_source_map), | 4069 : code_source_map_(code_source_map), |
4058 byte_index_(0), | 4070 byte_index_(0), |
4059 cur_pc_offset_(0), | 4071 cur_pc_offset_(0), |
4060 cur_token_pos_(0) { | 4072 cur_token_pos_(0) { |
4061 } | 4073 } |
4062 | 4074 |
4063 bool MoveNext() { | 4075 bool MoveNext() { |
(...skipping 4363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8427 | 8439 |
8428 | 8440 |
8429 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 8441 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
8430 intptr_t index) { | 8442 intptr_t index) { |
8431 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 8443 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
8432 } | 8444 } |
8433 | 8445 |
8434 } // namespace dart | 8446 } // namespace dart |
8435 | 8447 |
8436 #endif // VM_OBJECT_H_ | 8448 #endif // VM_OBJECT_H_ |
OLD | NEW |