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

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 8510005: Simplify StringCharCodeAt in non-crankshaft codegen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month 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 3015 matching lines...) Expand 10 before | Expand all | Expand 10 after
3026 3026
3027 3027
3028 void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) { 3028 void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) {
3029 ZoneList<Expression*>* args = expr->arguments(); 3029 ZoneList<Expression*>* args = expr->arguments();
3030 ASSERT(args->length() == 2); 3030 ASSERT(args->length() == 2);
3031 VisitForStackValue(args->at(0)); 3031 VisitForStackValue(args->at(0));
3032 VisitForAccumulatorValue(args->at(1)); 3032 VisitForAccumulatorValue(args->at(1));
3033 3033
3034 Register object = r1; 3034 Register object = r1;
3035 Register index = r0; 3035 Register index = r0;
3036 Register scratch = r2;
3037 Register result = r3; 3036 Register result = r3;
3038 3037
3039 __ pop(object); 3038 __ pop(object);
3040 3039
3041 Label need_conversion; 3040 Label need_conversion;
3042 Label index_out_of_range; 3041 Label index_out_of_range;
3043 Label done; 3042 Label done;
3044 StringCharCodeAtGenerator generator(object, 3043 StringCharCodeAtGenerator generator(object,
3045 index, 3044 index,
3046 scratch,
3047 result, 3045 result,
3048 &need_conversion, 3046 &need_conversion,
3049 &need_conversion, 3047 &need_conversion,
3050 &index_out_of_range, 3048 &index_out_of_range,
3051 STRING_INDEX_IS_NUMBER); 3049 STRING_INDEX_IS_NUMBER);
3052 generator.GenerateFast(masm_); 3050 generator.GenerateFast(masm_);
3053 __ jmp(&done); 3051 __ jmp(&done);
3054 3052
3055 __ bind(&index_out_of_range); 3053 __ bind(&index_out_of_range);
3056 // When the index is out of range, the spec requires us to return 3054 // When the index is out of range, the spec requires us to return
(...skipping 16 matching lines...) Expand all
3073 3071
3074 3072
3075 void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) { 3073 void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) {
3076 ZoneList<Expression*>* args = expr->arguments(); 3074 ZoneList<Expression*>* args = expr->arguments();
3077 ASSERT(args->length() == 2); 3075 ASSERT(args->length() == 2);
3078 VisitForStackValue(args->at(0)); 3076 VisitForStackValue(args->at(0));
3079 VisitForAccumulatorValue(args->at(1)); 3077 VisitForAccumulatorValue(args->at(1));
3080 3078
3081 Register object = r1; 3079 Register object = r1;
3082 Register index = r0; 3080 Register index = r0;
3083 Register scratch1 = r2; 3081 Register scratch = r3;
3084 Register scratch2 = r3;
3085 Register result = r0; 3082 Register result = r0;
3086 3083
3087 __ pop(object); 3084 __ pop(object);
3088 3085
3089 Label need_conversion; 3086 Label need_conversion;
3090 Label index_out_of_range; 3087 Label index_out_of_range;
3091 Label done; 3088 Label done;
3092 StringCharAtGenerator generator(object, 3089 StringCharAtGenerator generator(object,
3093 index, 3090 index,
3094 scratch1, 3091 scratch,
3095 scratch2,
3096 result, 3092 result,
3097 &need_conversion, 3093 &need_conversion,
3098 &need_conversion, 3094 &need_conversion,
3099 &index_out_of_range, 3095 &index_out_of_range,
3100 STRING_INDEX_IS_NUMBER); 3096 STRING_INDEX_IS_NUMBER);
3101 generator.GenerateFast(masm_); 3097 generator.GenerateFast(masm_);
3102 __ jmp(&done); 3098 __ jmp(&done);
3103 3099
3104 __ bind(&index_out_of_range); 3100 __ bind(&index_out_of_range);
3105 // When the index is out of range, the spec requires us to return 3101 // When the index is out of range, the spec requires us to return
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after
4399 *context_length = 0; 4395 *context_length = 0;
4400 return previous_; 4396 return previous_;
4401 } 4397 }
4402 4398
4403 4399
4404 #undef __ 4400 #undef __
4405 4401
4406 } } // namespace v8::internal 4402 } } // namespace v8::internal
4407 4403
4408 #endif // V8_TARGET_ARCH_ARM 4404 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/ic-arm.cc » ('j') | src/ia32/code-stubs-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698