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

Side by Side Diff: src/ia32/full-codegen-ia32.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
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 3069 matching lines...) Expand 10 before | Expand all | Expand 10 after
3080 ASSERT(args->length() == 1); 3080 ASSERT(args->length() == 1);
3081 VisitForStackValue(args->at(0)); 3081 VisitForStackValue(args->at(0));
3082 __ CallRuntime(Runtime::kMath_sqrt, 1); 3082 __ CallRuntime(Runtime::kMath_sqrt, 1);
3083 context()->Plug(eax); 3083 context()->Plug(eax);
3084 } 3084 }
3085 3085
3086 3086
3087 void FullCodeGenerator::EmitCallFunction(ZoneList<Expression*>* args) { 3087 void FullCodeGenerator::EmitCallFunction(ZoneList<Expression*>* args) {
3088 ASSERT(args->length() >= 2); 3088 ASSERT(args->length() >= 2);
3089 3089
3090 int arg_count = args->length() - 2; // For receiver and function. 3090 int arg_count = args->length() - 2; // 2 ~ receiver and function.
3091 VisitForStackValue(args->at(0)); // Receiver. 3091 for (int i = 0; i < arg_count + 1; ++i) {
3092 for (int i = 0; i < arg_count; i++) { 3092 VisitForStackValue(args->at(i));
3093 VisitForStackValue(args->at(i + 1));
3094 } 3093 }
3095 VisitForAccumulatorValue(args->at(arg_count + 1)); // Function. 3094 VisitForAccumulatorValue(args->last()); // Function.
3096 3095
3097 // InvokeFunction requires function in edi. Move it in there. 3096 // InvokeFunction requires the function in edi. Move it in there.
3098 if (!result_register().is(edi)) __ mov(edi, result_register()); 3097 __ mov(edi, result_register());
3099 ParameterCount count(arg_count); 3098 ParameterCount count(arg_count);
3100 __ InvokeFunction(edi, count, CALL_FUNCTION); 3099 __ InvokeFunction(edi, count, CALL_FUNCTION);
3101 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 3100 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
3102 context()->Plug(eax); 3101 context()->Plug(eax);
3103 } 3102 }
3104 3103
3105 3104
3106 void FullCodeGenerator::EmitRegExpConstructResult(ZoneList<Expression*>* args) { 3105 void FullCodeGenerator::EmitRegExpConstructResult(ZoneList<Expression*>* args) {
3107 // Load the arguments on the stack and call the stub. 3106 // Load the arguments on the stack and call the stub.
3108 RegExpConstructResultStub stub; 3107 RegExpConstructResultStub stub;
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
4348 // And return. 4347 // And return.
4349 __ ret(0); 4348 __ ret(0);
4350 } 4349 }
4351 4350
4352 4351
4353 #undef __ 4352 #undef __
4354 4353
4355 } } // namespace v8::internal 4354 } } // namespace v8::internal
4356 4355
4357 #endif // V8_TARGET_ARCH_IA32 4356 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698