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

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

Issue 2039913006: DBC: Eager deoptimization and CheckSmi instruction. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 M(ExtractNthOutput) \ 101 M(ExtractNthOutput) \
102 M(BinaryUint32Op) \ 102 M(BinaryUint32Op) \
103 M(ShiftUint32Op) \ 103 M(ShiftUint32Op) \
104 M(UnaryUint32Op) \ 104 M(UnaryUint32Op) \
105 M(UnboxedIntConverter) \ 105 M(UnboxedIntConverter) \
106 M(GrowRegExpStack) \ 106 M(GrowRegExpStack) \
107 M(BoxInteger32) \ 107 M(BoxInteger32) \
108 M(UnboxInteger32) \ 108 M(UnboxInteger32) \
109 M(CheckedSmiOp) \ 109 M(CheckedSmiOp) \
110 M(CheckArrayBound) \ 110 M(CheckArrayBound) \
111 M(CheckSmi) \ 111 M(BinarySmiOp) \
112 M(CheckClassId) \ 112 M(CheckClassId) \
113 M(CheckClass) \ 113 M(CheckClass) \
114 M(BinarySmiOp) \
115 M(TestSmi) \ 114 M(TestSmi) \
116 M(RelationalOp) \ 115 M(RelationalOp) \
117 M(EqualityCompare) \ 116 M(EqualityCompare) \
118 M(LoadIndexed) 117 M(LoadIndexed)
119 118
120 // Location summaries actually are not used by the unoptimizing DBC compiler 119 // Location summaries actually are not used by the unoptimizing DBC compiler
121 // because we don't allocate any registers. 120 // because we don't allocate any registers.
122 static LocationSummary* CreateLocationSummary( 121 static LocationSummary* CreateLocationSummary(
123 Zone* zone, 122 Zone* zone,
124 intptr_t num_inputs, 123 intptr_t num_inputs,
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 default: 842 default:
844 UNREACHABLE(); 843 UNREACHABLE();
845 return kTagged; 844 return kTagged;
846 } 845 }
847 } 846 }
848 847
849 848
850 Representation StoreIndexedInstr::RequiredInputRepresentation( 849 Representation StoreIndexedInstr::RequiredInputRepresentation(
851 intptr_t idx) const { 850 intptr_t idx) const {
852 // Array can be a Dart object or a pointer to external data. 851 // Array can be a Dart object or a pointer to external data.
853 if (idx == 0) return kNoRepresentation; // Flexible input representation. 852 if (idx == 0) {
854 if (idx == 1) return kTagged; // Index is a smi. 853 return kNoRepresentation; // Flexible input representation.
854 }
855 if (idx == 1) {
856 return kTagged; // Index is a smi.
857 }
855 ASSERT(idx == 2); 858 ASSERT(idx == 2);
856 switch (class_id_) { 859 switch (class_id_) {
857 case kArrayCid: 860 case kArrayCid:
858 case kOneByteStringCid: 861 case kOneByteStringCid:
859 case kTwoByteStringCid: 862 case kTwoByteStringCid:
860 case kExternalOneByteStringCid: 863 case kExternalOneByteStringCid:
861 case kExternalTwoByteStringCid: 864 case kExternalTwoByteStringCid:
862 case kTypedDataInt8ArrayCid: 865 case kTypedDataInt8ArrayCid:
863 case kTypedDataUint8ArrayCid: 866 case kTypedDataUint8ArrayCid:
864 case kExternalTypedDataUint8ArrayCid: 867 case kExternalTypedDataUint8ArrayCid:
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 // environment. 899 // environment.
897 ASSERT(argc <= values_.length()); 900 ASSERT(argc <= values_.length());
898 for (intptr_t i = 0; i < argc; i++) { 901 for (intptr_t i = 0; i < argc; i++) {
899 ASSERT(values_[values_.length() - i - 1]->definition()->IsPushArgument()); 902 ASSERT(values_[values_.length() - i - 1]->definition()->IsPushArgument());
900 } 903 }
901 #endif 904 #endif
902 values_.TruncateTo(values_.length() - argc); 905 values_.TruncateTo(values_.length() - argc);
903 } 906 }
904 907
905 908
909 EMIT_NATIVE_CODE(CheckSmi, 1) {
910 Label* deopt = compiler->AddDeoptStub(deopt_id(),
911 ICData::kDeoptCheckSmi,
912 licm_hoisted_ ? ICData::kHoisted : 0);
913 __ Push(locs()->in(0).reg());
zra 2016/06/07 22:31:28 Thoughts about adding an instruction for this that
Vyacheslav Egorov (Google) 2016/06/08 11:58:53 Yes, I think this should be just a special bytecod
zra 2016/06/08 17:46:30 Done.
914 __ LoadClassIdTOS();
915 __ PushConstant(Smi::Handle(Smi::New(kSmiCid)));
916 __ IfNeStrictTOS();
917 __ Jump(deopt);
Vyacheslav Egorov (Google) 2016/06/08 11:58:53 __ Jump(deopt) could just be __ Deopt(...)
zra 2016/06/08 17:46:30 Done.
918 }
919
906 } // namespace dart 920 } // namespace dart
907 921
908 #endif // defined TARGET_ARCH_DBC 922 #endif // defined TARGET_ARCH_DBC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698