| OLD | NEW |
| 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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 | 879 |
| 880 virtual InlineCacheState GetICState() { | 880 virtual InlineCacheState GetICState() { |
| 881 return BinaryOpIC::ToState(runtime_operands_type_); | 881 return BinaryOpIC::ToState(runtime_operands_type_); |
| 882 } | 882 } |
| 883 }; | 883 }; |
| 884 | 884 |
| 885 | 885 |
| 886 class StringHelper : public AllStatic { | 886 class StringHelper : public AllStatic { |
| 887 public: | 887 public: |
| 888 // Generates fast code for getting a char code out of a string | 888 // Generates fast code for getting a char code out of a string |
| 889 // object at the given index. May bail out for three reasons (in the | 889 // object at the given index. May bail out for four reasons (in the |
| 890 // listed order): | 890 // listed order): |
| 891 // * Receiver is not a string (receiver_not_string label). | 891 // * Receiver is not a string (receiver_not_string label). |
| 892 // * Index is not a positive smi (index_not_positive_smi label). | 892 // * Index is not a smi (index_not_smi label). |
| 893 // * Index is out of range (index_out_of_range). |
| 893 // * Some other reason (slow_case label). In this case it's | 894 // * Some other reason (slow_case label). In this case it's |
| 894 // guaranteed that the above conditions are not violated, | 895 // guaranteed that the above conditions are not violated, |
| 895 // e.g. it's safe to assume the receiver is a string and the | 896 // e.g. it's safe to assume the receiver is a string and the |
| 896 // index is a positive smi. | 897 // index is a non-negative smi < length. |
| 897 // When successful, object, index, and scratch are clobbered. | 898 // When successful, object, index, and scratch are clobbered. |
| 898 // Otherwise, scratch and result are clobbered. | 899 // Otherwise, scratch and result are clobbered. |
| 899 static void GenerateFastCharCodeAt(MacroAssembler* masm, | 900 static void GenerateFastCharCodeAt(MacroAssembler* masm, |
| 900 Register object, | 901 Register object, |
| 901 Register index, | 902 Register index, |
| 902 Register scratch, | 903 Register scratch, |
| 903 Register result, | 904 Register result, |
| 904 Label* receiver_not_string, | 905 Label* receiver_not_string, |
| 905 Label* index_not_positive_smi, | 906 Label* index_not_smi, |
| 907 Label* index_out_of_range, |
| 906 Label* slow_case); | 908 Label* slow_case); |
| 907 | 909 |
| 908 // Generates code for creating a one-char string from the given char | 910 // Generates code for creating a one-char string from the given char |
| 909 // code. May do a runtime call, so any register can be clobbered | 911 // code. May do a runtime call, so any register can be clobbered |
| 910 // and, if the given invoke flag specifies a call, an internal frame | 912 // and, if the given invoke flag specifies a call, an internal frame |
| 911 // is required. In tail call mode the result must be eax register. | 913 // is required. In tail call mode the result must be eax register. |
| 912 static void GenerateCharFromCode(MacroAssembler* masm, | 914 static void GenerateCharFromCode(MacroAssembler* masm, |
| 913 Register code, | 915 Register code, |
| 914 Register result, | 916 Register result, |
| 915 InvokeFlag flag); | 917 InvokeFlag flag); |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1088 return ObjectBits::encode(object_.code()) | | 1090 return ObjectBits::encode(object_.code()) | |
| 1089 AddressBits::encode(addr_.code()) | | 1091 AddressBits::encode(addr_.code()) | |
| 1090 ScratchBits::encode(scratch_.code()); | 1092 ScratchBits::encode(scratch_.code()); |
| 1091 } | 1093 } |
| 1092 }; | 1094 }; |
| 1093 | 1095 |
| 1094 | 1096 |
| 1095 } } // namespace v8::internal | 1097 } } // namespace v8::internal |
| 1096 | 1098 |
| 1097 #endif // V8_IA32_CODEGEN_IA32_H_ | 1099 #endif // V8_IA32_CODEGEN_IA32_H_ |
| OLD | NEW |