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

Side by Side Diff: src/x64/full-codegen-x64.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/runtime-profiler.cc ('k') | src/x64/lithium-codegen-x64.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 3025 matching lines...) Expand 10 before | Expand all | Expand 10 after
3036 ASSERT(args->length() == 1); 3036 ASSERT(args->length() == 1);
3037 VisitForStackValue(args->at(0)); 3037 VisitForStackValue(args->at(0));
3038 __ CallRuntime(Runtime::kMath_sqrt, 1); 3038 __ CallRuntime(Runtime::kMath_sqrt, 1);
3039 context()->Plug(rax); 3039 context()->Plug(rax);
3040 } 3040 }
3041 3041
3042 3042
3043 void FullCodeGenerator::EmitCallFunction(ZoneList<Expression*>* args) { 3043 void FullCodeGenerator::EmitCallFunction(ZoneList<Expression*>* args) {
3044 ASSERT(args->length() >= 2); 3044 ASSERT(args->length() >= 2);
3045 3045
3046 int arg_count = args->length() - 2; // For receiver and function. 3046 int arg_count = args->length() - 2; // 2 ~ receiver and function.
3047 VisitForStackValue(args->at(0)); // Receiver. 3047 for (int i = 0; i < arg_count + 1; i++) {
3048 for (int i = 0; i < arg_count; i++) { 3048 VisitForStackValue(args->at(i));
3049 VisitForStackValue(args->at(i + 1));
3050 } 3049 }
3051 VisitForAccumulatorValue(args->at(arg_count + 1)); // Function. 3050 VisitForAccumulatorValue(args->last()); // Function.
3052 3051
3053 // InvokeFunction requires function in rdi. Move it in there. 3052 // InvokeFunction requires the function in rdi. Move it in there.
3054 if (!result_register().is(rdi)) __ movq(rdi, result_register()); 3053 __ movq(rdi, result_register());
3055 ParameterCount count(arg_count); 3054 ParameterCount count(arg_count);
3056 __ InvokeFunction(rdi, count, CALL_FUNCTION); 3055 __ InvokeFunction(rdi, count, CALL_FUNCTION);
3057 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 3056 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
3058 context()->Plug(rax); 3057 context()->Plug(rax);
3059 } 3058 }
3060 3059
3061 3060
3062 void FullCodeGenerator::EmitRegExpConstructResult(ZoneList<Expression*>* args) { 3061 void FullCodeGenerator::EmitRegExpConstructResult(ZoneList<Expression*>* args) {
3063 RegExpConstructResultStub stub; 3062 RegExpConstructResultStub stub;
3064 ASSERT(args->length() == 3); 3063 ASSERT(args->length() == 3);
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after
4306 __ ret(0); 4305 __ ret(0);
4307 } 4306 }
4308 4307
4309 4308
4310 #undef __ 4309 #undef __
4311 4310
4312 4311
4313 } } // namespace v8::internal 4312 } } // namespace v8::internal
4314 4313
4315 #endif // V8_TARGET_ARCH_X64 4314 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/runtime-profiler.cc ('k') | src/x64/lithium-codegen-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698