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

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

Issue 396213005: Fix PcDescriptor iteratot to never return a pointer to a memory location since the data can move wi… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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
« no previous file with comments | « runtime/vm/object_test.cc ('k') | runtime/vm/simulator_arm.cc » ('j') | 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_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/token.h" 10 #include "vm/token.h"
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 int32_t bit = compressed ? 0x1 : 0x0; 942 int32_t bit = compressed ? 0x1 : 0x0;
943 token_pos_ = (value << 1) | bit; 943 token_pos_ = (value << 1) | bit;
944 } 944 }
945 945
946 intptr_t deopt_id() const { return deopt_id_and_kind_ >> 8; } 946 intptr_t deopt_id() const { return deopt_id_and_kind_ >> 8; }
947 void set_deopt_id(int32_t value) { 947 void set_deopt_id(int32_t value) {
948 ASSERT(Utils::IsInt(24, value)); 948 ASSERT(Utils::IsInt(24, value));
949 deopt_id_and_kind_ = (deopt_id_and_kind_ & 0xFF) | (value << 8); 949 deopt_id_and_kind_ = (deopt_id_and_kind_ & 0xFF) | (value << 8);
950 } 950 }
951 951
952 void CopyTo(PcDescriptorRec* other) const {
953 other->set_pc(pc());
954 other->set_deopt_id(deopt_id());
955 other->set_kind(kind());
956 other->set_token_pos(token_pos(), false);
957 other->set_try_index(try_index());
958 }
959
952 private: 960 private:
953 bool is_compressed() const { 961 bool is_compressed() const {
954 return (token_pos_ & 0x1) == 1; 962 return (token_pos_ & 0x1) == 1;
955 } 963 }
956 964
957 uword pc_; 965 uword pc_;
958 int32_t deopt_id_and_kind_; // Bits 31..8 -> deopt_id, bits 7..0 kind. 966 int32_t deopt_id_and_kind_; // Bits 31..8 -> deopt_id, bits 7..0 kind.
959 int32_t token_pos_; // Bits 31..1 -> token_pos, bit 1 -> compressed flag; 967 int32_t token_pos_; // Bits 31..1 -> token_pos, bit 1 -> compressed flag;
960 int16_t try_index_; 968 int16_t try_index_;
961 }; 969 };
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
1938 COMPILE_ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); 1946 COMPILE_ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14);
1939 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 1947 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
1940 kTypedDataInt8ArrayViewCid + 15); 1948 kTypedDataInt8ArrayViewCid + 15);
1941 COMPILE_ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); 1949 COMPILE_ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14);
1942 return (kNullCid - kTypedDataInt8ArrayCid); 1950 return (kNullCid - kTypedDataInt8ArrayCid);
1943 } 1951 }
1944 1952
1945 } // namespace dart 1953 } // namespace dart
1946 1954
1947 #endif // VM_RAW_OBJECT_H_ 1955 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/object_test.cc ('k') | runtime/vm/simulator_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698