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

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

Issue 22915008: Tests for GuardField length check along with bug fixes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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
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 1978 matching lines...) Expand 10 before | Expand all | Expand 10 after
1989 void set_guarded_cid(intptr_t cid) const { 1989 void set_guarded_cid(intptr_t cid) const {
1990 raw_ptr()->guarded_cid_ = cid; 1990 raw_ptr()->guarded_cid_ = cid;
1991 } 1991 }
1992 static intptr_t guarded_cid_offset() { 1992 static intptr_t guarded_cid_offset() {
1993 return OFFSET_OF(RawField, guarded_cid_); 1993 return OFFSET_OF(RawField, guarded_cid_);
1994 } 1994 }
1995 // Return the list length that any list stored in this field is guaranteed 1995 // Return the list length that any list stored in this field is guaranteed
1996 // to have. If length is kUnknownFixedLength the length has not 1996 // to have. If length is kUnknownFixedLength the length has not
1997 // been determined. If length is kNoFixedLength this field has multiple 1997 // been determined. If length is kNoFixedLength this field has multiple
1998 // list lengths associated with it and cannot be predicted. 1998 // list lengths associated with it and cannot be predicted.
1999 intptr_t guarded_list_length() const { 1999 intptr_t guarded_list_length() const;
2000 return raw_ptr()->guarded_list_length_; 2000 void set_guarded_list_length(intptr_t list_length) const;
2001 }
2002 void set_guarded_list_length(intptr_t list_length) const {
2003 raw_ptr()->guarded_list_length_ = list_length;
2004 }
2005 static intptr_t guarded_list_length_offset() { 2001 static intptr_t guarded_list_length_offset() {
2006 return OFFSET_OF(RawField, guarded_list_length_); 2002 return OFFSET_OF(RawField, guarded_list_length_);
2007 } 2003 }
2008 bool needs_length_check() const { 2004 bool needs_length_check() const {
2009 const bool r = guarded_list_length() >= Field::kUnknownFixedLength; 2005 const bool r = guarded_list_length() >= Field::kUnknownFixedLength;
2010 ASSERT(!r || is_final()); 2006 ASSERT(!r || is_final());
2011 return r; 2007 return r;
2012 } 2008 }
2013 2009
2014 static bool IsExternalizableCid(intptr_t cid) { 2010 static bool IsExternalizableCid(intptr_t cid) {
(...skipping 4116 matching lines...) Expand 10 before | Expand all | Expand 10 after
6131 6127
6132 6128
6133 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6129 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6134 intptr_t index) { 6130 intptr_t index) {
6135 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6131 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6136 } 6132 }
6137 6133
6138 } // namespace dart 6134 } // namespace dart
6139 6135
6140 #endif // VM_OBJECT_H_ 6136 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698