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 3143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4362 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 4361 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
4363 __ add(pc, r1, Operand(masm_->CodeObject())); | 4362 __ add(pc, r1, Operand(masm_->CodeObject())); |
4364 } | 4363 } |
4365 | 4364 |
4366 | 4365 |
4367 #undef __ | 4366 #undef __ |
4368 | 4367 |
4369 } } // namespace v8::internal | 4368 } } // namespace v8::internal |
4370 | 4369 |
4371 #endif // V8_TARGET_ARCH_ARM | 4370 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |