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

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

Issue 533483003: Cleanup throwing of the RangeError in the runtime to remove duplicated code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 6217 matching lines...) Expand 10 before | Expand all | Expand 10 after
6228 // Return an Array object that contains all the elements currently present 6228 // Return an Array object that contains all the elements currently present
6229 // in the specified Growable Object Array. This is done by first truncating 6229 // in the specified Growable Object Array. This is done by first truncating
6230 // the Growable Object Array's backing array to the currently used size and 6230 // the Growable Object Array's backing array to the currently used size and
6231 // returning the truncated backing array. 6231 // returning the truncated backing array.
6232 // The remaining unused part of the backing array is marked as an Array 6232 // The remaining unused part of the backing array is marked as an Array
6233 // object or a regular Object so that it can be traversed during garbage 6233 // object or a regular Object so that it can be traversed during garbage
6234 // collection. The backing array of the original Growable Object Array is 6234 // collection. The backing array of the original Growable Object Array is
6235 // set to an empty array. 6235 // set to an empty array.
6236 static RawArray* MakeArray(const GrowableObjectArray& growable_array); 6236 static RawArray* MakeArray(const GrowableObjectArray& growable_array);
6237 6237
6238 void CopyFrom(intptr_t dst_start,
6239 const Array& source,
6240 intptr_t src_start,
6241 intptr_t count) const;
6242
6238 protected: 6243 protected:
6239 static RawArray* New(intptr_t class_id, 6244 static RawArray* New(intptr_t class_id,
6240 intptr_t len, 6245 intptr_t len,
6241 Heap::Space space = Heap::kNew); 6246 Heap::Space space = Heap::kNew);
6242 6247
6243 private: 6248 private:
6244 RawObject** ObjectAddr(intptr_t index) const { 6249 RawObject** ObjectAddr(intptr_t index) const {
6245 // TODO(iposva): Determine if we should throw an exception here. 6250 // TODO(iposva): Determine if we should throw an exception here.
6246 ASSERT((index >= 0) && (index < Length())); 6251 ASSERT((index >= 0) && (index < Length()));
6247 return &raw_ptr()->data()[index]; 6252 return &raw_ptr()->data()[index];
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after
7409 7414
7410 7415
7411 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7416 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7412 intptr_t index) { 7417 intptr_t index) {
7413 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7418 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7414 } 7419 }
7415 7420
7416 } // namespace dart 7421 } // namespace dart
7417 7422
7418 #endif // VM_OBJECT_H_ 7423 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698