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 4122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4133 | 4133 |
4134 // Load the argument on the stack and jump to the runtime. | 4134 // Load the argument on the stack and jump to the runtime. |
4135 Load(args->at(0)); | 4135 Load(args->at(0)); |
4136 | 4136 |
4137 NumberToStringStub stub; | 4137 NumberToStringStub stub; |
4138 Result result = frame_->CallStub(&stub, 1); | 4138 Result result = frame_->CallStub(&stub, 1); |
4139 frame_->Push(&result); | 4139 frame_->Push(&result); |
4140 } | 4140 } |
4141 | 4141 |
4142 | 4142 |
| 4143 void CodeGenerator::GenerateCallFunction(ZoneList<Expression*>* args) { |
| 4144 Comment cmnt(masm_, "[ GenerateCallFunction"); |
| 4145 |
| 4146 ASSERT(args->length() >= 2); |
| 4147 |
| 4148 int n_args = args->length() - 2; // for receiver and function. |
| 4149 Load(args->at(0)); // receiver |
| 4150 for (int i = 0; i < n_args; i++) { |
| 4151 Load(args->at(i + 1)); |
| 4152 } |
| 4153 Load(args->at(n_args + 1)); // function |
| 4154 Result result = frame_->CallJSFunction(n_args); |
| 4155 frame_->Push(&result); |
| 4156 } |
| 4157 |
| 4158 |
4143 void CodeGenerator::GenerateMathSin(ZoneList<Expression*>* args) { | 4159 void CodeGenerator::GenerateMathSin(ZoneList<Expression*>* args) { |
4144 ASSERT_EQ(args->length(), 1); | 4160 ASSERT_EQ(args->length(), 1); |
4145 // Load the argument on the stack and jump to the runtime. | 4161 // Load the argument on the stack and jump to the runtime. |
4146 Load(args->at(0)); | 4162 Load(args->at(0)); |
4147 Result answer = frame_->CallRuntime(Runtime::kMath_sin, 1); | 4163 Result answer = frame_->CallRuntime(Runtime::kMath_sin, 1); |
4148 frame_->Push(&answer); | 4164 frame_->Push(&answer); |
4149 } | 4165 } |
4150 | 4166 |
4151 | 4167 |
4152 void CodeGenerator::GenerateMathCos(ZoneList<Expression*>* args) { | 4168 void CodeGenerator::GenerateMathCos(ZoneList<Expression*>* args) { |
(...skipping 5913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10066 // Call the function from C++. | 10082 // Call the function from C++. |
10067 return FUNCTION_CAST<ModuloFunction>(buffer); | 10083 return FUNCTION_CAST<ModuloFunction>(buffer); |
10068 } | 10084 } |
10069 | 10085 |
10070 #endif | 10086 #endif |
10071 | 10087 |
10072 | 10088 |
10073 #undef __ | 10089 #undef __ |
10074 | 10090 |
10075 } } // namespace v8::internal | 10091 } } // namespace v8::internal |
OLD | NEW |