| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 6 | 6 |
| 7 #include "src/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
| 8 #include "src/ast/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
| 9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 } | 254 } |
| 255 } | 255 } |
| 256 } | 256 } |
| 257 | 257 |
| 258 // Register holding this function and new target are both trashed in case we | 258 // Register holding this function and new target are both trashed in case we |
| 259 // bailout here. But since that can happen only when new target is not used | 259 // bailout here. But since that can happen only when new target is not used |
| 260 // and we allocate a context, the value of |function_in_register| is correct. | 260 // and we allocate a context, the value of |function_in_register| is correct. |
| 261 PrepareForBailoutForId(BailoutId::FunctionContext(), | 261 PrepareForBailoutForId(BailoutId::FunctionContext(), |
| 262 BailoutState::NO_REGISTERS); | 262 BailoutState::NO_REGISTERS); |
| 263 | 263 |
| 264 // Possibly set up a local binding to the this function which is used in | 264 // We don't support new.target and rest parameters here. |
| 265 // derived constructors with super calls. | 265 DCHECK_NULL(info->scope()->new_target_var()); |
| 266 Variable* this_function_var = info->scope()->this_function_var(); | 266 DCHECK_NULL(info->scope()->rest_parameter()); |
| 267 if (this_function_var != nullptr) { | 267 DCHECK_NULL(info->scope()->this_function_var()); |
| 268 Comment cmnt(masm_, "[ This function"); | |
| 269 if (!function_in_register_r4) { | |
| 270 __ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | |
| 271 // The write barrier clobbers register again, keep it marked as such. | |
| 272 } | |
| 273 SetVar(this_function_var, r4, r3, r5); | |
| 274 } | |
| 275 | |
| 276 // Possibly set up a local binding to the new target value. | |
| 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, r6, r3, r5); | |
| 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_r4) { | |
| 288 __ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | |
| 289 } | |
| 290 FastNewRestParameterStub stub(isolate()); | |
| 291 __ CallStub(&stub); | |
| 292 function_in_register_r4 = false; | |
| 293 SetVar(rest_param, r3, r4, r5); | |
| 294 } | |
| 295 | 268 |
| 296 Variable* arguments = info->scope()->arguments(); | 269 Variable* arguments = info->scope()->arguments(); |
| 297 if (arguments != NULL) { | 270 if (arguments != NULL) { |
| 298 // Function uses arguments object. | 271 // Function uses arguments object. |
| 299 Comment cmnt(masm_, "[ Allocate arguments object"); | 272 Comment cmnt(masm_, "[ Allocate arguments object"); |
| 300 if (!function_in_register_r4) { | 273 if (!function_in_register_r4) { |
| 301 // Load this again, if it's used by the local context below. | 274 // Load this again, if it's used by the local context below. |
| 302 __ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 275 __ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 303 } | 276 } |
| 304 if (is_strict(language_mode()) || !has_simple_parameters()) { | 277 if (is_strict(language_mode()) || !has_simple_parameters()) { |
| (...skipping 2906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3211 | 3184 |
| 3212 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3185 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
| 3213 | 3186 |
| 3214 DCHECK(interrupt_address == | 3187 DCHECK(interrupt_address == |
| 3215 isolate->builtins()->OnStackReplacement()->entry()); | 3188 isolate->builtins()->OnStackReplacement()->entry()); |
| 3216 return ON_STACK_REPLACEMENT; | 3189 return ON_STACK_REPLACEMENT; |
| 3217 } | 3190 } |
| 3218 } // namespace internal | 3191 } // namespace internal |
| 3219 } // namespace v8 | 3192 } // namespace v8 |
| 3220 #endif // V8_TARGET_ARCH_PPC | 3193 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |