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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
276 __ mov(eax, Immediate(isolate()->factory()->undefined_value())); | 276 __ mov(eax, Immediate(isolate()->factory()->undefined_value())); |
277 | 277 |
278 __ bind(&done); | 278 __ bind(&done); |
279 SetVar(new_target_var, eax, ebx, edx); | 279 SetVar(new_target_var, eax, ebx, edx); |
280 } | 280 } |
281 | 281 |
282 Variable* arguments = scope()->arguments(); | 282 Variable* arguments = scope()->arguments(); |
283 if (arguments != NULL) { | 283 if (arguments != NULL) { |
284 // Function uses arguments object. | 284 // Function uses arguments object. |
285 Comment cmnt(masm_, "[ Allocate arguments object"); | 285 Comment cmnt(masm_, "[ Allocate arguments object"); |
286 if (function_in_register) { | 286 if (!function_in_register) { |
287 __ push(edi); | 287 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
288 } else { | |
289 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | |
290 } | 288 } |
291 // Receiver is just before the parameters on the caller's stack. | 289 // Receiver is just before the parameters on the caller's stack. |
290 DCHECK(edi.is(ArgumentsAccessNewDescriptor::callee())); | |
292 int num_parameters = info->scope()->num_parameters(); | 291 int num_parameters = info->scope()->num_parameters(); |
293 int offset = num_parameters * kPointerSize; | 292 int offset = num_parameters * kPointerSize; |
294 __ lea(edx, | 293 __ mov(ArgumentsAccessNewDescriptor::parameter_count(), |
294 Immediate(Smi::FromInt(num_parameters))); | |
295 __ lea(ArgumentsAccessNewDescriptor::parameter_pointer(), | |
295 Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset)); | 296 Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset)); |
296 __ push(edx); | |
297 __ push(Immediate(Smi::FromInt(num_parameters))); | |
298 // Arguments to ArgumentsAccessStub: | 297 // Arguments to ArgumentsAccessStub: |
299 // function, receiver address, parameter count. | 298 // function, parameter pointer, parameter count. |
300 // The stub will rewrite receiver and parameter count if the previous | 299 // The stub will rewrite parameter pointer and parameter count if the |
301 // stack frame was an arguments adapter frame. | 300 // previous stack frame was an arguments adapter frame. |
302 ArgumentsAccessStub::Type type; | 301 ArgumentsAccessStub::Type type; |
303 if (is_strict(language_mode()) || !has_simple_parameters()) { | 302 if (is_strict(language_mode()) || !has_simple_parameters()) { |
304 type = ArgumentsAccessStub::NEW_STRICT; | 303 type = ArgumentsAccessStub::NEW_STRICT; |
305 } else if (literal()->has_duplicate_parameters()) { | 304 } else if (literal()->has_duplicate_parameters()) { |
306 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; | 305 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; |
307 } else { | 306 } else { |
307 __ push(edi); | |
308 __ push(edx); | |
309 __ push(ecx); | |
308 type = ArgumentsAccessStub::NEW_SLOPPY_FAST; | 310 type = ArgumentsAccessStub::NEW_SLOPPY_FAST; |
Michael Starzinger
2015/09/16 15:19:20
I am still fighting with this third kind of stub,
Michael Starzinger
2015/09/17 11:16:45
Done.
| |
309 } | 311 } |
310 | 312 |
311 ArgumentsAccessStub stub(isolate(), type); | 313 ArgumentsAccessStub stub(isolate(), type); |
312 __ CallStub(&stub); | 314 __ CallStub(&stub); |
313 | 315 |
314 SetVar(arguments, eax, ebx, edx); | 316 SetVar(arguments, eax, ebx, edx); |
315 } | 317 } |
316 | 318 |
317 if (FLAG_trace) { | 319 if (FLAG_trace) { |
318 __ CallRuntime(Runtime::kTraceEnter, 0); | 320 __ CallRuntime(Runtime::kTraceEnter, 0); |
(...skipping 4832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5151 Assembler::target_address_at(call_target_address, | 5153 Assembler::target_address_at(call_target_address, |
5152 unoptimized_code)); | 5154 unoptimized_code)); |
5153 return OSR_AFTER_STACK_CHECK; | 5155 return OSR_AFTER_STACK_CHECK; |
5154 } | 5156 } |
5155 | 5157 |
5156 | 5158 |
5157 } // namespace internal | 5159 } // namespace internal |
5158 } // namespace v8 | 5160 } // namespace v8 |
5159 | 5161 |
5160 #endif // V8_TARGET_ARCH_IA32 | 5162 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |