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

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

Issue 2104093003: DBC: Implement OneByteStringFromCharCode and StringToCharCode. (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/constants_dbc.h ('k') | runtime/vm/simulator_dbc.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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 M(BinaryDoubleOp) \ 48 M(BinaryDoubleOp) \
49 M(MathUnary) \ 49 M(MathUnary) \
50 M(MathMinMax) \ 50 M(MathMinMax) \
51 M(Box) \ 51 M(Box) \
52 M(Unbox) \ 52 M(Unbox) \
53 M(BoxInt64) \ 53 M(BoxInt64) \
54 M(CaseInsensitiveCompareUC16) \ 54 M(CaseInsensitiveCompareUC16) \
55 M(BinaryMintOp) \ 55 M(BinaryMintOp) \
56 M(ShiftMintOp) \ 56 M(ShiftMintOp) \
57 M(UnaryMintOp) \ 57 M(UnaryMintOp) \
58 M(StringToCharCode) \
59 M(OneByteStringFromCharCode) \
60 M(InvokeMathCFunction) \ 58 M(InvokeMathCFunction) \
61 M(MergedMath) \ 59 M(MergedMath) \
62 M(GuardFieldClass) \ 60 M(GuardFieldClass) \
63 M(GuardFieldLength) \ 61 M(GuardFieldLength) \
64 M(IfThenElse) \ 62 M(IfThenElse) \
65 M(BinaryFloat32x4Op) \ 63 M(BinaryFloat32x4Op) \
66 M(Simd32x4Shuffle) \ 64 M(Simd32x4Shuffle) \
67 M(Simd32x4ShuffleMix) \ 65 M(Simd32x4ShuffleMix) \
68 M(Simd32x4GetSignMask) \ 66 M(Simd32x4GetSignMask) \
69 M(Float32x4Constructor) \ 67 M(Float32x4Constructor) \
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 } else { 590 } else {
593 __ NativeCall(); 591 __ NativeCall();
594 } 592 }
595 compiler->RecordSafepoint(locs()); 593 compiler->RecordSafepoint(locs());
596 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, 594 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
597 Thread::kNoDeoptId, 595 Thread::kNoDeoptId,
598 token_pos()); 596 token_pos());
599 } 597 }
600 598
601 599
600 EMIT_NATIVE_CODE(OneByteStringFromCharCode,
601 1, Location::RequiresRegister(),
602 LocationSummary::kNoCall) {
603 ASSERT(compiler->is_optimizing());
604 const Register char_code = locs()->in(0).reg(); // Char code is a smi.
605 const Register result = locs()->out(0).reg();
606 __ OneByteStringFromCharCode(result, char_code);
607 }
608
609
610 EMIT_NATIVE_CODE(StringToCharCode,
611 1, Location::RequiresRegister(),
612 LocationSummary::kNoCall) {
613 ASSERT(cid_ == kOneByteStringCid);
614 const Register str = locs()->in(0).reg();
615 const Register result = locs()->out(0).reg(); // Result char code is a smi.
616 __ StringToCharCode(result, str);
617 }
618
619
620
602 EMIT_NATIVE_CODE(AllocateObject, 621 EMIT_NATIVE_CODE(AllocateObject,
603 0, Location::RequiresRegister(), 622 0, Location::RequiresRegister(),
604 LocationSummary::kCall) { 623 LocationSummary::kCall) {
605 if (ArgumentCount() == 1) { 624 if (ArgumentCount() == 1) {
606 __ PushConstant(cls()); 625 __ PushConstant(cls());
607 __ AllocateT(); 626 __ AllocateT();
608 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, 627 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
609 Thread::kNoDeoptId, 628 Thread::kNoDeoptId,
610 token_pos()); 629 token_pos());
611 } else { 630 } else {
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 __ BitNot(locs()->out(0).reg(), locs()->in(0).reg()); 1058 __ BitNot(locs()->out(0).reg(), locs()->in(0).reg());
1040 break; 1059 break;
1041 default: 1060 default:
1042 UNREACHABLE(); 1061 UNREACHABLE();
1043 } 1062 }
1044 } 1063 }
1045 1064
1046 } // namespace dart 1065 } // namespace dart
1047 1066
1048 #endif // defined TARGET_ARCH_DBC 1067 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/constants_dbc.h ('k') | runtime/vm/simulator_dbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698