| 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 <limits> | 8 #include <limits> |
| 9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 2418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2429 // The class Iterator encapsulates iteration over the tokens | 2429 // The class Iterator encapsulates iteration over the tokens |
| 2430 // in a TokenStream object. | 2430 // in a TokenStream object. |
| 2431 class Iterator : ValueObject { | 2431 class Iterator : ValueObject { |
| 2432 public: | 2432 public: |
| 2433 enum StreamType { | 2433 enum StreamType { |
| 2434 kNoNewlines, | 2434 kNoNewlines, |
| 2435 kAllTokens | 2435 kAllTokens |
| 2436 }; | 2436 }; |
| 2437 | 2437 |
| 2438 Iterator(const TokenStream& tokens, | 2438 Iterator(const TokenStream& tokens, |
| 2439 intptr_t token_pos, | 2439 intptr_t token_pos, |
| 2440 Iterator::StreamType stream_type = kNoNewlines); | 2440 Iterator::StreamType stream_type = kNoNewlines); |
| 2441 | 2441 |
| 2442 void SetStream(const TokenStream& tokens, intptr_t token_pos); | 2442 void SetStream(const TokenStream& tokens, intptr_t token_pos); |
| 2443 bool IsValid() const; | 2443 bool IsValid() const; |
| 2444 | 2444 |
| 2445 inline Token::Kind CurrentTokenKind() const { | 2445 inline Token::Kind CurrentTokenKind() const { |
| 2446 return cur_token_kind_; | 2446 return cur_token_kind_; |
| 2447 } | 2447 } |
| 2448 | 2448 |
| 2449 Token::Kind LookaheadTokenKind(intptr_t num_tokens); | 2449 Token::Kind LookaheadTokenKind(intptr_t num_tokens); |
| 2450 | 2450 |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3025 // Verify (assert) assumptions about pc descriptors in debug mode. | 3025 // Verify (assert) assumptions about pc descriptors in debug mode. |
| 3026 void Verify(const Function& function) const; | 3026 void Verify(const Function& function) const; |
| 3027 | 3027 |
| 3028 static void PrintHeaderString(); | 3028 static void PrintHeaderString(); |
| 3029 | 3029 |
| 3030 void PrintToJSONObject(JSONObject* jsobj) const; | 3030 void PrintToJSONObject(JSONObject* jsobj) const; |
| 3031 | 3031 |
| 3032 // We would have a VisitPointers function here to traverse the | 3032 // We would have a VisitPointers function here to traverse the |
| 3033 // pc descriptors table to visit objects if any in the table. | 3033 // pc descriptors table to visit objects if any in the table. |
| 3034 | 3034 |
| 3035 class Iterator : public ValueObject { | 3035 class Iterator : ValueObject { |
| 3036 public: | 3036 public: |
| 3037 explicit Iterator(const PcDescriptors& descriptors) | 3037 explicit Iterator(const PcDescriptors& descriptors) |
| 3038 : descriptors_(descriptors), current_ix_(0) {} | 3038 : ValueObject(), descriptors_(descriptors), current_ix_(0) {} |
| 3039 | 3039 |
| 3040 // For nested iterations, starting at element after. | 3040 // For nested iterations, starting at element after. |
| 3041 explicit Iterator(const Iterator& iter) | 3041 explicit Iterator(const Iterator& iter) |
| 3042 : descriptors_(iter.descriptors_), current_ix_(iter.current_ix_) {} | 3042 : descriptors_(iter.descriptors_), current_ix_(iter.current_ix_) {} |
| 3043 | 3043 |
| 3044 bool HasNext() { return current_ix_ < descriptors_.Length(); } | 3044 bool HasNext() { return current_ix_ < descriptors_.Length(); } |
| 3045 | 3045 |
| 3046 const RawPcDescriptors::PcDescriptorRec& Next() { | 3046 const RawPcDescriptors::PcDescriptorRec& Next() { |
| 3047 ASSERT(HasNext()); | 3047 ASSERT(HasNext()); |
| 3048 return *descriptors_.recAt(current_ix_++); | 3048 return *descriptors_.recAt(current_ix_++); |
| (...skipping 4097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7146 | 7146 |
| 7147 | 7147 |
| 7148 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 7148 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 7149 intptr_t index) { | 7149 intptr_t index) { |
| 7150 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 7150 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 7151 } | 7151 } |
| 7152 | 7152 |
| 7153 } // namespace dart | 7153 } // namespace dart |
| 7154 | 7154 |
| 7155 #endif // VM_OBJECT_H_ | 7155 #endif // VM_OBJECT_H_ |
| OLD | NEW |