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

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

Issue 10696155: Allocate types in proper heap space. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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/flow_graph_builder.cc ('k') | runtime/vm/object.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_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 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 static RawType* FunctionInterface(); 1003 static RawType* FunctionInterface();
1004 1004
1005 // The 'List' interface type. 1005 // The 'List' interface type.
1006 static RawType* ListInterface(); 1006 static RawType* ListInterface();
1007 1007
1008 // The finalized type of the given non-parameterized class. 1008 // The finalized type of the given non-parameterized class.
1009 static RawType* NewNonParameterizedType(const Class& type_class); 1009 static RawType* NewNonParameterizedType(const Class& type_class);
1010 1010
1011 static RawType* New(const Object& clazz, 1011 static RawType* New(const Object& clazz,
1012 const AbstractTypeArguments& arguments, 1012 const AbstractTypeArguments& arguments,
1013 intptr_t token_pos); 1013 intptr_t token_pos,
1014 Heap::Space space = Heap::kOld);
1014 1015
1015 private: 1016 private:
1016 void set_token_pos(intptr_t token_pos) const; 1017 void set_token_pos(intptr_t token_pos) const;
1017 void set_type_state(int8_t state) const; 1018 void set_type_state(int8_t state) const;
1018 1019
1019 static RawType* New(); 1020 static RawType* New(Heap::Space space = Heap::kOld);
1020 1021
1021 HEAP_OBJECT_IMPLEMENTATION(Type, AbstractType); 1022 HEAP_OBJECT_IMPLEMENTATION(Type, AbstractType);
1022 friend class Class; 1023 friend class Class;
1023 }; 1024 };
1024 1025
1025 1026
1026 // A TypeParameter represents a type parameter of a parameterized class. 1027 // A TypeParameter represents a type parameter of a parameterized class.
1027 // It specifies its index (and its name for debugging purposes), as well as its 1028 // It specifies its index (and its name for debugging purposes), as well as its
1028 // upper bound. 1029 // upper bound.
1029 // For example, the type parameter 'V' is specified as index 1 in the context of 1030 // For example, the type parameter 'V' is specified as index 1 in the context of
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 ASSERT(sizeof(RawTypeArguments) == OFFSET_OF(RawTypeArguments, types_)); 1208 ASSERT(sizeof(RawTypeArguments) == OFFSET_OF(RawTypeArguments, types_));
1208 return 0; 1209 return 0;
1209 } 1210 }
1210 1211
1211 static intptr_t InstanceSize(intptr_t len) { 1212 static intptr_t InstanceSize(intptr_t len) {
1212 // Ensure that the types_ is not adding to the object length. 1213 // Ensure that the types_ is not adding to the object length.
1213 ASSERT(sizeof(RawTypeArguments) == (sizeof(RawObject) + (1 * kWordSize))); 1214 ASSERT(sizeof(RawTypeArguments) == (sizeof(RawObject) + (1 * kWordSize)));
1214 return RoundedAllocationSize(sizeof(RawTypeArguments) + (len * kWordSize)); 1215 return RoundedAllocationSize(sizeof(RawTypeArguments) + (len * kWordSize));
1215 } 1216 }
1216 1217
1217 static RawTypeArguments* New(intptr_t len); 1218 static RawTypeArguments* New(intptr_t len, Heap::Space space = Heap::kOld);
1218 1219
1219 private: 1220 private:
1220 // Make sure that the array size cannot wrap around. 1221 // Make sure that the array size cannot wrap around.
1221 static const intptr_t kMaxTypes = 512 * 1024 * 1024; 1222 static const intptr_t kMaxTypes = 512 * 1024 * 1024;
1222 RawAbstractType** TypeAddr(intptr_t index) const; 1223 RawAbstractType** TypeAddr(intptr_t index) const;
1223 void SetLength(intptr_t value) const; 1224 void SetLength(intptr_t value) const;
1224 1225
1225 HEAP_OBJECT_IMPLEMENTATION(TypeArguments, AbstractTypeArguments); 1226 HEAP_OBJECT_IMPLEMENTATION(TypeArguments, AbstractTypeArguments);
1226 friend class Class; 1227 friend class Class;
1227 }; 1228 };
(...skipping 3865 matching lines...) Expand 10 before | Expand all | Expand 10 after
5093 } 5094 }
5094 5095
5095 5096
5096 intptr_t Stackmap::SizeInBits() const { 5097 intptr_t Stackmap::SizeInBits() const {
5097 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); 5098 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte);
5098 } 5099 }
5099 5100
5100 } // namespace dart 5101 } // namespace dart
5101 5102
5102 #endif // VM_OBJECT_H_ 5103 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698