| 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 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 2030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2041 __ leap(rsp, Operand(rsp, index.reg, index.scale, 1 * kPointerSize)); | 2041 __ leap(rsp, Operand(rsp, index.reg, index.scale, 1 * kPointerSize)); |
| 2042 __ PushReturnAddressFrom(rcx); | 2042 __ PushReturnAddressFrom(rcx); |
| 2043 } | 2043 } |
| 2044 | 2044 |
| 2045 // static | 2045 // static |
| 2046 void Builtins::Generate_AllocateInNewSpace(MacroAssembler* masm) { | 2046 void Builtins::Generate_AllocateInNewSpace(MacroAssembler* masm) { |
| 2047 // ----------- S t a t e ------------- | 2047 // ----------- S t a t e ------------- |
| 2048 // -- rdx : requested object size (untagged) | 2048 // -- rdx : requested object size (untagged) |
| 2049 // -- rsp[0] : return address | 2049 // -- rsp[0] : return address |
| 2050 // ----------------------------------- | 2050 // ----------------------------------- |
| 2051 Label runtime; | |
| 2052 __ Allocate(rdx, rax, rcx, rdi, &runtime, NO_ALLOCATION_FLAGS); | |
| 2053 __ Ret(); | |
| 2054 | |
| 2055 __ bind(&runtime); | |
| 2056 __ Integer32ToSmi(rdx, rdx); | 2051 __ Integer32ToSmi(rdx, rdx); |
| 2057 __ PopReturnAddressTo(rcx); | 2052 __ PopReturnAddressTo(rcx); |
| 2058 __ Push(rdx); | 2053 __ Push(rdx); |
| 2059 __ PushReturnAddressFrom(rcx); | 2054 __ PushReturnAddressFrom(rcx); |
| 2060 __ Move(rsi, Smi::FromInt(0)); | 2055 __ Move(rsi, Smi::FromInt(0)); |
| 2061 __ TailCallRuntime(Runtime::kAllocateInNewSpace); | 2056 __ TailCallRuntime(Runtime::kAllocateInNewSpace); |
| 2062 } | 2057 } |
| 2063 | 2058 |
| 2064 // static | 2059 // static |
| 2065 void Builtins::Generate_AllocateInOldSpace(MacroAssembler* masm) { | 2060 void Builtins::Generate_AllocateInOldSpace(MacroAssembler* masm) { |
| 2066 // ----------- S t a t e ------------- | 2061 // ----------- S t a t e ------------- |
| 2067 // -- rdx : requested object size (untagged) | 2062 // -- rdx : requested object size (untagged) |
| 2068 // -- rsp[0] : return address | 2063 // -- rsp[0] : return address |
| 2069 // ----------------------------------- | 2064 // ----------------------------------- |
| 2070 Label runtime; | |
| 2071 __ Allocate(rdx, rax, rcx, rdi, &runtime, PRETENURE); | |
| 2072 __ Ret(); | |
| 2073 | |
| 2074 __ bind(&runtime); | |
| 2075 __ Integer32ToSmi(rdx, rdx); | 2065 __ Integer32ToSmi(rdx, rdx); |
| 2076 __ PopReturnAddressTo(rcx); | 2066 __ PopReturnAddressTo(rcx); |
| 2077 __ Push(rdx); | 2067 __ Push(rdx); |
| 2078 __ Push(Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); | 2068 __ Push(Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); |
| 2079 __ PushReturnAddressFrom(rcx); | 2069 __ PushReturnAddressFrom(rcx); |
| 2080 __ Move(rsi, Smi::FromInt(0)); | 2070 __ Move(rsi, Smi::FromInt(0)); |
| 2081 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); | 2071 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); |
| 2082 } | 2072 } |
| 2083 | 2073 |
| 2084 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2074 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
| (...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2966 __ ret(0); | 2956 __ ret(0); |
| 2967 } | 2957 } |
| 2968 | 2958 |
| 2969 | 2959 |
| 2970 #undef __ | 2960 #undef __ |
| 2971 | 2961 |
| 2972 } // namespace internal | 2962 } // namespace internal |
| 2973 } // namespace v8 | 2963 } // namespace v8 |
| 2974 | 2964 |
| 2975 #endif // V8_TARGET_ARCH_X64 | 2965 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |