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

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

Issue 10161030: Canonicalize type arguments lazily. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 | « no previous file | 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 3407 matching lines...) Expand 10 before | Expand all | Expand 10 after
3418 } 3418 }
3419 void SetAt(intptr_t index, const Object& value) const { 3419 void SetAt(intptr_t index, const Object& value) const {
3420 // TODO(iposva): Add storing NoGCScope. 3420 // TODO(iposva): Add storing NoGCScope.
3421 StorePointer(ObjectAddr(index), value.raw()); 3421 StorePointer(ObjectAddr(index), value.raw());
3422 } 3422 }
3423 3423
3424 virtual RawAbstractTypeArguments* GetTypeArguments() const { 3424 virtual RawAbstractTypeArguments* GetTypeArguments() const {
3425 return raw_ptr()->type_arguments_; 3425 return raw_ptr()->type_arguments_;
3426 } 3426 }
3427 virtual void SetTypeArguments(const AbstractTypeArguments& value) const { 3427 virtual void SetTypeArguments(const AbstractTypeArguments& value) const {
3428 raw_ptr()->type_arguments_ = value.Canonicalize(); 3428 raw_ptr()->type_arguments_ = value.raw();
3429 } 3429 }
3430 3430
3431 virtual bool Equals(const Instance& other) const; 3431 virtual bool Equals(const Instance& other) const;
3432 3432
3433 static intptr_t type_arguments_offset() { 3433 static intptr_t type_arguments_offset() {
3434 return OFFSET_OF(RawArray, type_arguments_); 3434 return OFFSET_OF(RawArray, type_arguments_);
3435 } 3435 }
3436 3436
3437 static intptr_t InstanceSize() { 3437 static intptr_t InstanceSize() {
3438 ASSERT(sizeof(RawArray) == OFFSET_OF_RETURNED_VALUE(RawArray, data)); 3438 ASSERT(sizeof(RawArray) == OFFSET_OF_RETURNED_VALUE(RawArray, data));
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
3546 void Grow(intptr_t new_capacity, Heap::Space space = Heap::kNew) const; 3546 void Grow(intptr_t new_capacity, Heap::Space space = Heap::kNew) const;
3547 RawObject* RemoveLast() const; 3547 RawObject* RemoveLast() const;
3548 3548
3549 virtual RawAbstractTypeArguments* GetTypeArguments() const { 3549 virtual RawAbstractTypeArguments* GetTypeArguments() const {
3550 const Array& contents = Array::Handle(data()); 3550 const Array& contents = Array::Handle(data());
3551 return contents.GetTypeArguments(); 3551 return contents.GetTypeArguments();
3552 } 3552 }
3553 virtual void SetTypeArguments(const AbstractTypeArguments& value) const { 3553 virtual void SetTypeArguments(const AbstractTypeArguments& value) const {
3554 const Array& contents = Array::Handle(data()); 3554 const Array& contents = Array::Handle(data());
3555 contents.SetTypeArguments(value); 3555 contents.SetTypeArguments(value);
3556 raw_ptr()->type_arguments_ = value.Canonicalize(); 3556 raw_ptr()->type_arguments_ = value.raw();
3557 } 3557 }
3558 3558
3559 virtual bool Equals(const Instance& other) const; 3559 virtual bool Equals(const Instance& other) const;
3560 3560
3561 static intptr_t type_arguments_offset() { 3561 static intptr_t type_arguments_offset() {
3562 return OFFSET_OF(RawGrowableObjectArray, type_arguments_); 3562 return OFFSET_OF(RawGrowableObjectArray, type_arguments_);
3563 } 3563 }
3564 3564
3565 static intptr_t length_offset() { 3565 static intptr_t length_offset() {
3566 return OFFSET_OF(RawGrowableObjectArray, length_); 3566 return OFFSET_OF(RawGrowableObjectArray, length_);
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
3787 return OFFSET_OF(RawClosure, function_); 3787 return OFFSET_OF(RawClosure, function_);
3788 } 3788 }
3789 3789
3790 RawContext* context() const { return raw_ptr()->context_; } 3790 RawContext* context() const { return raw_ptr()->context_; }
3791 static intptr_t context_offset() { return OFFSET_OF(RawClosure, context_); } 3791 static intptr_t context_offset() { return OFFSET_OF(RawClosure, context_); }
3792 3792
3793 virtual RawAbstractTypeArguments* GetTypeArguments() const { 3793 virtual RawAbstractTypeArguments* GetTypeArguments() const {
3794 return raw_ptr()->type_arguments_; 3794 return raw_ptr()->type_arguments_;
3795 } 3795 }
3796 virtual void SetTypeArguments(const AbstractTypeArguments& value) const { 3796 virtual void SetTypeArguments(const AbstractTypeArguments& value) const {
3797 raw_ptr()->type_arguments_ = value.Canonicalize(); 3797 raw_ptr()->type_arguments_ = value.raw();
3798 } 3798 }
3799 static intptr_t type_arguments_offset() { 3799 static intptr_t type_arguments_offset() {
3800 return OFFSET_OF(RawClosure, type_arguments_); 3800 return OFFSET_OF(RawClosure, type_arguments_);
3801 } 3801 }
3802 3802
3803 // TODO(iposva): Remove smrck support once mapping to arbitrary is available. 3803 // TODO(iposva): Remove smrck support once mapping to arbitrary is available.
3804 RawInteger* smrck() const { return raw_ptr()->smrck_; } 3804 RawInteger* smrck() const { return raw_ptr()->smrck_; }
3805 void set_smrck(const Integer& smrck) const { 3805 void set_smrck(const Integer& smrck) const {
3806 StorePointer(&raw_ptr()->smrck_, smrck.raw()); 3806 StorePointer(&raw_ptr()->smrck_, smrck.raw());
3807 } 3807 }
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
4000 } 4000 }
4001 4001
4002 4002
4003 intptr_t Stackmap::SizeInBits() const { 4003 intptr_t Stackmap::SizeInBits() const {
4004 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); 4004 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte);
4005 } 4005 }
4006 4006
4007 } // namespace dart 4007 } // namespace dart
4008 4008
4009 #endif // VM_OBJECT_H_ 4009 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698