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

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

Issue 1253373002: VM: Hoist handle allocation out of loop when creating the object pool. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « runtime/vm/assembler.cc ('k') | 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 3551 matching lines...) Expand 10 before | Expand all | Expand 10 after
3562 static intptr_t length_offset() { return OFFSET_OF(RawObjectPool, length_); } 3562 static intptr_t length_offset() { return OFFSET_OF(RawObjectPool, length_); }
3563 static intptr_t data_offset() { 3563 static intptr_t data_offset() {
3564 return OFFSET_OF_RETURNED_VALUE(RawObjectPool, data); 3564 return OFFSET_OF_RETURNED_VALUE(RawObjectPool, data);
3565 } 3565 }
3566 static intptr_t element_offset(intptr_t index) { 3566 static intptr_t element_offset(intptr_t index) {
3567 return OFFSET_OF_RETURNED_VALUE(RawObjectPool, data) 3567 return OFFSET_OF_RETURNED_VALUE(RawObjectPool, data)
3568 + kBytesPerElement * index; 3568 + kBytesPerElement * index;
3569 } 3569 }
3570 3570
3571 EntryType InfoAt(intptr_t index) const; 3571 EntryType InfoAt(intptr_t index) const;
3572 void SetInfoAt(intptr_t index, EntryType info) const;
3573 3572
3574 RawObject* ObjectAt(intptr_t index) const { 3573 RawObject* ObjectAt(intptr_t index) const {
3575 ASSERT(InfoAt(index) == kTaggedObject); 3574 ASSERT(InfoAt(index) == kTaggedObject);
3576 return EntryAddr(index)->raw_obj_; 3575 return EntryAddr(index)->raw_obj_;
3577 } 3576 }
3578 void SetObjectAt(intptr_t index, const Object& obj) const { 3577 void SetObjectAt(intptr_t index, const Object& obj) const {
3579 ASSERT(InfoAt(index) == kTaggedObject); 3578 ASSERT(InfoAt(index) == kTaggedObject);
3580 StorePointer(&EntryAddr(index)->raw_obj_, obj.raw()); 3579 StorePointer(&EntryAddr(index)->raw_obj_, obj.raw());
3581 } 3580 }
3582 3581
(...skipping 4429 matching lines...) Expand 10 before | Expand all | Expand 10 after
8012 8011
8013 8012
8014 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 8013 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
8015 intptr_t index) { 8014 intptr_t index) {
8016 return array.At((index * kEntryLength) + kTargetFunctionIndex); 8015 return array.At((index * kEntryLength) + kTargetFunctionIndex);
8017 } 8016 }
8018 8017
8019 } // namespace dart 8018 } // namespace dart
8020 8019
8021 #endif // VM_OBJECT_H_ 8020 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/assembler.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698