OLD | NEW |
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 2918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2929 | 2929 |
2930 void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) { | 2930 void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) { |
2931 ZoneList<Expression*>* args = expr->arguments(); | 2931 ZoneList<Expression*>* args = expr->arguments(); |
2932 ASSERT(args->length() == 2); | 2932 ASSERT(args->length() == 2); |
2933 | 2933 |
2934 VisitForStackValue(args->at(0)); | 2934 VisitForStackValue(args->at(0)); |
2935 VisitForAccumulatorValue(args->at(1)); | 2935 VisitForAccumulatorValue(args->at(1)); |
2936 | 2936 |
2937 Register object = ebx; | 2937 Register object = ebx; |
2938 Register index = eax; | 2938 Register index = eax; |
2939 Register scratch = ecx; | |
2940 Register result = edx; | 2939 Register result = edx; |
2941 | 2940 |
2942 __ pop(object); | 2941 __ pop(object); |
2943 | 2942 |
2944 Label need_conversion; | 2943 Label need_conversion; |
2945 Label index_out_of_range; | 2944 Label index_out_of_range; |
2946 Label done; | 2945 Label done; |
2947 StringCharCodeAtGenerator generator(object, | 2946 StringCharCodeAtGenerator generator(object, |
2948 index, | 2947 index, |
2949 scratch, | |
2950 result, | 2948 result, |
2951 &need_conversion, | 2949 &need_conversion, |
2952 &need_conversion, | 2950 &need_conversion, |
2953 &index_out_of_range, | 2951 &index_out_of_range, |
2954 STRING_INDEX_IS_NUMBER); | 2952 STRING_INDEX_IS_NUMBER); |
2955 generator.GenerateFast(masm_); | 2953 generator.GenerateFast(masm_); |
2956 __ jmp(&done); | 2954 __ jmp(&done); |
2957 | 2955 |
2958 __ bind(&index_out_of_range); | 2956 __ bind(&index_out_of_range); |
2959 // When the index is out of range, the spec requires us to return | 2957 // When the index is out of range, the spec requires us to return |
(...skipping 17 matching lines...) Expand all Loading... |
2977 | 2975 |
2978 void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) { | 2976 void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) { |
2979 ZoneList<Expression*>* args = expr->arguments(); | 2977 ZoneList<Expression*>* args = expr->arguments(); |
2980 ASSERT(args->length() == 2); | 2978 ASSERT(args->length() == 2); |
2981 | 2979 |
2982 VisitForStackValue(args->at(0)); | 2980 VisitForStackValue(args->at(0)); |
2983 VisitForAccumulatorValue(args->at(1)); | 2981 VisitForAccumulatorValue(args->at(1)); |
2984 | 2982 |
2985 Register object = ebx; | 2983 Register object = ebx; |
2986 Register index = eax; | 2984 Register index = eax; |
2987 Register scratch1 = ecx; | 2985 Register scratch = edx; |
2988 Register scratch2 = edx; | |
2989 Register result = eax; | 2986 Register result = eax; |
2990 | 2987 |
2991 __ pop(object); | 2988 __ pop(object); |
2992 | 2989 |
2993 Label need_conversion; | 2990 Label need_conversion; |
2994 Label index_out_of_range; | 2991 Label index_out_of_range; |
2995 Label done; | 2992 Label done; |
2996 StringCharAtGenerator generator(object, | 2993 StringCharAtGenerator generator(object, |
2997 index, | 2994 index, |
2998 scratch1, | 2995 scratch, |
2999 scratch2, | |
3000 result, | 2996 result, |
3001 &need_conversion, | 2997 &need_conversion, |
3002 &need_conversion, | 2998 &need_conversion, |
3003 &index_out_of_range, | 2999 &index_out_of_range, |
3004 STRING_INDEX_IS_NUMBER); | 3000 STRING_INDEX_IS_NUMBER); |
3005 generator.GenerateFast(masm_); | 3001 generator.GenerateFast(masm_); |
3006 __ jmp(&done); | 3002 __ jmp(&done); |
3007 | 3003 |
3008 __ bind(&index_out_of_range); | 3004 __ bind(&index_out_of_range); |
3009 // When the index is out of range, the spec requires us to return | 3005 // When the index is out of range, the spec requires us to return |
(...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4344 *context_length = 0; | 4340 *context_length = 0; |
4345 return previous_; | 4341 return previous_; |
4346 } | 4342 } |
4347 | 4343 |
4348 | 4344 |
4349 #undef __ | 4345 #undef __ |
4350 | 4346 |
4351 } } // namespace v8::internal | 4347 } } // namespace v8::internal |
4352 | 4348 |
4353 #endif // V8_TARGET_ARCH_IA32 | 4349 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |