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

Side by Side Diff: runtime/vm/intermediate_language_dbc.cc

Issue 2912863006: Inline instance object hash code into object header on 64 bit. (Closed)
Patch Set: Add assembler tests and other feedback from Ryan Created 3 years, 6 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/heap.cc ('k') | runtime/vm/intrinsifier_arm64.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC.
6 #if defined(TARGET_ARCH_DBC) 6 #if defined(TARGET_ARCH_DBC)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 Location::RequiresRegister(), 987 Location::RequiresRegister(),
988 LocationSummary::kCall) { 988 LocationSummary::kCall) {
989 if (ArgumentCount() == 1) { 989 if (ArgumentCount() == 1) {
990 // Allocate with type arguments. 990 // Allocate with type arguments.
991 if (compiler->is_optimizing()) { 991 if (compiler->is_optimizing()) {
992 // If we're optimizing, try a streamlined fastpath. 992 // If we're optimizing, try a streamlined fastpath.
993 const intptr_t instance_size = cls().instance_size(); 993 const intptr_t instance_size = cls().instance_size();
994 Isolate* isolate = Isolate::Current(); 994 Isolate* isolate = Isolate::Current();
995 if (Heap::IsAllocatableInNewSpace(instance_size) && 995 if (Heap::IsAllocatableInNewSpace(instance_size) &&
996 !cls().TraceAllocation(isolate)) { 996 !cls().TraceAllocation(isolate)) {
997 uword tags = 0; 997 uint32_t tags = 0;
998 tags = RawObject::SizeTag::update(instance_size, tags); 998 tags = RawObject::SizeTag::update(instance_size, tags);
999 ASSERT(cls().id() != kIllegalCid); 999 ASSERT(cls().id() != kIllegalCid);
1000 tags = RawObject::ClassIdTag::update(cls().id(), tags); 1000 tags = RawObject::ClassIdTag::update(cls().id(), tags);
1001 if (Smi::IsValid(tags)) { 1001 if (Smi::IsValid(tags)) {
1002 const intptr_t tags_kidx = 1002 const intptr_t tags_kidx =
1003 __ AddConstant(Smi::Handle(Smi::New(tags))); 1003 __ AddConstant(Smi::Handle(Smi::New(tags)));
1004 __ AllocateTOpt(locs()->out(0).reg(), tags_kidx); 1004 __ AllocateTOpt(locs()->out(0).reg(), tags_kidx);
1005 __ Nop(cls().type_arguments_field_offset()); 1005 __ Nop(cls().type_arguments_field_offset());
1006 } 1006 }
1007 } 1007 }
(...skipping 13 matching lines...) Expand all
1021 } else if (compiler->is_optimizing()) { 1021 } else if (compiler->is_optimizing()) {
1022 // If we're optimizing, try a streamlined fastpath. 1022 // If we're optimizing, try a streamlined fastpath.
1023 const intptr_t instance_size = cls().instance_size(); 1023 const intptr_t instance_size = cls().instance_size();
1024 Isolate* isolate = Isolate::Current(); 1024 Isolate* isolate = Isolate::Current();
1025 if (Heap::IsAllocatableInNewSpace(instance_size) && 1025 if (Heap::IsAllocatableInNewSpace(instance_size) &&
1026 !cls().TraceAllocation(isolate)) { 1026 !cls().TraceAllocation(isolate)) {
1027 uword tags = 0; 1027 uword tags = 0;
1028 tags = RawObject::SizeTag::update(instance_size, tags); 1028 tags = RawObject::SizeTag::update(instance_size, tags);
1029 ASSERT(cls().id() != kIllegalCid); 1029 ASSERT(cls().id() != kIllegalCid);
1030 tags = RawObject::ClassIdTag::update(cls().id(), tags); 1030 tags = RawObject::ClassIdTag::update(cls().id(), tags);
1031 // tags also has the initial zero hash code on 64 bit.
1031 if (Smi::IsValid(tags)) { 1032 if (Smi::IsValid(tags)) {
1032 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags))); 1033 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags)));
1033 __ AllocateOpt(locs()->out(0).reg(), tags_kidx); 1034 __ AllocateOpt(locs()->out(0).reg(), tags_kidx);
1034 } 1035 }
1035 } 1036 }
1036 const intptr_t kidx = __ AddConstant(cls()); 1037 const intptr_t kidx = __ AddConstant(cls());
1037 __ Allocate(kidx); 1038 __ Allocate(kidx);
1038 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, 1039 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
1039 token_pos()); 1040 token_pos());
1040 compiler->RecordSafepoint(locs()); 1041 compiler->RecordSafepoint(locs());
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
1632 ASSERT(from_representation() == kUnboxedDouble); 1633 ASSERT(from_representation() == kUnboxedDouble);
1633 const Register value = locs()->in(0).reg(); 1634 const Register value = locs()->in(0).reg();
1634 const Register out = locs()->out(0).reg(); 1635 const Register out = locs()->out(0).reg();
1635 const intptr_t instance_size = compiler->double_class().instance_size(); 1636 const intptr_t instance_size = compiler->double_class().instance_size();
1636 Isolate* isolate = Isolate::Current(); 1637 Isolate* isolate = Isolate::Current();
1637 ASSERT(Heap::IsAllocatableInNewSpace(instance_size)); 1638 ASSERT(Heap::IsAllocatableInNewSpace(instance_size));
1638 if (!compiler->double_class().TraceAllocation(isolate)) { 1639 if (!compiler->double_class().TraceAllocation(isolate)) {
1639 uword tags = 0; 1640 uword tags = 0;
1640 tags = RawObject::SizeTag::update(instance_size, tags); 1641 tags = RawObject::SizeTag::update(instance_size, tags);
1641 tags = RawObject::ClassIdTag::update(compiler->double_class().id(), tags); 1642 tags = RawObject::ClassIdTag::update(compiler->double_class().id(), tags);
1643 // tags also has the initial zero hash code on 64 bit.
1642 if (Smi::IsValid(tags)) { 1644 if (Smi::IsValid(tags)) {
1643 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags))); 1645 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags)));
1644 __ AllocateOpt(out, tags_kidx); 1646 __ AllocateOpt(out, tags_kidx);
1645 } 1647 }
1646 } 1648 }
1647 const intptr_t kidx = __ AddConstant(compiler->double_class()); 1649 const intptr_t kidx = __ AddConstant(compiler->double_class());
1648 __ Allocate(kidx); 1650 __ Allocate(kidx);
1649 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, 1651 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
1650 token_pos()); 1652 token_pos());
1651 compiler->RecordSafepoint(locs()); 1653 compiler->RecordSafepoint(locs());
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
2076 } 2078 }
2077 __ IfULe(length, index); 2079 __ IfULe(length, index);
2078 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound, 2080 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound,
2079 (generalized_ ? ICData::kGeneralized : 0) | 2081 (generalized_ ? ICData::kGeneralized : 0) |
2080 (licm_hoisted_ ? ICData::kHoisted : 0)); 2082 (licm_hoisted_ ? ICData::kHoisted : 0));
2081 } 2083 }
2082 2084
2083 } // namespace dart 2085 } // namespace dart
2084 2086
2085 #endif // defined TARGET_ARCH_DBC 2087 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/intrinsifier_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698