| OLD | NEW |
| 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 Loading... |
| 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 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4330 __ ret(0); | 4329 __ ret(0); |
| 4331 } | 4330 } |
| 4332 | 4331 |
| 4333 | 4332 |
| 4334 #undef __ | 4333 #undef __ |
| 4335 | 4334 |
| 4336 | 4335 |
| 4337 } } // namespace v8::internal | 4336 } } // namespace v8::internal |
| 4338 | 4337 |
| 4339 #endif // V8_TARGET_ARCH_X64 | 4338 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |