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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 } | 255 } |
256 } | 256 } |
257 } | 257 } |
258 | 258 |
259 // Register holding this function and new target are both trashed in case we | 259 // Register holding this function and new target are both trashed in case we |
260 // bailout here. But since that can happen only when new target is not used | 260 // bailout here. But since that can happen only when new target is not used |
261 // and we allocate a context, the value of |function_in_register| is correct. | 261 // and we allocate a context, the value of |function_in_register| is correct. |
262 PrepareForBailoutForId(BailoutId::FunctionContext(), | 262 PrepareForBailoutForId(BailoutId::FunctionContext(), |
263 BailoutState::NO_REGISTERS); | 263 BailoutState::NO_REGISTERS); |
264 | 264 |
265 // Possibly set up a local binding to the this function which is used in | 265 // We don't support new.target and rest parameters here. |
266 // derived constructors with super calls. | 266 DCHECK_NULL(info->scope()->new_target_var()); |
267 Variable* this_function_var = info->scope()->this_function_var(); | 267 DCHECK_NULL(info->scope()->rest_parameter()); |
268 if (this_function_var != nullptr) { | 268 DCHECK_NULL(info->scope()->this_function_var()); |
269 Comment cmnt(masm_, "[ This function"); | |
270 if (!function_in_register_a1) { | |
271 __ ld(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | |
272 // The write barrier clobbers register again, keep it marked as such. | |
273 } | |
274 SetVar(this_function_var, a1, a0, a2); | |
275 } | |
276 | |
277 Variable* new_target_var = info->scope()->new_target_var(); | |
278 if (new_target_var != nullptr) { | |
279 Comment cmnt(masm_, "[ new.target"); | |
280 SetVar(new_target_var, a3, a0, a2); | |
281 } | |
282 | |
283 // Possibly allocate RestParameters | |
284 Variable* rest_param = info->scope()->rest_parameter(); | |
285 if (rest_param != nullptr) { | |
286 Comment cmnt(masm_, "[ Allocate rest parameter array"); | |
287 if (!function_in_register_a1) { | |
288 __ ld(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | |
289 } | |
290 FastNewRestParameterStub stub(isolate()); | |
291 __ CallStub(&stub); | |
292 function_in_register_a1 = false; | |
293 SetVar(rest_param, v0, a1, a2); | |
294 } | |
295 | 269 |
296 Variable* arguments = info->scope()->arguments(); | 270 Variable* arguments = info->scope()->arguments(); |
297 if (arguments != NULL) { | 271 if (arguments != NULL) { |
298 // Function uses arguments object. | 272 // Function uses arguments object. |
299 Comment cmnt(masm_, "[ Allocate arguments object"); | 273 Comment cmnt(masm_, "[ Allocate arguments object"); |
300 if (!function_in_register_a1) { | 274 if (!function_in_register_a1) { |
301 // Load this again, if it's used by the local context below. | 275 // Load this again, if it's used by the local context below. |
302 __ ld(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 276 __ ld(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
303 } | 277 } |
304 if (is_strict(language_mode()) || !has_simple_parameters()) { | 278 if (is_strict(language_mode()) || !has_simple_parameters()) { |
(...skipping 2933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3238 reinterpret_cast<uint64_t>( | 3212 reinterpret_cast<uint64_t>( |
3239 isolate->builtins()->OnStackReplacement()->entry())); | 3213 isolate->builtins()->OnStackReplacement()->entry())); |
3240 return ON_STACK_REPLACEMENT; | 3214 return ON_STACK_REPLACEMENT; |
3241 } | 3215 } |
3242 | 3216 |
3243 | 3217 |
3244 } // namespace internal | 3218 } // namespace internal |
3245 } // namespace v8 | 3219 } // namespace v8 |
3246 | 3220 |
3247 #endif // V8_TARGET_ARCH_MIPS64 | 3221 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |