| 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_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 } | 235 } |
| 236 } | 236 } |
| 237 } | 237 } |
| 238 | 238 |
| 239 // Register holding this function and new target are both trashed in case we | 239 // Register holding this function and new target are both trashed in case we |
| 240 // bailout here. But since that can happen only when new target is not used | 240 // bailout here. But since that can happen only when new target is not used |
| 241 // and we allocate a context, the value of |function_in_register| is correct. | 241 // and we allocate a context, the value of |function_in_register| is correct. |
| 242 PrepareForBailoutForId(BailoutId::FunctionContext(), | 242 PrepareForBailoutForId(BailoutId::FunctionContext(), |
| 243 BailoutState::NO_REGISTERS); | 243 BailoutState::NO_REGISTERS); |
| 244 | 244 |
| 245 // Possibly set up a local binding to the this function which is used in | 245 // We don't support new.target and rest parameters here. |
| 246 // derived constructors with super calls. | 246 DCHECK_NULL(info->scope()->new_target_var()); |
| 247 Variable* this_function_var = info->scope()->this_function_var(); | 247 DCHECK_NULL(info->scope()->rest_parameter()); |
| 248 if (this_function_var != nullptr) { | 248 DCHECK_NULL(info->scope()->this_function_var()); |
| 249 Comment cmnt(masm_, "[ This function"); | |
| 250 if (!function_in_register) { | |
| 251 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | |
| 252 // The write barrier clobbers register again, keep it marked as such. | |
| 253 } | |
| 254 SetVar(this_function_var, edi, ebx, ecx); | |
| 255 } | |
| 256 | |
| 257 // Possibly set up a local binding to the new target value. | |
| 258 Variable* new_target_var = info->scope()->new_target_var(); | |
| 259 if (new_target_var != nullptr) { | |
| 260 Comment cmnt(masm_, "[ new.target"); | |
| 261 SetVar(new_target_var, edx, ebx, ecx); | |
| 262 } | |
| 263 | |
| 264 // Possibly allocate RestParameters | |
| 265 Variable* rest_param = info->scope()->rest_parameter(); | |
| 266 if (rest_param != nullptr) { | |
| 267 Comment cmnt(masm_, "[ Allocate rest parameter array"); | |
| 268 if (!function_in_register) { | |
| 269 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | |
| 270 } | |
| 271 FastNewRestParameterStub stub(isolate()); | |
| 272 __ CallStub(&stub); | |
| 273 function_in_register = false; | |
| 274 SetVar(rest_param, eax, ebx, edx); | |
| 275 } | |
| 276 | 249 |
| 277 Variable* arguments = info->scope()->arguments(); | 250 Variable* arguments = info->scope()->arguments(); |
| 278 if (arguments != NULL) { | 251 if (arguments != NULL) { |
| 279 // Arguments object must be allocated after the context object, in | 252 // Arguments object must be allocated after the context object, in |
| 280 // case the "arguments" or ".arguments" variables are in the context. | 253 // case the "arguments" or ".arguments" variables are in the context. |
| 281 Comment cmnt(masm_, "[ Allocate arguments object"); | 254 Comment cmnt(masm_, "[ Allocate arguments object"); |
| 282 if (!function_in_register) { | 255 if (!function_in_register) { |
| 283 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 256 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
| 284 } | 257 } |
| 285 if (is_strict(language_mode()) || !has_simple_parameters()) { | 258 if (is_strict(language_mode()) || !has_simple_parameters()) { |
| (...skipping 2836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3122 isolate->builtins()->OnStackReplacement()->entry(), | 3095 isolate->builtins()->OnStackReplacement()->entry(), |
| 3123 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3096 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 3124 return ON_STACK_REPLACEMENT; | 3097 return ON_STACK_REPLACEMENT; |
| 3125 } | 3098 } |
| 3126 | 3099 |
| 3127 | 3100 |
| 3128 } // namespace internal | 3101 } // namespace internal |
| 3129 } // namespace v8 | 3102 } // namespace v8 |
| 3130 | 3103 |
| 3131 #endif // V8_TARGET_ARCH_X87 | 3104 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |