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

Side by Side Diff: src/x64/codegen-x64.h

Issue 2087009: Custom call IC-s for String.prototype.{charAt,charCodeAt}. (Closed)
Patch Set: ARM port. Created 10 years, 7 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
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 // Support for arguments.length and arguments[?]. 561 // Support for arguments.length and arguments[?].
562 void GenerateArgumentsLength(ZoneList<Expression*>* args); 562 void GenerateArgumentsLength(ZoneList<Expression*>* args);
563 void GenerateArguments(ZoneList<Expression*>* args); 563 void GenerateArguments(ZoneList<Expression*>* args);
564 564
565 // Support for accessing the class and value fields of an object. 565 // Support for accessing the class and value fields of an object.
566 void GenerateClassOf(ZoneList<Expression*>* args); 566 void GenerateClassOf(ZoneList<Expression*>* args);
567 void GenerateValueOf(ZoneList<Expression*>* args); 567 void GenerateValueOf(ZoneList<Expression*>* args);
568 void GenerateSetValueOf(ZoneList<Expression*>* args); 568 void GenerateSetValueOf(ZoneList<Expression*>* args);
569 569
570 // Fast support for charCodeAt(n). 570 // Fast support for charCodeAt(n).
571 void GenerateFastCharCodeAt(ZoneList<Expression*>* args); 571 void GenerateStringCharCodeAt(ZoneList<Expression*>* args);
572 572
573 // Fast support for string.charAt(n) and string[n]. 573 // Fast support for string.charAt(n) and string[n].
574 void GenerateCharFromCode(ZoneList<Expression*>* args); 574 void GenerateStringCharFromCode(ZoneList<Expression*>* args);
575
576 // Fast support for string.charAt(n) and string[n].
577 void GenerateStringCharAt(ZoneList<Expression*>* args);
575 578
576 // Fast support for object equality testing. 579 // Fast support for object equality testing.
577 void GenerateObjectEquals(ZoneList<Expression*>* args); 580 void GenerateObjectEquals(ZoneList<Expression*>* args);
578 581
579 void GenerateLog(ZoneList<Expression*>* args); 582 void GenerateLog(ZoneList<Expression*>* args);
580 583
581 void GenerateGetFramePointer(ZoneList<Expression*>* args); 584 void GenerateGetFramePointer(ZoneList<Expression*>* args);
582 585
583 // Fast support for Math.random(). 586 // Fast support for Math.random().
584 void GenerateRandomHeapNumber(ZoneList<Expression*>* args); 587 void GenerateRandomHeapNumber(ZoneList<Expression*>* args);
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 839
837 virtual int GetCodeKind() { return Code::BINARY_OP_IC; } 840 virtual int GetCodeKind() { return Code::BINARY_OP_IC; }
838 841
839 virtual InlineCacheState GetICState() { 842 virtual InlineCacheState GetICState() {
840 return BinaryOpIC::ToState(runtime_operands_type_); 843 return BinaryOpIC::ToState(runtime_operands_type_);
841 } 844 }
842 }; 845 };
843 846
844 class StringHelper : public AllStatic { 847 class StringHelper : public AllStatic {
845 public: 848 public:
846 // Generates fast code for getting a char code out of a string
847 // object at the given index. May bail out for four reasons (in the
848 // listed order):
849 // * Receiver is not a string (receiver_not_string label).
850 // * Index is not a smi (index_not_smi label).
851 // * Index is out of range (index_out_of_range).
852 // * Some other reason (slow_case label). In this case it's
853 // guaranteed that the above conditions are not violated,
854 // e.g. it's safe to assume the receiver is a string and the
855 // index is a non-negative smi < length.
856 // When successful, object, index, and scratch are clobbered.
857 // Otherwise, scratch and result are clobbered.
858 static void GenerateFastCharCodeAt(MacroAssembler* masm,
859 Register object,
860 Register index,
861 Register scratch,
862 Register result,
863 Label* receiver_not_string,
864 Label* index_not_smi,
865 Label* index_out_of_range,
866 Label* slow_case);
867
868 // Generates code for creating a one-char string from the given char
869 // code. May do a runtime call, so any register can be clobbered
870 // and, if the given invoke flag specifies a call, an internal frame
871 // is required. In tail call mode the result must be rax register.
872 static void GenerateCharFromCode(MacroAssembler* masm,
873 Register code,
874 Register result,
875 Register scratch,
876 InvokeFlag flag);
877
878 // Generate code for copying characters using a simple loop. This should only 849 // Generate code for copying characters using a simple loop. This should only
879 // be used in places where the number of characters is small and the 850 // be used in places where the number of characters is small and the
880 // additional setup and checking in GenerateCopyCharactersREP adds too much 851 // additional setup and checking in GenerateCopyCharactersREP adds too much
881 // overhead. Copying of overlapping regions is not supported. 852 // overhead. Copying of overlapping regions is not supported.
882 static void GenerateCopyCharacters(MacroAssembler* masm, 853 static void GenerateCopyCharacters(MacroAssembler* masm,
883 Register dest, 854 Register dest,
884 Register src, 855 Register src,
885 Register count, 856 Register count,
886 bool ascii); 857 bool ascii);
887 858
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 return ObjectBits::encode(object_.code()) | 1024 return ObjectBits::encode(object_.code()) |
1054 AddressBits::encode(addr_.code()) | 1025 AddressBits::encode(addr_.code()) |
1055 ScratchBits::encode(scratch_.code()); 1026 ScratchBits::encode(scratch_.code());
1056 } 1027 }
1057 }; 1028 };
1058 1029
1059 1030
1060 } } // namespace v8::internal 1031 } } // namespace v8::internal
1061 1032
1062 #endif // V8_X64_CODEGEN_X64_H_ 1033 #endif // V8_X64_CODEGEN_X64_H_
OLDNEW
« src/codegen.h ('K') | « src/stub-cache.h ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698