Chromium Code Reviews| Index: vm/snapshot.h |
| =================================================================== |
| --- vm/snapshot.h (revision 3329) |
| +++ vm/snapshot.h (working copy) |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| @@ -18,14 +18,32 @@ |
| // Forward declarations. |
| class AbstractType; |
| class AbstractTypeArguments; |
| +class Array; |
| class Class; |
| +class Context; |
| +class Double; |
| +class FourByteString; |
| class Heap; |
| +class ImmutableArray; |
| class Library; |
| +class Mint; |
| class Object; |
| class ObjectStore; |
| +class OneByteString; |
| class RawClass; |
| +class RawField; |
| +class RawFunction; |
| +class RawLibrary; |
| +class RawLibraryPrefix; |
| class RawObject; |
| +class RawScript; |
| +class RawType; |
| +class RawTypeParameter; |
| +class RawUnresolvedClass; |
| class String; |
| +class TokenStream; |
| +class TwoByteString; |
| +class TypeArguments; |
| static const int8_t kSerializedBitsPerByte = 7; |
| static const int8_t kMaxSerializedUnsignedValuePerByte = 127; |
| @@ -319,7 +337,34 @@ |
| // Read a full snap shot. |
| void ReadFullSnapshot(); |
| + // Helper functions for creating uninitialized versions |
| + // of various object types. These are used when reading a |
| + // full snapshot. |
| + void NewArray(Array* array, intptr_t len); |
|
Ivan Posva
2012/01/16 19:30:33
RawArray* NewArray(intptr_t len);
siva
2012/01/18 00:00:24
Done.
|
| + void NewImmutableArray(ImmutableArray* array, intptr_t len); |
| + void NewOneByteString(OneByteString* str_obj, intptr_t len); |
| + void NewTwoByteString(TwoByteString* str_obj, intptr_t len); |
| + void NewFourByteString(FourByteString* str_obj, intptr_t len); |
| + void NewTypeArguments(TypeArguments* obj, intptr_t len); |
| + void NewTokenStream(TokenStream* obj, intptr_t len); |
| + void NewContext(Context* obj, intptr_t num_variables); |
| + void NewClass(Class* obj, int value); |
| + void NewMint(Mint* obj, int64_t value); |
| + void NewDouble(Double* obj, double value); |
| + |
| + RawUnresolvedClass* NewUnresolvedClass(); |
| + RawType* NewType(); |
| + RawTypeParameter* NewTypeParameter(); |
| + RawFunction* NewFunction(); |
| + RawField* NewField(); |
| + RawLibrary* NewLibrary(); |
| + RawLibraryPrefix* NewLibraryPrefix(); |
| + RawScript* NewScript(); |
| + |
| private: |
| + // Allocate uninitialized objects, this is used when reading a full snapshot. |
| + RawObject* AllocateUninitialized(const Class& cls, intptr_t size); |
| + |
| // Internal implementation of ReadObject once the header value is read. |
| RawObject* ReadObjectImpl(intptr_t header); |