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

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

Issue 6838018: Support %_CallFunction in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Include regression test. Created 9 years, 8 months 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
« no previous file with comments | « no previous file | src/arm/lithium-arm.h » ('j') | src/hydrogen.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3143 matching lines...) Expand 10 before | Expand all | Expand 10 after
3154 ASSERT(args->length() == 1); 3154 ASSERT(args->length() == 1);
3155 VisitForStackValue(args->at(0)); 3155 VisitForStackValue(args->at(0));
3156 __ CallRuntime(Runtime::kMath_sqrt, 1); 3156 __ CallRuntime(Runtime::kMath_sqrt, 1);
3157 context()->Plug(r0); 3157 context()->Plug(r0);
3158 } 3158 }
3159 3159
3160 3160
3161 void FullCodeGenerator::EmitCallFunction(ZoneList<Expression*>* args) { 3161 void FullCodeGenerator::EmitCallFunction(ZoneList<Expression*>* args) {
3162 ASSERT(args->length() >= 2); 3162 ASSERT(args->length() >= 2);
3163 3163
3164 int arg_count = args->length() - 2; // For receiver and function. 3164 int arg_count = args->length() - 2; // 2 ~ receiver and function.
3165 VisitForStackValue(args->at(0)); // Receiver. 3165 for (int i = 0; i < arg_count + 1; i++) {
3166 for (int i = 0; i < arg_count; i++) { 3166 VisitForStackValue(args->at(i));
3167 VisitForStackValue(args->at(i + 1));
3168 } 3167 }
3169 VisitForAccumulatorValue(args->at(arg_count + 1)); // Function. 3168 VisitForAccumulatorValue(args->last()); // Function.
3170 3169
3171 // InvokeFunction requires function in r1. Move it in there. 3170 // InvokeFunction requires the function in r1. Move it in there.
3172 if (!result_register().is(r1)) __ mov(r1, result_register()); 3171 __ mov(r1, result_register());
3173 ParameterCount count(arg_count); 3172 ParameterCount count(arg_count);
3174 __ InvokeFunction(r1, count, CALL_FUNCTION); 3173 __ InvokeFunction(r1, count, CALL_FUNCTION);
3175 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 3174 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
3176 context()->Plug(r0); 3175 context()->Plug(r0);
3177 } 3176 }
3178 3177
3179 3178
3180 void FullCodeGenerator::EmitRegExpConstructResult(ZoneList<Expression*>* args) { 3179 void FullCodeGenerator::EmitRegExpConstructResult(ZoneList<Expression*>* args) {
3181 RegExpConstructResultStub stub; 3180 RegExpConstructResultStub stub;
3182 ASSERT(args->length() == 3); 3181 ASSERT(args->length() == 3);
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
4364 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. 4363 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
4365 __ add(pc, r1, Operand(masm_->CodeObject())); 4364 __ add(pc, r1, Operand(masm_->CodeObject()));
4366 } 4365 }
4367 4366
4368 4367
4369 #undef __ 4368 #undef __
4370 4369
4371 } } // namespace v8::internal 4370 } } // namespace v8::internal
4372 4371
4373 #endif // V8_TARGET_ARCH_ARM 4372 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-arm.h » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698