Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Side by Side Diff: src/builtins/x64/builtins-x64.cc

Issue 2606733002: [stubs] Port FastNewObjectStub to TF (Closed)
Patch Set: Review feedback Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/builtins/mips64/builtins-mips64.cc ('k') | src/code-factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 // Preserve the incoming parameters on the stack. 131 // Preserve the incoming parameters on the stack.
132 __ Integer32ToSmi(rcx, rax); 132 __ Integer32ToSmi(rcx, rax);
133 __ Push(rsi); 133 __ Push(rsi);
134 __ Push(rcx); 134 __ Push(rcx);
135 135
136 if (create_implicit_receiver) { 136 if (create_implicit_receiver) {
137 // Allocate the new receiver object. 137 // Allocate the new receiver object.
138 __ Push(rdi); 138 __ Push(rdi);
139 __ Push(rdx); 139 __ Push(rdx);
140 FastNewObjectStub stub(masm->isolate()); 140 __ Call(CodeFactory::FastNewObject(masm->isolate()).code(),
141 __ CallStub(&stub); 141 RelocInfo::CODE_TARGET);
142 __ movp(rbx, rax); 142 __ movp(rbx, rax);
143 __ Pop(rdx); 143 __ Pop(rdx);
144 __ Pop(rdi); 144 __ Pop(rdi);
145 145
146 // ----------- S t a t e ------------- 146 // ----------- S t a t e -------------
147 // -- rdi: constructor function 147 // -- rdi: constructor function
148 // -- rbx: newly allocated object 148 // -- rbx: newly allocated object
149 // -- rdx: new target 149 // -- rdx: new target
150 // ----------------------------------- 150 // -----------------------------------
151 151
(...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 // 5. Allocate a JSValue wrapper for the number. 1871 // 5. Allocate a JSValue wrapper for the number.
1872 __ AllocateJSValue(rax, rdi, rbx, rcx, &new_object); 1872 __ AllocateJSValue(rax, rdi, rbx, rcx, &new_object);
1873 __ jmp(&drop_frame_and_ret, Label::kNear); 1873 __ jmp(&drop_frame_and_ret, Label::kNear);
1874 1874
1875 // 6. Fallback to the runtime to create new object. 1875 // 6. Fallback to the runtime to create new object.
1876 __ bind(&new_object); 1876 __ bind(&new_object);
1877 { 1877 {
1878 FrameScope scope(masm, StackFrame::MANUAL); 1878 FrameScope scope(masm, StackFrame::MANUAL);
1879 __ EnterBuiltinFrame(rsi, rdi, r8); 1879 __ EnterBuiltinFrame(rsi, rdi, r8);
1880 __ Push(rbx); // the first argument 1880 __ Push(rbx); // the first argument
1881 FastNewObjectStub stub(masm->isolate()); 1881 __ Call(CodeFactory::FastNewObject(masm->isolate()).code(),
1882 __ CallStub(&stub); 1882 RelocInfo::CODE_TARGET);
1883 __ Pop(FieldOperand(rax, JSValue::kValueOffset)); 1883 __ Pop(FieldOperand(rax, JSValue::kValueOffset));
1884 __ LeaveBuiltinFrame(rsi, rdi, r8); 1884 __ LeaveBuiltinFrame(rsi, rdi, r8);
1885 } 1885 }
1886 1886
1887 __ bind(&drop_frame_and_ret); 1887 __ bind(&drop_frame_and_ret);
1888 { 1888 {
1889 // Drop all arguments including the receiver. 1889 // Drop all arguments including the receiver.
1890 __ PopReturnAddressTo(rcx); 1890 __ PopReturnAddressTo(rcx);
1891 __ SmiToInteger32(r8, r8); 1891 __ SmiToInteger32(r8, r8);
1892 __ leap(rsp, Operand(rsp, r8, times_pointer_size, kPointerSize)); 1892 __ leap(rsp, Operand(rsp, r8, times_pointer_size, kPointerSize));
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2026 // 5. Allocate a JSValue wrapper for the string. 2026 // 5. Allocate a JSValue wrapper for the string.
2027 __ AllocateJSValue(rax, rdi, rbx, rcx, &new_object); 2027 __ AllocateJSValue(rax, rdi, rbx, rcx, &new_object);
2028 __ jmp(&drop_frame_and_ret, Label::kNear); 2028 __ jmp(&drop_frame_and_ret, Label::kNear);
2029 2029
2030 // 6. Fallback to the runtime to create new object. 2030 // 6. Fallback to the runtime to create new object.
2031 __ bind(&new_object); 2031 __ bind(&new_object);
2032 { 2032 {
2033 FrameScope scope(masm, StackFrame::MANUAL); 2033 FrameScope scope(masm, StackFrame::MANUAL);
2034 __ EnterBuiltinFrame(rsi, rdi, r8); 2034 __ EnterBuiltinFrame(rsi, rdi, r8);
2035 __ Push(rbx); // the first argument 2035 __ Push(rbx); // the first argument
2036 FastNewObjectStub stub(masm->isolate()); 2036 __ Call(CodeFactory::FastNewObject(masm->isolate()).code(),
2037 __ CallStub(&stub); 2037 RelocInfo::CODE_TARGET);
2038 __ Pop(FieldOperand(rax, JSValue::kValueOffset)); 2038 __ Pop(FieldOperand(rax, JSValue::kValueOffset));
2039 __ LeaveBuiltinFrame(rsi, rdi, r8); 2039 __ LeaveBuiltinFrame(rsi, rdi, r8);
2040 } 2040 }
2041 2041
2042 __ bind(&drop_frame_and_ret); 2042 __ bind(&drop_frame_and_ret);
2043 { 2043 {
2044 // Drop all arguments including the receiver. 2044 // Drop all arguments including the receiver.
2045 __ PopReturnAddressTo(rcx); 2045 __ PopReturnAddressTo(rcx);
2046 __ SmiToInteger32(r8, r8); 2046 __ SmiToInteger32(r8, r8);
2047 __ leap(rsp, Operand(rsp, r8, times_pointer_size, kPointerSize)); 2047 __ leap(rsp, Operand(rsp, r8, times_pointer_size, kPointerSize));
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
3048 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { 3048 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
3049 Generate_OnStackReplacementHelper(masm, true); 3049 Generate_OnStackReplacementHelper(masm, true);
3050 } 3050 }
3051 3051
3052 #undef __ 3052 #undef __
3053 3053
3054 } // namespace internal 3054 } // namespace internal
3055 } // namespace v8 3055 } // namespace v8
3056 3056
3057 #endif // V8_TARGET_ARCH_X64 3057 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/builtins/mips64/builtins-mips64.cc ('k') | src/code-factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698