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

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

Issue 2556193003: VM: Make precompiler process constants/fields only once, avoid using pool.InfoAt() (Closed)
Patch Set: Created 4 years 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
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 RUNTIME_VM_OBJECT_H_ 5 #ifndef RUNTIME_VM_OBJECT_H_
6 #define RUNTIME_VM_OBJECT_H_ 6 #define RUNTIME_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 8637 matching lines...) Expand 10 before | Expand all | Expand 10 after
8648 8648
8649 void set_label(const String& tag_label) const { 8649 void set_label(const String& tag_label) const {
8650 StorePointer(&raw_ptr()->label_, tag_label.raw()); 8650 StorePointer(&raw_ptr()->label_, tag_label.raw());
8651 } 8651 }
8652 8652
8653 FINAL_HEAP_OBJECT_IMPLEMENTATION(UserTag, Instance); 8653 FINAL_HEAP_OBJECT_IMPLEMENTATION(UserTag, Instance);
8654 friend class Class; 8654 friend class Class;
8655 }; 8655 };
8656 8656
8657 8657
8658 class ObjectPoolInfo {
Florian Schneider 2016/12/08 18:30:45 : public ValueObject
kustermann 2016/12/08 19:14:38 Done.
8659 public:
8660 explicit ObjectPoolInfo(const ObjectPool& pool)
8661 : array_(TypedData::Handle(pool.info_array())) {}
8662
8663 explicit ObjectPoolInfo(const TypedData& info_array) : array_(info_array) {}
Florian Schneider 2016/12/08 18:30:45 Not needed?
kustermann 2016/12/08 19:14:38 See comment on call site. Using this constructor m
8664
8665 ObjectPool::EntryType InfoAt(intptr_t i) {
8666 return static_cast<ObjectPool::EntryType>(array_.GetInt8(i));
8667 }
8668
8669 void SetInfoAt(intptr_t i, ObjectPool::EntryType info) {
8670 array_.SetInt8(i, static_cast<int8_t>(info));
8671 }
8672
8673 private:
8674 const TypedData& array_;
8675 };
8676
8677
8658 // Breaking cycles and loops. 8678 // Breaking cycles and loops.
8659 RawClass* Object::clazz() const { 8679 RawClass* Object::clazz() const {
8660 uword raw_value = reinterpret_cast<uword>(raw_); 8680 uword raw_value = reinterpret_cast<uword>(raw_);
8661 if ((raw_value & kSmiTagMask) == kSmiTag) { 8681 if ((raw_value & kSmiTagMask) == kSmiTag) {
8662 return Smi::Class(); 8682 return Smi::Class();
8663 } 8683 }
8664 return Isolate::Current()->class_table()->At(raw()->GetClassId()); 8684 return Isolate::Current()->class_table()->At(raw()->GetClassId());
8665 } 8685 }
8666 8686
8667 8687
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
8866 8886
8867 inline void TypeArguments::SetHash(intptr_t value) const { 8887 inline void TypeArguments::SetHash(intptr_t value) const {
8868 // This is only safe because we create a new Smi, which does not cause 8888 // This is only safe because we create a new Smi, which does not cause
8869 // heap allocation. 8889 // heap allocation.
8870 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8890 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8871 } 8891 }
8872 8892
8873 } // namespace dart 8893 } // namespace dart
8874 8894
8875 #endif // RUNTIME_VM_OBJECT_H_ 8895 #endif // RUNTIME_VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/assembler.cc ('k') | runtime/vm/object.cc » ('j') | runtime/vm/precompiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698