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

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

Issue 898453009: Add missing call to VerifiedMemory::Accept when initializing Smi field. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 | no next file » | 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_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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 ValidateOverwrittenSmi(*addr); 514 ValidateOverwrittenSmi(*addr);
515 #endif // DEBUG 515 #endif // DEBUG
516 // Can't use Contains, as array length is initialized through this method. 516 // Can't use Contains, as array length is initialized through this method.
517 ASSERT(reinterpret_cast<uword>(addr) >= RawObject::ToAddr(this)); 517 ASSERT(reinterpret_cast<uword>(addr) >= RawObject::ToAddr(this));
518 VerifiedMemory::Write(const_cast<RawSmi**>(addr), value); 518 VerifiedMemory::Write(const_cast<RawSmi**>(addr), value);
519 } 519 }
520 520
521 void InitializeSmi(RawSmi* const* addr, RawSmi* value) { 521 void InitializeSmi(RawSmi* const* addr, RawSmi* value) {
522 // Can't use Contains, as array length is initialized through this method. 522 // Can't use Contains, as array length is initialized through this method.
523 ASSERT(reinterpret_cast<uword>(addr) >= RawObject::ToAddr(this)); 523 ASSERT(reinterpret_cast<uword>(addr) >= RawObject::ToAddr(this));
524 // This is an initializing store, so any previous content is OK.
525 VerifiedMemory::Accept(reinterpret_cast<uword>(addr), kWordSize);
524 VerifiedMemory::Write(const_cast<RawSmi**>(addr), value); 526 VerifiedMemory::Write(const_cast<RawSmi**>(addr), value);
525 } 527 }
526 528
527 #if defined(DEBUG) 529 #if defined(DEBUG)
528 static void ValidateOverwrittenPointer(RawObject* raw); 530 static void ValidateOverwrittenPointer(RawObject* raw);
529 static void ValidateOverwrittenSmi(RawSmi* raw); 531 static void ValidateOverwrittenSmi(RawSmi* raw);
530 #endif // DEBUG 532 #endif // DEBUG
531 533
532 friend class Api; 534 friend class Api;
533 friend class Array; 535 friend class Array;
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after
2157 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 2159 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
2158 kTypedDataInt8ArrayViewCid + 15); 2160 kTypedDataInt8ArrayViewCid + 15);
2159 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); 2161 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14);
2160 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); 2162 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1);
2161 return (kNullCid - kTypedDataInt8ArrayCid); 2163 return (kNullCid - kTypedDataInt8ArrayCid);
2162 } 2164 }
2163 2165
2164 } // namespace dart 2166 } // namespace dart
2165 2167
2166 #endif // VM_RAW_OBJECT_H_ 2168 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698