| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 3691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3702 | 3702 |
| 3703 // Load the argument on the stack and jump to the runtime. | 3703 // Load the argument on the stack and jump to the runtime. |
| 3704 Load(args->at(0)); | 3704 Load(args->at(0)); |
| 3705 | 3705 |
| 3706 NumberToStringStub stub; | 3706 NumberToStringStub stub; |
| 3707 frame_->CallStub(&stub, 1); | 3707 frame_->CallStub(&stub, 1); |
| 3708 frame_->EmitPush(r0); | 3708 frame_->EmitPush(r0); |
| 3709 } | 3709 } |
| 3710 | 3710 |
| 3711 | 3711 |
| 3712 void CodeGenerator::GenerateCallFunction(ZoneList<Expression*>* args) { |
| 3713 Comment cmnt(masm_, "[ GenerateCallFunction"); |
| 3714 |
| 3715 ASSERT(args->length() >= 2); |
| 3716 |
| 3717 int n_args = args->length() - 2; // for receiver and function. |
| 3718 Load(args->at(0)); // receiver |
| 3719 for (int i = 0; i < n_args; i++) { |
| 3720 Load(args->at(i + 1)); |
| 3721 } |
| 3722 Load(args->at(n_args + 1)); // function |
| 3723 frame_->CallJSFunction(n_args); |
| 3724 frame_->EmitPush(r0); |
| 3725 } |
| 3726 |
| 3727 |
| 3712 void CodeGenerator::GenerateMathSin(ZoneList<Expression*>* args) { | 3728 void CodeGenerator::GenerateMathSin(ZoneList<Expression*>* args) { |
| 3713 ASSERT_EQ(args->length(), 1); | 3729 ASSERT_EQ(args->length(), 1); |
| 3714 // Load the argument on the stack and jump to the runtime. | 3730 // Load the argument on the stack and jump to the runtime. |
| 3715 Load(args->at(0)); | 3731 Load(args->at(0)); |
| 3716 frame_->CallRuntime(Runtime::kMath_sin, 1); | 3732 frame_->CallRuntime(Runtime::kMath_sin, 1); |
| 3717 frame_->EmitPush(r0); | 3733 frame_->EmitPush(r0); |
| 3718 } | 3734 } |
| 3719 | 3735 |
| 3720 | 3736 |
| 3721 void CodeGenerator::GenerateMathCos(ZoneList<Expression*>* args) { | 3737 void CodeGenerator::GenerateMathCos(ZoneList<Expression*>* args) { |
| (...skipping 4235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7957 | 7973 |
| 7958 // Just jump to runtime to add the two strings. | 7974 // Just jump to runtime to add the two strings. |
| 7959 __ bind(&string_add_runtime); | 7975 __ bind(&string_add_runtime); |
| 7960 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); | 7976 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); |
| 7961 } | 7977 } |
| 7962 | 7978 |
| 7963 | 7979 |
| 7964 #undef __ | 7980 #undef __ |
| 7965 | 7981 |
| 7966 } } // namespace v8::internal | 7982 } } // namespace v8::internal |
| OLD | NEW |