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

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

Issue 6869005: Land Kevin's patch for supporting %_CallFunction in Crankshaft. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: 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 | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.h » ('j') | no next file with comments »
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 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 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after
4324 // And return. 4323 // And return.
4325 __ ret(0); 4324 __ ret(0);
4326 } 4325 }
4327 4326
4328 4327
4329 #undef __ 4328 #undef __
4330 4329
4331 } } // namespace v8::internal 4330 } } // namespace v8::internal
4332 4331
4333 #endif // V8_TARGET_ARCH_IA32 4332 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698