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

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

Issue 2150933008: DBC: UnboxedConstantInstr (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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/flow_graph_compiler_dbc.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) 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 22 matching lines...) Expand all
33 M(LoadCodeUnits) \ 33 M(LoadCodeUnits) \
34 M(LoadUntagged) \ 34 M(LoadUntagged) \
35 M(AllocateUninitializedContext) \ 35 M(AllocateUninitializedContext) \
36 M(BinaryInt32Op) \ 36 M(BinaryInt32Op) \
37 M(Int32ToDouble) \ 37 M(Int32ToDouble) \
38 M(DoubleToInteger) \ 38 M(DoubleToInteger) \
39 M(DoubleToSmi) \ 39 M(DoubleToSmi) \
40 M(DoubleToDouble) \ 40 M(DoubleToDouble) \
41 M(DoubleToFloat) \ 41 M(DoubleToFloat) \
42 M(FloatToDouble) \ 42 M(FloatToDouble) \
43 M(UnboxedConstant) \
44 M(MathUnary) \ 43 M(MathUnary) \
45 M(MathMinMax) \ 44 M(MathMinMax) \
46 M(BoxInt64) \ 45 M(BoxInt64) \
47 M(InvokeMathCFunction) \ 46 M(InvokeMathCFunction) \
48 M(MergedMath) \ 47 M(MergedMath) \
49 M(GuardFieldClass) \ 48 M(GuardFieldClass) \
50 M(GuardFieldLength) \ 49 M(GuardFieldLength) \
51 M(IfThenElse) \ 50 M(IfThenElse) \
52 M(ExtractNthOutput) \ 51 M(ExtractNthOutput) \
53 M(BinaryUint32Op) \ 52 M(BinaryUint32Op) \
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 300
302 EMIT_NATIVE_CODE(Constant, 0, Location::RequiresRegister()) { 301 EMIT_NATIVE_CODE(Constant, 0, Location::RequiresRegister()) {
303 if (compiler->is_optimizing()) { 302 if (compiler->is_optimizing()) {
304 __ LoadConstant(locs()->out(0).reg(), value()); 303 __ LoadConstant(locs()->out(0).reg(), value());
305 } else { 304 } else {
306 __ PushConstant(value()); 305 __ PushConstant(value());
307 } 306 }
308 } 307 }
309 308
310 309
310 EMIT_NATIVE_CODE(UnboxedConstant, 0, Location::RequiresRegister()) {
311 // The register allocator drops constant definitions that have no uses.
312 if (locs()->out(0).IsInvalid()) {
313 return;
314 }
315 if (representation_ != kUnboxedDouble) {
316 Unsupported(compiler);
317 UNREACHABLE();
318 }
319 const Register result = locs()->out(0).reg();
320 if (Utils::DoublesBitEqual(Double::Cast(value()).value(), 0.0)) {
321 __ BitXor(result, result, result);
322 } else {
323 __ LoadConstant(result, value());
324 __ UnboxDouble(result, result);
325 }
326 }
327
328
311 EMIT_NATIVE_CODE(Return, 1) { 329 EMIT_NATIVE_CODE(Return, 1) {
312 if (compiler->is_optimizing()) { 330 if (compiler->is_optimizing()) {
313 __ Return(locs()->in(0).reg()); 331 __ Return(locs()->in(0).reg());
314 } else { 332 } else {
315 __ ReturnTOS(); 333 __ ReturnTOS();
316 } 334 }
317 } 335 }
318 336
319 337
320 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary( 338 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1438 __ IfULe(length, index); 1456 __ IfULe(length, index);
1439 compiler->EmitDeopt(deopt_id(), 1457 compiler->EmitDeopt(deopt_id(),
1440 ICData::kDeoptCheckArrayBound, 1458 ICData::kDeoptCheckArrayBound,
1441 (generalized_ ? ICData::kGeneralized : 0) | 1459 (generalized_ ? ICData::kGeneralized : 0) |
1442 (licm_hoisted_ ? ICData::kHoisted : 0)); 1460 (licm_hoisted_ ? ICData::kHoisted : 0));
1443 } 1461 }
1444 1462
1445 } // namespace dart 1463 } // namespace dart
1446 1464
1447 #endif // defined TARGET_ARCH_DBC 1465 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_dbc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698