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

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

Issue 10905065: Revert r11772: Add check for non-smi to the IL and use it for class checks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | 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 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after
2107 return summary; 2107 return summary;
2108 } 2108 }
2109 2109
2110 2110
2111 void CheckClassComp::EmitNativeCode(FlowGraphCompiler* compiler) { 2111 void CheckClassComp::EmitNativeCode(FlowGraphCompiler* compiler) {
2112 Register value = locs()->in(0).reg(); 2112 Register value = locs()->in(0).reg();
2113 Register temp = locs()->temp(0).reg(); 2113 Register temp = locs()->temp(0).reg();
2114 Label* deopt = compiler->AddDeoptStub(deopt_id(), 2114 Label* deopt = compiler->AddDeoptStub(deopt_id(),
2115 kDeoptCheckClass); 2115 kDeoptCheckClass);
2116 ASSERT(unary_checks().GetReceiverClassIdAt(0) != kSmiCid); 2116 ASSERT(unary_checks().GetReceiverClassIdAt(0) != kSmiCid);
2117 __ testq(value, Immediate(kSmiTagMask));
2118 __ j(ZERO, deopt);
2117 __ LoadClassId(temp, value); 2119 __ LoadClassId(temp, value);
2118 Label is_ok; 2120 Label is_ok;
2119 const intptr_t num_checks = unary_checks().NumberOfChecks(); 2121 const intptr_t num_checks = unary_checks().NumberOfChecks();
2120 const bool use_near_jump = num_checks < 5; 2122 const bool use_near_jump = num_checks < 5;
2121 for (intptr_t i = 0; i < num_checks; i++) { 2123 for (intptr_t i = 0; i < num_checks; i++) {
2122 __ cmpl(temp, Immediate(unary_checks().GetReceiverClassIdAt(i))); 2124 __ cmpl(temp, Immediate(unary_checks().GetReceiverClassIdAt(i)));
2123 if (i == (num_checks - 1)) { 2125 if (i == (num_checks - 1)) {
2124 __ j(NOT_EQUAL, deopt); 2126 __ j(NOT_EQUAL, deopt);
2125 } else { 2127 } else {
2126 if (use_near_jump) { 2128 if (use_near_jump) {
(...skipping 12 matching lines...) Expand all
2139 const intptr_t kNumTemps = 0; 2141 const intptr_t kNumTemps = 0;
2140 LocationSummary* summary = 2142 LocationSummary* summary =
2141 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 2143 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2142 summary->set_in(0, Location::RequiresRegister()); 2144 summary->set_in(0, Location::RequiresRegister());
2143 return summary; 2145 return summary;
2144 } 2146 }
2145 2147
2146 2148
2147 void CheckSmiComp::EmitNativeCode(FlowGraphCompiler* compiler) { 2149 void CheckSmiComp::EmitNativeCode(FlowGraphCompiler* compiler) {
2148 Register value = locs()->in(0).reg(); 2150 Register value = locs()->in(0).reg();
2149 Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptCheckSmi); 2151 Label* deopt = compiler->AddDeoptStub(deopt_id(),
2152 kDeoptCheckSmi);
2150 __ testq(value, Immediate(kSmiTagMask)); 2153 __ testq(value, Immediate(kSmiTagMask));
2151 __ j(NOT_ZERO, deopt); 2154 __ j(NOT_ZERO, deopt);
2152 } 2155 }
2153 2156
2154 2157
2155 LocationSummary* CheckNonSmiComp::MakeLocationSummary() const {
2156 const intptr_t kNumInputs = 1;
2157 const intptr_t kNumTemps = 0;
2158 LocationSummary* summary =
2159 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2160 summary->set_in(0, Location::RequiresRegister());
2161 return summary;
2162 }
2163
2164
2165 void CheckNonSmiComp::EmitNativeCode(FlowGraphCompiler* compiler) {
2166 Register value = locs()->in(0).reg();
2167 Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptCheckNonSmi);
2168 __ testl(value, Immediate(kSmiTagMask));
2169 __ j(ZERO, deopt);
2170 }
2171
2172
2173 LocationSummary* CheckArrayBoundComp::MakeLocationSummary() const { 2158 LocationSummary* CheckArrayBoundComp::MakeLocationSummary() const {
2174 return LocationSummary::Make(2, 2159 return LocationSummary::Make(2,
2175 Location::NoLocation(), 2160 Location::NoLocation(),
2176 LocationSummary::kNoCall); 2161 LocationSummary::kNoCall);
2177 } 2162 }
2178 2163
2179 2164
2180 void CheckArrayBoundComp::EmitNativeCode(FlowGraphCompiler* compiler) { 2165 void CheckArrayBoundComp::EmitNativeCode(FlowGraphCompiler* compiler) {
2181 Register receiver = locs()->in(0).reg(); 2166 Register receiver = locs()->in(0).reg();
2182 Register index = locs()->in(1).reg(); 2167 Register index = locs()->in(1).reg();
(...skipping 15 matching lines...) Expand all
2198 } 2183 }
2199 __ j(ABOVE_EQUAL, deopt); 2184 __ j(ABOVE_EQUAL, deopt);
2200 } 2185 }
2201 2186
2202 2187
2203 } // namespace dart 2188 } // namespace dart
2204 2189
2205 #undef __ 2190 #undef __
2206 2191
2207 #endif // defined TARGET_ARCH_X64 2192 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698