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/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 __ push(ebx); | 139 __ push(ebx); |
140 __ SmiTag(eax); | 140 __ SmiTag(eax); |
141 __ push(eax); | 141 __ push(eax); |
142 __ push(edi); | 142 __ push(edi); |
143 __ push(edx); | 143 __ push(edx); |
144 | 144 |
145 // Try to allocate the object without transitioning into C code. If any of | 145 // Try to allocate the object without transitioning into C code. If any of |
146 // the preconditions is not met, the code bails out to the runtime call. | 146 // the preconditions is not met, the code bails out to the runtime call. |
147 Label rt_call, allocated; | 147 Label rt_call, allocated; |
148 if (FLAG_inline_new) { | 148 if (FLAG_inline_new) { |
149 ExternalReference debug_step_in_fp = | |
150 ExternalReference::debug_step_in_fp_address(masm->isolate()); | |
151 __ cmp(Operand::StaticVariable(debug_step_in_fp), Immediate(0)); | |
152 __ j(not_equal, &rt_call); | |
153 | |
154 // Verify that the new target is a JSFunction. | 149 // Verify that the new target is a JSFunction. |
155 __ CmpObjectType(edx, JS_FUNCTION_TYPE, ebx); | 150 __ CmpObjectType(edx, JS_FUNCTION_TYPE, ebx); |
156 __ j(not_equal, &rt_call); | 151 __ j(not_equal, &rt_call); |
157 | 152 |
158 // Load the initial map and verify that it is in fact a map. | 153 // Load the initial map and verify that it is in fact a map. |
159 // edx: new target | 154 // edx: new target |
160 __ mov(eax, FieldOperand(edx, JSFunction::kPrototypeOrInitialMapOffset)); | 155 __ mov(eax, FieldOperand(edx, JSFunction::kPrototypeOrInitialMapOffset)); |
161 // Will both indicate a NULL and a Smi | 156 // Will both indicate a NULL and a Smi |
162 __ JumpIfSmi(eax, &rt_call); | 157 __ JumpIfSmi(eax, &rt_call); |
163 // edi: constructor | 158 // edi: constructor |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 // Copy arguments and receiver to the expression stack. | 417 // Copy arguments and receiver to the expression stack. |
423 Label loop, entry; | 418 Label loop, entry; |
424 __ mov(ecx, eax); | 419 __ mov(ecx, eax); |
425 __ jmp(&entry); | 420 __ jmp(&entry); |
426 __ bind(&loop); | 421 __ bind(&loop); |
427 __ push(Operand(ebx, ecx, times_4, 0)); | 422 __ push(Operand(ebx, ecx, times_4, 0)); |
428 __ bind(&entry); | 423 __ bind(&entry); |
429 __ dec(ecx); | 424 __ dec(ecx); |
430 __ j(greater_equal, &loop); | 425 __ j(greater_equal, &loop); |
431 | 426 |
432 // Handle step in. | |
433 Label skip_step_in; | |
434 ExternalReference debug_step_in_fp = | |
435 ExternalReference::debug_step_in_fp_address(masm->isolate()); | |
436 __ cmp(Operand::StaticVariable(debug_step_in_fp), Immediate(0)); | |
437 __ j(equal, &skip_step_in); | |
438 | |
439 __ push(eax); | |
440 __ push(edi); | |
441 __ push(edi); | |
442 __ CallRuntime(Runtime::kHandleStepInForDerivedConstructors, 1); | |
443 __ pop(edi); | |
444 __ pop(eax); | |
445 | |
446 __ bind(&skip_step_in); | |
447 | |
448 // Invoke function. | 427 // Invoke function. |
449 ParameterCount actual(eax); | 428 ParameterCount actual(eax); |
450 __ InvokeFunction(edi, actual, CALL_FUNCTION, NullCallWrapper()); | 429 __ InvokeFunction(edi, actual, CALL_FUNCTION, NullCallWrapper()); |
451 | 430 |
452 // Restore context from the frame. | 431 // Restore context from the frame. |
453 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 432 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
454 | 433 |
455 // Get arguments count, skipping over new.target. | 434 // Get arguments count, skipping over new.target. |
456 __ mov(ebx, Operand(esp, kPointerSize)); | 435 __ mov(ebx, Operand(esp, kPointerSize)); |
457 } | 436 } |
(...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1926 | 1905 |
1927 __ bind(&ok); | 1906 __ bind(&ok); |
1928 __ ret(0); | 1907 __ ret(0); |
1929 } | 1908 } |
1930 | 1909 |
1931 #undef __ | 1910 #undef __ |
1932 } // namespace internal | 1911 } // namespace internal |
1933 } // namespace v8 | 1912 } // namespace v8 |
1934 | 1913 |
1935 #endif // V8_TARGET_ARCH_IA32 | 1914 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |