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

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

Issue 2954453002: VM: Reland Inline instance object hash code into object header on 64bit. (Closed)
Patch Set: Incorporate last minute code review feedback 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 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 Location::RequiresRegister(), 1005 Location::RequiresRegister(),
1006 LocationSummary::kCall) { 1006 LocationSummary::kCall) {
1007 if (ArgumentCount() == 1) { 1007 if (ArgumentCount() == 1) {
1008 // Allocate with type arguments. 1008 // Allocate with type arguments.
1009 if (compiler->is_optimizing()) { 1009 if (compiler->is_optimizing()) {
1010 // If we're optimizing, try a streamlined fastpath. 1010 // If we're optimizing, try a streamlined fastpath.
1011 const intptr_t instance_size = cls().instance_size(); 1011 const intptr_t instance_size = cls().instance_size();
1012 Isolate* isolate = Isolate::Current(); 1012 Isolate* isolate = Isolate::Current();
1013 if (Heap::IsAllocatableInNewSpace(instance_size) && 1013 if (Heap::IsAllocatableInNewSpace(instance_size) &&
1014 !cls().TraceAllocation(isolate)) { 1014 !cls().TraceAllocation(isolate)) {
1015 uword tags = 0; 1015 uint32_t tags = 0;
1016 tags = RawObject::SizeTag::update(instance_size, tags); 1016 tags = RawObject::SizeTag::update(instance_size, tags);
1017 ASSERT(cls().id() != kIllegalCid); 1017 ASSERT(cls().id() != kIllegalCid);
1018 tags = RawObject::ClassIdTag::update(cls().id(), tags); 1018 tags = RawObject::ClassIdTag::update(cls().id(), tags);
1019 if (Smi::IsValid(tags)) { 1019 if (Smi::IsValid(tags)) {
1020 const intptr_t tags_kidx = 1020 const intptr_t tags_kidx =
1021 __ AddConstant(Smi::Handle(Smi::New(tags))); 1021 __ AddConstant(Smi::Handle(Smi::New(tags)));
1022 __ AllocateTOpt(locs()->out(0).reg(), tags_kidx); 1022 __ AllocateTOpt(locs()->out(0).reg(), tags_kidx);
1023 __ Nop(cls().type_arguments_field_offset()); 1023 __ Nop(cls().type_arguments_field_offset());
1024 } 1024 }
1025 } 1025 }
(...skipping 13 matching lines...) Expand all
1039 } else if (compiler->is_optimizing()) { 1039 } else if (compiler->is_optimizing()) {
1040 // If we're optimizing, try a streamlined fastpath. 1040 // If we're optimizing, try a streamlined fastpath.
1041 const intptr_t instance_size = cls().instance_size(); 1041 const intptr_t instance_size = cls().instance_size();
1042 Isolate* isolate = Isolate::Current(); 1042 Isolate* isolate = Isolate::Current();
1043 if (Heap::IsAllocatableInNewSpace(instance_size) && 1043 if (Heap::IsAllocatableInNewSpace(instance_size) &&
1044 !cls().TraceAllocation(isolate)) { 1044 !cls().TraceAllocation(isolate)) {
1045 uword tags = 0; 1045 uword tags = 0;
1046 tags = RawObject::SizeTag::update(instance_size, tags); 1046 tags = RawObject::SizeTag::update(instance_size, tags);
1047 ASSERT(cls().id() != kIllegalCid); 1047 ASSERT(cls().id() != kIllegalCid);
1048 tags = RawObject::ClassIdTag::update(cls().id(), tags); 1048 tags = RawObject::ClassIdTag::update(cls().id(), tags);
1049 // tags also has the initial zero hash code on 64 bit.
1049 if (Smi::IsValid(tags)) { 1050 if (Smi::IsValid(tags)) {
1050 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags))); 1051 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags)));
1051 __ AllocateOpt(locs()->out(0).reg(), tags_kidx); 1052 __ AllocateOpt(locs()->out(0).reg(), tags_kidx);
1052 } 1053 }
1053 } 1054 }
1054 const intptr_t kidx = __ AddConstant(cls()); 1055 const intptr_t kidx = __ AddConstant(cls());
1055 __ Allocate(kidx); 1056 __ Allocate(kidx);
1056 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, 1057 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
1057 token_pos()); 1058 token_pos());
1058 compiler->RecordSafepoint(locs()); 1059 compiler->RecordSafepoint(locs());
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
1650 ASSERT(from_representation() == kUnboxedDouble); 1651 ASSERT(from_representation() == kUnboxedDouble);
1651 const Register value = locs()->in(0).reg(); 1652 const Register value = locs()->in(0).reg();
1652 const Register out = locs()->out(0).reg(); 1653 const Register out = locs()->out(0).reg();
1653 const intptr_t instance_size = compiler->double_class().instance_size(); 1654 const intptr_t instance_size = compiler->double_class().instance_size();
1654 Isolate* isolate = Isolate::Current(); 1655 Isolate* isolate = Isolate::Current();
1655 ASSERT(Heap::IsAllocatableInNewSpace(instance_size)); 1656 ASSERT(Heap::IsAllocatableInNewSpace(instance_size));
1656 if (!compiler->double_class().TraceAllocation(isolate)) { 1657 if (!compiler->double_class().TraceAllocation(isolate)) {
1657 uword tags = 0; 1658 uword tags = 0;
1658 tags = RawObject::SizeTag::update(instance_size, tags); 1659 tags = RawObject::SizeTag::update(instance_size, tags);
1659 tags = RawObject::ClassIdTag::update(compiler->double_class().id(), tags); 1660 tags = RawObject::ClassIdTag::update(compiler->double_class().id(), tags);
1661 // tags also has the initial zero hash code on 64 bit.
1660 if (Smi::IsValid(tags)) { 1662 if (Smi::IsValid(tags)) {
1661 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags))); 1663 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags)));
1662 __ AllocateOpt(out, tags_kidx); 1664 __ AllocateOpt(out, tags_kidx);
1663 } 1665 }
1664 } 1666 }
1665 const intptr_t kidx = __ AddConstant(compiler->double_class()); 1667 const intptr_t kidx = __ AddConstant(compiler->double_class());
1666 __ Allocate(kidx); 1668 __ Allocate(kidx);
1667 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, 1669 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
1668 token_pos()); 1670 token_pos());
1669 compiler->RecordSafepoint(locs()); 1671 compiler->RecordSafepoint(locs());
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
2064 } 2066 }
2065 __ IfULe(length, index); 2067 __ IfULe(length, index);
2066 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound, 2068 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound,
2067 (generalized_ ? ICData::kGeneralized : 0) | 2069 (generalized_ ? ICData::kGeneralized : 0) |
2068 (licm_hoisted_ ? ICData::kHoisted : 0)); 2070 (licm_hoisted_ ? ICData::kHoisted : 0));
2069 } 2071 }
2070 2072
2071 } // namespace dart 2073 } // namespace dart
2072 2074
2073 #endif // defined TARGET_ARCH_DBC 2075 #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