OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 } | 256 } |
257 } | 257 } |
258 } | 258 } |
259 | 259 |
260 // Register holding this function and new target are both trashed in case we | 260 // Register holding this function and new target are both trashed in case we |
261 // bailout here. But since that can happen only when new target is not used | 261 // bailout here. But since that can happen only when new target is not used |
262 // and we allocate a context, the value of |function_in_register| is correct. | 262 // and we allocate a context, the value of |function_in_register| is correct. |
263 PrepareForBailoutForId(BailoutId::FunctionContext(), | 263 PrepareForBailoutForId(BailoutId::FunctionContext(), |
264 BailoutState::NO_REGISTERS); | 264 BailoutState::NO_REGISTERS); |
265 | 265 |
266 // Possibly set up a local binding to the this function which is used in | 266 // We don't support new.target and rest parameters here. |
267 // derived constructors with super calls. | 267 DCHECK_NULL(info->scope()->new_target_var()); |
268 Variable* this_function_var = info->scope()->this_function_var(); | 268 DCHECK_NULL(info->scope()->rest_parameter()); |
269 if (this_function_var != nullptr) { | 269 DCHECK_NULL(info->scope()->this_function_var()); |
270 Comment cmnt(masm_, "[ This function"); | |
271 if (!function_in_register_a1) { | |
272 __ lw(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | |
273 // The write barrier clobbers register again, keep it marked as such. | |
274 } | |
275 SetVar(this_function_var, a1, a0, a2); | |
276 } | |
277 | |
278 // Possibly set up a local binding to the new target value. | |
279 Variable* new_target_var = info->scope()->new_target_var(); | |
280 if (new_target_var != nullptr) { | |
281 Comment cmnt(masm_, "[ new.target"); | |
282 SetVar(new_target_var, a3, a0, a2); | |
283 } | |
284 | |
285 // Possibly allocate RestParameters | |
286 Variable* rest_param = info->scope()->rest_parameter(); | |
287 if (rest_param != nullptr) { | |
288 Comment cmnt(masm_, "[ Allocate rest parameter array"); | |
289 if (!function_in_register_a1) { | |
290 __ lw(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | |
291 } | |
292 FastNewRestParameterStub stub(isolate()); | |
293 __ CallStub(&stub); | |
294 function_in_register_a1 = false; | |
295 SetVar(rest_param, v0, a1, a2); | |
296 } | |
297 | 270 |
298 Variable* arguments = info->scope()->arguments(); | 271 Variable* arguments = info->scope()->arguments(); |
299 if (arguments != NULL) { | 272 if (arguments != NULL) { |
300 // Function uses arguments object. | 273 // Function uses arguments object. |
301 Comment cmnt(masm_, "[ Allocate arguments object"); | 274 Comment cmnt(masm_, "[ Allocate arguments object"); |
302 if (!function_in_register_a1) { | 275 if (!function_in_register_a1) { |
303 // Load this again, if it's used by the local context below. | 276 // Load this again, if it's used by the local context below. |
304 __ lw(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 277 __ lw(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
305 } | 278 } |
306 if (is_strict(language_mode()) || !has_simple_parameters()) { | 279 if (is_strict(language_mode()) || !has_simple_parameters()) { |
(...skipping 2923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3230 reinterpret_cast<uint32_t>( | 3203 reinterpret_cast<uint32_t>( |
3231 isolate->builtins()->OnStackReplacement()->entry())); | 3204 isolate->builtins()->OnStackReplacement()->entry())); |
3232 return ON_STACK_REPLACEMENT; | 3205 return ON_STACK_REPLACEMENT; |
3233 } | 3206 } |
3234 | 3207 |
3235 | 3208 |
3236 } // namespace internal | 3209 } // namespace internal |
3237 } // namespace v8 | 3210 } // namespace v8 |
3238 | 3211 |
3239 #endif // V8_TARGET_ARCH_MIPS | 3212 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |