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

Side by Side Diff: src/x64/macro-assembler-x64.h

Issue 6729016: Implemented FastAsciiStringJoin in X64 full codegen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 9 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 LabelType* on_smi_result); 463 LabelType* on_smi_result);
464 464
465 // Adds smi values and return the result as a smi. 465 // Adds smi values and return the result as a smi.
466 // If dst is src1, then src1 will be destroyed, even if 466 // If dst is src1, then src1 will be destroyed, even if
467 // the operation is unsuccessful. 467 // the operation is unsuccessful.
468 template <typename LabelType> 468 template <typename LabelType>
469 void SmiAdd(Register dst, 469 void SmiAdd(Register dst,
470 Register src1, 470 Register src1,
471 Register src2, 471 Register src2,
472 LabelType* on_not_smi_result); 472 LabelType* on_not_smi_result);
473 template <typename LabelType>
474 void SmiAdd(Register dst,
475 Register src1,
476 const Operand& src2,
477 LabelType* on_not_smi_result);
473 478
474 void SmiAdd(Register dst, 479 void SmiAdd(Register dst,
475 Register src1, 480 Register src1,
476 Register src2); 481 Register src2);
477 482
478 // Subtracts smi values and return the result as a smi. 483 // Subtracts smi values and return the result as a smi.
479 // If dst is src1, then src1 will be destroyed, even if 484 // If dst is src1, then src1 will be destroyed, even if
480 // the operation is unsuccessful. 485 // the operation is unsuccessful.
481 template <typename LabelType> 486 template <typename LabelType>
482 void SmiSub(Register dst, 487 void SmiSub(Register dst,
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 // power of two to multiply the index value by (e.g. 588 // power of two to multiply the index value by (e.g.
584 // to index by smi-value * kPointerSize, pass the smi and kPointerSizeLog2). 589 // to index by smi-value * kPointerSize, pass the smi and kPointerSizeLog2).
585 // The returned index register may be either src or dst, depending 590 // The returned index register may be either src or dst, depending
586 // on what is most efficient. If src and dst are different registers, 591 // on what is most efficient. If src and dst are different registers,
587 // src is always unchanged. 592 // src is always unchanged.
588 SmiIndex SmiToIndex(Register dst, Register src, int shift); 593 SmiIndex SmiToIndex(Register dst, Register src, int shift);
589 594
590 // Converts a positive smi to a negative index. 595 // Converts a positive smi to a negative index.
591 SmiIndex SmiToNegativeIndex(Register dst, Register src, int shift); 596 SmiIndex SmiToNegativeIndex(Register dst, Register src, int shift);
592 597
598 // Add the value of a smi in memory to an int32 register.
599 // Sets flags as a normal add.
600 void AddSmiField(Register dst, const Operand& src);
601
593 // Basic Smi operations. 602 // Basic Smi operations.
594 void Move(Register dst, Smi* source) { 603 void Move(Register dst, Smi* source) {
595 LoadSmiConstant(dst, source); 604 LoadSmiConstant(dst, source);
596 } 605 }
597 606
598 void Move(const Operand& dst, Smi* source) { 607 void Move(const Operand& dst, Smi* source) {
599 Register constant = GetSmiConstant(source); 608 Register constant = GetSmiConstant(source);
600 movq(dst, constant); 609 movq(dst, constant);
601 } 610 }
602 611
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 // Utilities 1024 // Utilities
1016 1025
1017 void Ret(); 1026 void Ret();
1018 1027
1019 // Return and drop arguments from stack, where the number of arguments 1028 // Return and drop arguments from stack, where the number of arguments
1020 // may be bigger than 2^16 - 1. Requires a scratch register. 1029 // may be bigger than 2^16 - 1. Requires a scratch register.
1021 void Ret(int bytes_dropped, Register scratch); 1030 void Ret(int bytes_dropped, Register scratch);
1022 1031
1023 Handle<Object> CodeObject() { return code_object_; } 1032 Handle<Object> CodeObject() { return code_object_; }
1024 1033
1034 // Copy length bytes from source to destination.
1035 // Uses scratch register internally (if you have a low-eight register
1036 // free, do use it, otherwise kScratchRegister will be used).
1037 // The min_length is a minimum limit on the value that length will have.
1038 // The algorithm has some special cases that might be omitted if the string
1039 // is known to always be long.
1040 void CopyBytes(Register destination,
1041 Register source,
1042 Register length,
1043 int min_length = 0,
1044 Register scratch = kScratchRegister);
1045
1025 1046
1026 // --------------------------------------------------------------------------- 1047 // ---------------------------------------------------------------------------
1027 // StatsCounter support 1048 // StatsCounter support
1028 1049
1029 void SetCounter(StatsCounter* counter, int value); 1050 void SetCounter(StatsCounter* counter, int value);
1030 void IncrementCounter(StatsCounter* counter, int value); 1051 void IncrementCounter(StatsCounter* counter, int value);
1031 void DecrementCounter(StatsCounter* counter, int value); 1052 void DecrementCounter(StatsCounter* counter, int value);
1032 1053
1033 1054
1034 // --------------------------------------------------------------------------- 1055 // ---------------------------------------------------------------------------
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 movq(dst, kScratchRegister); 1287 movq(dst, kScratchRegister);
1267 } else { 1288 } else {
1268 movq(dst, src1); 1289 movq(dst, src1);
1269 addq(dst, src2); 1290 addq(dst, src2);
1270 j(overflow, on_not_smi_result); 1291 j(overflow, on_not_smi_result);
1271 } 1292 }
1272 } 1293 }
1273 1294
1274 1295
1275 template <typename LabelType> 1296 template <typename LabelType>
1297 void MacroAssembler::SmiAdd(Register dst,
1298 Register src1,
1299 const Operand& src2,
1300 LabelType* on_not_smi_result) {
1301 ASSERT_NOT_NULL(on_not_smi_result);
1302 if (dst.is(src1)) {
1303 movq(kScratchRegister, src1);
1304 addq(kScratchRegister, src2);
1305 j(overflow, on_not_smi_result);
1306 movq(dst, kScratchRegister);
1307 } else {
1308 ASSERT(!src2.AddressUsesRegister(dst));
1309 movq(dst, src1);
1310 addq(dst, src2);
1311 j(overflow, on_not_smi_result);
1312 }
1313 }
1314
1315
1316 template <typename LabelType>
1276 void MacroAssembler::SmiSub(Register dst, 1317 void MacroAssembler::SmiSub(Register dst,
1277 Register src1, 1318 Register src1,
1278 Register src2, 1319 Register src2,
1279 LabelType* on_not_smi_result) { 1320 LabelType* on_not_smi_result) {
1280 ASSERT_NOT_NULL(on_not_smi_result); 1321 ASSERT_NOT_NULL(on_not_smi_result);
1281 ASSERT(!dst.is(src2)); 1322 ASSERT(!dst.is(src2));
1282 if (dst.is(src1)) { 1323 if (dst.is(src1)) {
1283 cmpq(dst, src2); 1324 cmpq(dst, src2);
1284 j(overflow, on_not_smi_result); 1325 j(overflow, on_not_smi_result);
1285 subq(dst, src2); 1326 subq(dst, src2);
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
1929 Jump(adaptor, RelocInfo::CODE_TARGET); 1970 Jump(adaptor, RelocInfo::CODE_TARGET);
1930 } 1971 }
1931 bind(&invoke); 1972 bind(&invoke);
1932 } 1973 }
1933 } 1974 }
1934 1975
1935 1976
1936 } } // namespace v8::internal 1977 } } // namespace v8::internal
1937 1978
1938 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ 1979 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698