| 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 3040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3051 void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) { | 3051 void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) { |
| 3052 ZoneList<Expression*>* args = expr->arguments(); | 3052 ZoneList<Expression*>* args = expr->arguments(); |
| 3053 ASSERT(args->length() == 2); | 3053 ASSERT(args->length() == 2); |
| 3054 | 3054 |
| 3055 VisitForStackValue(args->at(0)); | 3055 VisitForStackValue(args->at(0)); |
| 3056 VisitForAccumulatorValue(args->at(1)); | 3056 VisitForAccumulatorValue(args->at(1)); |
| 3057 __ mov(a0, result_register()); | 3057 __ mov(a0, result_register()); |
| 3058 | 3058 |
| 3059 Register object = a1; | 3059 Register object = a1; |
| 3060 Register index = a0; | 3060 Register index = a0; |
| 3061 Register scratch = a2; | |
| 3062 Register result = v0; | 3061 Register result = v0; |
| 3063 | 3062 |
| 3064 __ pop(object); | 3063 __ pop(object); |
| 3065 | 3064 |
| 3066 Label need_conversion; | 3065 Label need_conversion; |
| 3067 Label index_out_of_range; | 3066 Label index_out_of_range; |
| 3068 Label done; | 3067 Label done; |
| 3069 StringCharCodeAtGenerator generator(object, | 3068 StringCharCodeAtGenerator generator(object, |
| 3070 index, | 3069 index, |
| 3071 scratch, | |
| 3072 result, | 3070 result, |
| 3073 &need_conversion, | 3071 &need_conversion, |
| 3074 &need_conversion, | 3072 &need_conversion, |
| 3075 &index_out_of_range, | 3073 &index_out_of_range, |
| 3076 STRING_INDEX_IS_NUMBER); | 3074 STRING_INDEX_IS_NUMBER); |
| 3077 generator.GenerateFast(masm_); | 3075 generator.GenerateFast(masm_); |
| 3078 __ jmp(&done); | 3076 __ jmp(&done); |
| 3079 | 3077 |
| 3080 __ bind(&index_out_of_range); | 3078 __ bind(&index_out_of_range); |
| 3081 // When the index is out of range, the spec requires us to return | 3079 // When the index is out of range, the spec requires us to return |
| (...skipping 18 matching lines...) Expand all Loading... |
| 3100 void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) { | 3098 void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) { |
| 3101 ZoneList<Expression*>* args = expr->arguments(); | 3099 ZoneList<Expression*>* args = expr->arguments(); |
| 3102 ASSERT(args->length() == 2); | 3100 ASSERT(args->length() == 2); |
| 3103 | 3101 |
| 3104 VisitForStackValue(args->at(0)); | 3102 VisitForStackValue(args->at(0)); |
| 3105 VisitForAccumulatorValue(args->at(1)); | 3103 VisitForAccumulatorValue(args->at(1)); |
| 3106 __ mov(a0, result_register()); | 3104 __ mov(a0, result_register()); |
| 3107 | 3105 |
| 3108 Register object = a1; | 3106 Register object = a1; |
| 3109 Register index = a0; | 3107 Register index = a0; |
| 3110 Register scratch1 = a2; | 3108 Register scratch = a3; |
| 3111 Register scratch2 = a3; | |
| 3112 Register result = v0; | 3109 Register result = v0; |
| 3113 | 3110 |
| 3114 __ pop(object); | 3111 __ pop(object); |
| 3115 | 3112 |
| 3116 Label need_conversion; | 3113 Label need_conversion; |
| 3117 Label index_out_of_range; | 3114 Label index_out_of_range; |
| 3118 Label done; | 3115 Label done; |
| 3119 StringCharAtGenerator generator(object, | 3116 StringCharAtGenerator generator(object, |
| 3120 index, | 3117 index, |
| 3121 scratch1, | 3118 scratch, |
| 3122 scratch2, | |
| 3123 result, | 3119 result, |
| 3124 &need_conversion, | 3120 &need_conversion, |
| 3125 &need_conversion, | 3121 &need_conversion, |
| 3126 &index_out_of_range, | 3122 &index_out_of_range, |
| 3127 STRING_INDEX_IS_NUMBER); | 3123 STRING_INDEX_IS_NUMBER); |
| 3128 generator.GenerateFast(masm_); | 3124 generator.GenerateFast(masm_); |
| 3129 __ jmp(&done); | 3125 __ jmp(&done); |
| 3130 | 3126 |
| 3131 __ bind(&index_out_of_range); | 3127 __ bind(&index_out_of_range); |
| 3132 // When the index is out of range, the spec requires us to return | 3128 // When the index is out of range, the spec requires us to return |
| (...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4434 *context_length = 0; | 4430 *context_length = 0; |
| 4435 return previous_; | 4431 return previous_; |
| 4436 } | 4432 } |
| 4437 | 4433 |
| 4438 | 4434 |
| 4439 #undef __ | 4435 #undef __ |
| 4440 | 4436 |
| 4441 } } // namespace v8::internal | 4437 } } // namespace v8::internal |
| 4442 | 4438 |
| 4443 #endif // V8_TARGET_ARCH_MIPS | 4439 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |