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

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

Issue 184523002: Allocation sinking for contexts. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: added new test Created 6 years, 1 month 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
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/atomic.h" 9 #include "vm/atomic.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 1205
1206 class RawContext : public RawObject { 1206 class RawContext : public RawObject {
1207 RAW_HEAP_OBJECT_IMPLEMENTATION(Context); 1207 RAW_HEAP_OBJECT_IMPLEMENTATION(Context);
1208 1208
1209 int32_t num_variables_; 1209 int32_t num_variables_;
1210 1210
1211 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->parent_); } 1211 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->parent_); }
1212 RawContext* parent_; 1212 RawContext* parent_;
1213 1213
1214 // Variable length data follows here. 1214 // Variable length data follows here.
1215 RawInstance** data() { OPEN_ARRAY_START(RawInstance*, RawInstance*); } 1215 RawObject** data() { OPEN_ARRAY_START(RawObject*, RawObject*); }
1216 RawInstance* const* data() const { 1216 RawObject* const* data() const {
1217 OPEN_ARRAY_START(RawInstance*, RawInstance*); 1217 OPEN_ARRAY_START(RawObject*, RawObject*);
1218 } 1218 }
1219 RawObject** to(intptr_t num_vars) { 1219 RawObject** to(intptr_t num_vars) {
1220 return reinterpret_cast<RawObject**>(&ptr()->data()[num_vars - 1]); 1220 return reinterpret_cast<RawObject**>(&ptr()->data()[num_vars - 1]);
1221 } 1221 }
1222 1222
1223 friend class SnapshotReader; 1223 friend class SnapshotReader;
1224 }; 1224 };
1225 1225
1226 1226
1227 class RawContextScope : public RawObject { 1227 class RawContextScope : public RawObject {
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 2109 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
2110 kTypedDataInt8ArrayViewCid + 15); 2110 kTypedDataInt8ArrayViewCid + 15);
2111 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); 2111 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14);
2112 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); 2112 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1);
2113 return (kNullCid - kTypedDataInt8ArrayCid); 2113 return (kNullCid - kTypedDataInt8ArrayCid);
2114 } 2114 }
2115 2115
2116 } // namespace dart 2116 } // namespace dart
2117 2117
2118 #endif // VM_RAW_OBJECT_H_ 2118 #endif // VM_RAW_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698