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

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

Issue 11416129: Inline [] operator on one-byte strings. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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') | runtime/vm/symbols.h » ('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) 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 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 // Don't untag smi-index and use TIMES_1 for two byte strings. 985 // Don't untag smi-index and use TIMES_1 for two byte strings.
986 __ movzxw(result, FieldAddress(str, 986 __ movzxw(result, FieldAddress(str,
987 index, 987 index,
988 TIMES_1, 988 TIMES_1,
989 TwoByteString::data_offset())); 989 TwoByteString::data_offset()));
990 __ SmiTag(result); 990 __ SmiTag(result);
991 } 991 }
992 } 992 }
993 993
994 994
995 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const {
996 const intptr_t kNumInputs = 1;
997 const intptr_t kNumTemps = 0;
998 LocationSummary* locs =
999 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
1000 // TODO(fschneider): Allow immediate operands for the char code.
1001 locs->set_in(0, Location::RequiresRegister());
1002 locs->set_out(Location::RequiresRegister());
1003 return locs;
1004 }
1005
1006
1007 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1008 Register char_code = locs()->in(0).reg();
1009 Register result = locs()->out().reg();
1010 __ movq(result,
1011 Immediate(reinterpret_cast<uword>(Symbols::PredefinedAddress())));
1012 __ movq(result, Address(result,
1013 char_code,
1014 TIMES_HALF_WORD_SIZE, // Char code is a smi.
1015 Symbols::kNullCharId * kWordSize));
1016 }
1017
1018
995 LocationSummary* LoadIndexedInstr::MakeLocationSummary() const { 1019 LocationSummary* LoadIndexedInstr::MakeLocationSummary() const {
996 const intptr_t kNumInputs = 2; 1020 const intptr_t kNumInputs = 2;
997 const intptr_t kNumTemps = 0; 1021 const intptr_t kNumTemps = 0;
998 LocationSummary* locs = 1022 LocationSummary* locs =
999 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 1023 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
1000 locs->set_in(0, Location::RequiresRegister()); 1024 locs->set_in(0, Location::RequiresRegister());
1001 locs->set_in(1, CanBeImmediateIndex(index()) 1025 locs->set_in(1, CanBeImmediateIndex(index())
1002 ? Location::RegisterOrConstant(index()) 1026 ? Location::RegisterOrConstant(index())
1003 : Location::RequiresRegister()); 1027 : Location::RequiresRegister());
1004 if (representation() == kUnboxedDouble) { 1028 if (representation() == kUnboxedDouble) {
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
2373 2397
2374 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2398 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2375 UNIMPLEMENTED(); 2399 UNIMPLEMENTED();
2376 } 2400 }
2377 2401
2378 } // namespace dart 2402 } // namespace dart
2379 2403
2380 #undef __ 2404 #undef __
2381 2405
2382 #endif // defined TARGET_ARCH_X64 2406 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698