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

Side by Side Diff: src/x64/full-codegen-x64.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 2847 matching lines...) Expand 10 before | Expand all | Expand 10 after
2858 2858
2859 void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) { 2859 void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) {
2860 ZoneList<Expression*>* args = expr->arguments(); 2860 ZoneList<Expression*>* args = expr->arguments();
2861 ASSERT(args->length() == 2); 2861 ASSERT(args->length() == 2);
2862 2862
2863 VisitForStackValue(args->at(0)); 2863 VisitForStackValue(args->at(0));
2864 VisitForAccumulatorValue(args->at(1)); 2864 VisitForAccumulatorValue(args->at(1));
2865 2865
2866 Register object = rbx; 2866 Register object = rbx;
2867 Register index = rax; 2867 Register index = rax;
2868 Register scratch = rcx;
2869 Register result = rdx; 2868 Register result = rdx;
2870 2869
2871 __ pop(object); 2870 __ pop(object);
2872 2871
2873 Label need_conversion; 2872 Label need_conversion;
2874 Label index_out_of_range; 2873 Label index_out_of_range;
2875 Label done; 2874 Label done;
2876 StringCharCodeAtGenerator generator(object, 2875 StringCharCodeAtGenerator generator(object,
2877 index, 2876 index,
2878 scratch,
2879 result, 2877 result,
2880 &need_conversion, 2878 &need_conversion,
2881 &need_conversion, 2879 &need_conversion,
2882 &index_out_of_range, 2880 &index_out_of_range,
2883 STRING_INDEX_IS_NUMBER); 2881 STRING_INDEX_IS_NUMBER);
2884 generator.GenerateFast(masm_); 2882 generator.GenerateFast(masm_);
2885 __ jmp(&done); 2883 __ jmp(&done);
2886 2884
2887 __ bind(&index_out_of_range); 2885 __ bind(&index_out_of_range);
2888 // When the index is out of range, the spec requires us to return 2886 // When the index is out of range, the spec requires us to return
(...skipping 17 matching lines...) Expand all
2906 2904
2907 void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) { 2905 void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) {
2908 ZoneList<Expression*>* args = expr->arguments(); 2906 ZoneList<Expression*>* args = expr->arguments();
2909 ASSERT(args->length() == 2); 2907 ASSERT(args->length() == 2);
2910 2908
2911 VisitForStackValue(args->at(0)); 2909 VisitForStackValue(args->at(0));
2912 VisitForAccumulatorValue(args->at(1)); 2910 VisitForAccumulatorValue(args->at(1));
2913 2911
2914 Register object = rbx; 2912 Register object = rbx;
2915 Register index = rax; 2913 Register index = rax;
2916 Register scratch1 = rcx; 2914 Register scratch = rdx;
2917 Register scratch2 = rdx;
2918 Register result = rax; 2915 Register result = rax;
2919 2916
2920 __ pop(object); 2917 __ pop(object);
2921 2918
2922 Label need_conversion; 2919 Label need_conversion;
2923 Label index_out_of_range; 2920 Label index_out_of_range;
2924 Label done; 2921 Label done;
2925 StringCharAtGenerator generator(object, 2922 StringCharAtGenerator generator(object,
2926 index, 2923 index,
2927 scratch1, 2924 scratch,
2928 scratch2,
2929 result, 2925 result,
2930 &need_conversion, 2926 &need_conversion,
2931 &need_conversion, 2927 &need_conversion,
2932 &index_out_of_range, 2928 &index_out_of_range,
2933 STRING_INDEX_IS_NUMBER); 2929 STRING_INDEX_IS_NUMBER);
2934 generator.GenerateFast(masm_); 2930 generator.GenerateFast(masm_);
2935 __ jmp(&done); 2931 __ jmp(&done);
2936 2932
2937 __ bind(&index_out_of_range); 2933 __ bind(&index_out_of_range);
2938 // When the index is out of range, the spec requires us to return 2934 // When the index is out of range, the spec requires us to return
(...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after
4306 *context_length = 0; 4302 *context_length = 0;
4307 return previous_; 4303 return previous_;
4308 } 4304 }
4309 4305
4310 4306
4311 #undef __ 4307 #undef __
4312 4308
4313 } } // namespace v8::internal 4309 } } // namespace v8::internal
4314 4310
4315 #endif // V8_TARGET_ARCH_X64 4311 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698