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

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

Issue 11348349: Improve array to string conversion. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 3056 matching lines...) Expand 10 before | Expand all | Expand 10 after
3067 __ jmp(&done); 3067 __ jmp(&done);
3068 } 3068 }
3069 3069
3070 __ bind(&not_date_object); 3070 __ bind(&not_date_object);
3071 __ CallRuntime(Runtime::kThrowNotDateError, 0); 3071 __ CallRuntime(Runtime::kThrowNotDateError, 0);
3072 __ bind(&done); 3072 __ bind(&done);
3073 context()->Plug(result); 3073 context()->Plug(result);
3074 } 3074 }
3075 3075
3076 3076
3077 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
3078 ZoneList<Expression*>* args = expr->arguments();
3079 ASSERT_EQ(3, args->length());
3080
3081 VisitForStackValue(args->at(1)); // index
3082 VisitForStackValue(args->at(2)); // value
3083 __ pop(ecx);
3084 __ pop(ebx);
3085 VisitForAccumulatorValue(args->at(0)); // string
3086
3087 SeqStringSetCharGenerator::Generate(masm_, true, eax, ebx, ecx);
Toon Verwaest 2012/12/05 14:29:12 Can we use an enum rather than bool to indicate tw
3088 context()->Plug(eax);
3089 }
3090
3091
3092 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) {
3093 ZoneList<Expression*>* args = expr->arguments();
3094 ASSERT_EQ(3, args->length());
3095
3096 VisitForStackValue(args->at(1)); // index
3097 VisitForStackValue(args->at(2)); // value
3098 __ pop(ecx);
3099 __ pop(ebx);
3100 VisitForAccumulatorValue(args->at(0)); // string
3101
3102 SeqStringSetCharGenerator::Generate(masm_, false, eax, ebx, ecx);
3103 context()->Plug(eax);
3104 }
3105
3106
3077 void FullCodeGenerator::EmitMathPow(CallRuntime* expr) { 3107 void FullCodeGenerator::EmitMathPow(CallRuntime* expr) {
3078 // Load the arguments on the stack and call the runtime function. 3108 // Load the arguments on the stack and call the runtime function.
3079 ZoneList<Expression*>* args = expr->arguments(); 3109 ZoneList<Expression*>* args = expr->arguments();
3080 ASSERT(args->length() == 2); 3110 ASSERT(args->length() == 2);
3081 VisitForStackValue(args->at(0)); 3111 VisitForStackValue(args->at(0));
3082 VisitForStackValue(args->at(1)); 3112 VisitForStackValue(args->at(1));
3083 3113
3084 if (CpuFeatures::IsSupported(SSE2)) { 3114 if (CpuFeatures::IsSupported(SSE2)) {
3085 MathPowStub stub(MathPowStub::ON_STACK); 3115 MathPowStub stub(MathPowStub::ON_STACK);
3086 __ CallStub(&stub); 3116 __ CallStub(&stub);
(...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after
4501 *stack_depth = 0; 4531 *stack_depth = 0;
4502 *context_length = 0; 4532 *context_length = 0;
4503 return previous_; 4533 return previous_;
4504 } 4534 }
4505 4535
4506 #undef __ 4536 #undef __
4507 4537
4508 } } // namespace v8::internal 4538 } } // namespace v8::internal
4509 4539
4510 #endif // V8_TARGET_ARCH_IA32 4540 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698