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 2606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2617 __ Jump(masm->isolate()->builtins()->ConstructedNonConstructable(), | 2617 __ Jump(masm->isolate()->builtins()->ConstructedNonConstructable(), |
2618 RelocInfo::CODE_TARGET); | 2618 RelocInfo::CODE_TARGET); |
2619 } | 2619 } |
2620 | 2620 |
2621 // static | 2621 // static |
2622 void Builtins::Generate_AllocateInNewSpace(MacroAssembler* masm) { | 2622 void Builtins::Generate_AllocateInNewSpace(MacroAssembler* masm) { |
2623 // ----------- S t a t e ------------- | 2623 // ----------- S t a t e ------------- |
2624 // -- edx : requested object size (untagged) | 2624 // -- edx : requested object size (untagged) |
2625 // -- esp[0] : return address | 2625 // -- esp[0] : return address |
2626 // ----------------------------------- | 2626 // ----------------------------------- |
2627 Label runtime; | |
2628 __ Allocate(edx, eax, ecx, edi, &runtime, NO_ALLOCATION_FLAGS); | |
2629 __ Ret(); | |
2630 | |
2631 __ bind(&runtime); | |
2632 __ SmiTag(edx); | 2627 __ SmiTag(edx); |
2633 __ PopReturnAddressTo(ecx); | 2628 __ PopReturnAddressTo(ecx); |
2634 __ Push(edx); | 2629 __ Push(edx); |
2635 __ PushReturnAddressFrom(ecx); | 2630 __ PushReturnAddressFrom(ecx); |
2636 __ Move(esi, Smi::FromInt(0)); | 2631 __ Move(esi, Smi::FromInt(0)); |
2637 __ TailCallRuntime(Runtime::kAllocateInNewSpace); | 2632 __ TailCallRuntime(Runtime::kAllocateInNewSpace); |
2638 } | 2633 } |
2639 | 2634 |
2640 // static | 2635 // static |
2641 void Builtins::Generate_AllocateInOldSpace(MacroAssembler* masm) { | 2636 void Builtins::Generate_AllocateInOldSpace(MacroAssembler* masm) { |
2642 // ----------- S t a t e ------------- | 2637 // ----------- S t a t e ------------- |
2643 // -- edx : requested object size (untagged) | 2638 // -- edx : requested object size (untagged) |
2644 // -- esp[0] : return address | 2639 // -- esp[0] : return address |
2645 // ----------------------------------- | 2640 // ----------------------------------- |
2646 Label runtime; | |
2647 __ Allocate(edx, eax, ecx, edi, &runtime, PRETENURE); | |
2648 __ Ret(); | |
2649 | |
2650 __ bind(&runtime); | |
2651 __ SmiTag(edx); | 2641 __ SmiTag(edx); |
2652 __ PopReturnAddressTo(ecx); | 2642 __ PopReturnAddressTo(ecx); |
2653 __ Push(edx); | 2643 __ Push(edx); |
2654 __ Push(Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); | 2644 __ Push(Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); |
2655 __ PushReturnAddressFrom(ecx); | 2645 __ PushReturnAddressFrom(ecx); |
2656 __ Move(esi, Smi::FromInt(0)); | 2646 __ Move(esi, Smi::FromInt(0)); |
2657 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); | 2647 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); |
2658 } | 2648 } |
2659 | 2649 |
2660 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2650 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2908 // And "return" to the OSR entry point of the function. | 2898 // And "return" to the OSR entry point of the function. |
2909 __ ret(0); | 2899 __ ret(0); |
2910 } | 2900 } |
2911 | 2901 |
2912 | 2902 |
2913 #undef __ | 2903 #undef __ |
2914 } // namespace internal | 2904 } // namespace internal |
2915 } // namespace v8 | 2905 } // namespace v8 |
2916 | 2906 |
2917 #endif // V8_TARGET_ARCH_IA32 | 2907 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |