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

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

Issue 1632343002: Initialize byte_index_ (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | 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_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 3986 matching lines...) Expand 10 before | Expand all | Expand 10 after
3997 // Encode integer in SLEB128 format. 3997 // Encode integer in SLEB128 format.
3998 static void EncodeInteger(GrowableArray<uint8_t>* data, intptr_t value); 3998 static void EncodeInteger(GrowableArray<uint8_t>* data, intptr_t value);
3999 3999
4000 // Decode SLEB128 encoded integer. Update byte_index to the next integer. 4000 // Decode SLEB128 encoded integer. Update byte_index to the next integer.
4001 intptr_t DecodeInteger(intptr_t* byte_index) const; 4001 intptr_t DecodeInteger(intptr_t* byte_index) const;
4002 4002
4003 class Iterator : ValueObject { 4003 class Iterator : ValueObject {
4004 public: 4004 public:
4005 explicit Iterator(const CodeSourceMap& code_source_map) 4005 explicit Iterator(const CodeSourceMap& code_source_map)
4006 : code_source_map_(code_source_map), 4006 : code_source_map_(code_source_map),
4007 byte_index_(0),
4007 cur_pc_offset_(0), 4008 cur_pc_offset_(0),
4008 cur_token_pos_(0) { 4009 cur_token_pos_(0) {
4009 } 4010 }
4010 4011
4011 bool MoveNext() { 4012 bool MoveNext() {
4012 // Moves to the next record. 4013 // Moves to the next record.
4013 while (byte_index_ < code_source_map_.Length()) { 4014 while (byte_index_ < code_source_map_.Length()) {
4014 cur_pc_offset_ += code_source_map_.DecodeInteger(&byte_index_); 4015 cur_pc_offset_ += code_source_map_.DecodeInteger(&byte_index_);
4015 cur_token_pos_ += code_source_map_.DecodeInteger(&byte_index_); 4016 cur_token_pos_ += code_source_map_.DecodeInteger(&byte_index_);
4016 4017
(...skipping 4359 matching lines...) Expand 10 before | Expand all | Expand 10 after
8376 8377
8377 8378
8378 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 8379 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
8379 intptr_t index) { 8380 intptr_t index) {
8380 return array.At((index * kEntryLength) + kTargetFunctionIndex); 8381 return array.At((index * kEntryLength) + kTargetFunctionIndex);
8381 } 8382 }
8382 8383
8383 } // namespace dart 8384 } // namespace dart
8384 8385
8385 #endif // VM_OBJECT_H_ 8386 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698