| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 __ jmp(&done); | 267 __ jmp(&done); |
| 268 | 268 |
| 269 // Non-construct frame | 269 // Non-construct frame |
| 270 __ bind(&non_construct_frame); | 270 __ bind(&non_construct_frame); |
| 271 __ mov(eax, Immediate(isolate()->factory()->undefined_value())); | 271 __ mov(eax, Immediate(isolate()->factory()->undefined_value())); |
| 272 | 272 |
| 273 __ bind(&done); | 273 __ bind(&done); |
| 274 SetVar(new_target_var, eax, ebx, edx); | 274 SetVar(new_target_var, eax, ebx, edx); |
| 275 } | 275 } |
| 276 | 276 |
| 277 | |
| 278 // Possibly allocate RestParameters | |
| 279 int rest_index; | |
| 280 Variable* rest_param = scope()->rest_parameter(&rest_index); | |
| 281 if (rest_param) { | |
| 282 Comment cmnt(masm_, "[ Allocate rest parameter array"); | |
| 283 | |
| 284 int num_parameters = info->scope()->num_parameters(); | |
| 285 int offset = num_parameters * kPointerSize; | |
| 286 | |
| 287 __ lea(edx, | |
| 288 Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset)); | |
| 289 __ push(edx); | |
| 290 __ push(Immediate(Smi::FromInt(num_parameters))); | |
| 291 __ push(Immediate(Smi::FromInt(rest_index))); | |
| 292 __ push(Immediate(Smi::FromInt(language_mode()))); | |
| 293 | |
| 294 RestParamAccessStub stub(isolate()); | |
| 295 __ CallStub(&stub); | |
| 296 | |
| 297 SetVar(rest_param, eax, ebx, edx); | |
| 298 } | |
| 299 | |
| 300 Variable* arguments = scope()->arguments(); | 277 Variable* arguments = scope()->arguments(); |
| 301 if (arguments != NULL) { | 278 if (arguments != NULL) { |
| 302 // Function uses arguments object. | 279 // Function uses arguments object. |
| 303 Comment cmnt(masm_, "[ Allocate arguments object"); | 280 Comment cmnt(masm_, "[ Allocate arguments object"); |
| 304 if (function_in_register) { | 281 if (function_in_register) { |
| 305 __ push(edi); | 282 __ push(edi); |
| 306 } else { | 283 } else { |
| 307 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 284 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
| 308 } | 285 } |
| 309 // Receiver is just before the parameters on the caller's stack. | 286 // Receiver is just before the parameters on the caller's stack. |
| (...skipping 4939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5249 Assembler::target_address_at(call_target_address, | 5226 Assembler::target_address_at(call_target_address, |
| 5250 unoptimized_code)); | 5227 unoptimized_code)); |
| 5251 return OSR_AFTER_STACK_CHECK; | 5228 return OSR_AFTER_STACK_CHECK; |
| 5252 } | 5229 } |
| 5253 | 5230 |
| 5254 | 5231 |
| 5255 } // namespace internal | 5232 } // namespace internal |
| 5256 } // namespace v8 | 5233 } // namespace v8 |
| 5257 | 5234 |
| 5258 #endif // V8_TARGET_ARCH_IA32 | 5235 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |