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

Side by Side Diff: src/builtins/ia32/builtins-ia32.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/builtins-constructor.cc ('k') | src/builtins/mips/builtins-mips.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_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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 // Preserve the incoming parameters on the stack. 129 // Preserve the incoming parameters on the stack.
130 __ SmiTag(eax); 130 __ SmiTag(eax);
131 __ push(esi); 131 __ push(esi);
132 __ push(eax); 132 __ push(eax);
133 133
134 if (create_implicit_receiver) { 134 if (create_implicit_receiver) {
135 // Allocate the new receiver object. 135 // Allocate the new receiver object.
136 __ Push(edi); 136 __ Push(edi);
137 __ Push(edx); 137 __ Push(edx);
138 FastNewObjectStub stub(masm->isolate()); 138 __ Call(CodeFactory::FastNewObject(masm->isolate()).code(),
139 __ CallStub(&stub); 139 RelocInfo::CODE_TARGET);
140 __ mov(ebx, eax); 140 __ mov(ebx, eax);
141 __ Pop(edx); 141 __ Pop(edx);
142 __ Pop(edi); 142 __ Pop(edi);
143 143
144 // ----------- S t a t e ------------- 144 // ----------- S t a t e -------------
145 // -- edi: constructor function 145 // -- edi: constructor function
146 // -- ebx: newly allocated object 146 // -- ebx: newly allocated object
147 // -- edx: new target 147 // -- edx: new target
148 // ----------------------------------- 148 // -----------------------------------
149 149
(...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1914 1914
1915 __ bind(&done_alloc); 1915 __ bind(&done_alloc);
1916 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); // Restore esi. 1916 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); // Restore esi.
1917 1917
1918 // 6. Fallback to the runtime to create new object. 1918 // 6. Fallback to the runtime to create new object.
1919 __ bind(&new_object); 1919 __ bind(&new_object);
1920 { 1920 {
1921 FrameScope scope(masm, StackFrame::MANUAL); 1921 FrameScope scope(masm, StackFrame::MANUAL);
1922 __ EnterBuiltinFrame(esi, edi, ecx); 1922 __ EnterBuiltinFrame(esi, edi, ecx);
1923 __ Push(ebx); // the first argument 1923 __ Push(ebx); // the first argument
1924 FastNewObjectStub stub(masm->isolate()); 1924 __ Call(CodeFactory::FastNewObject(masm->isolate()).code(),
1925 __ CallStub(&stub); 1925 RelocInfo::CODE_TARGET);
1926 __ Pop(FieldOperand(eax, JSValue::kValueOffset)); 1926 __ Pop(FieldOperand(eax, JSValue::kValueOffset));
1927 __ LeaveBuiltinFrame(esi, edi, ecx); 1927 __ LeaveBuiltinFrame(esi, edi, ecx);
1928 } 1928 }
1929 1929
1930 __ bind(&drop_frame_and_ret); 1930 __ bind(&drop_frame_and_ret);
1931 { 1931 {
1932 // Drop all arguments including the receiver. 1932 // Drop all arguments including the receiver.
1933 __ PopReturnAddressTo(esi); 1933 __ PopReturnAddressTo(esi);
1934 __ SmiUntag(ecx); 1934 __ SmiUntag(ecx);
1935 __ lea(esp, Operand(esp, ecx, times_pointer_size, kPointerSize)); 1935 __ lea(esp, Operand(esp, ecx, times_pointer_size, kPointerSize));
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2077 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); 2077 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
2078 } 2078 }
2079 2079
2080 // 6. Fallback to the runtime to create new object. 2080 // 6. Fallback to the runtime to create new object.
2081 __ bind(&new_object); 2081 __ bind(&new_object);
2082 { 2082 {
2083 FrameScope scope(masm, StackFrame::MANUAL); 2083 FrameScope scope(masm, StackFrame::MANUAL);
2084 __ SmiTag(ebx); 2084 __ SmiTag(ebx);
2085 __ EnterBuiltinFrame(esi, edi, ebx); 2085 __ EnterBuiltinFrame(esi, edi, ebx);
2086 __ Push(eax); // the first argument 2086 __ Push(eax); // the first argument
2087 FastNewObjectStub stub(masm->isolate()); 2087 __ Call(CodeFactory::FastNewObject(masm->isolate()).code(),
2088 __ CallStub(&stub); 2088 RelocInfo::CODE_TARGET);
2089 __ Pop(FieldOperand(eax, JSValue::kValueOffset)); 2089 __ Pop(FieldOperand(eax, JSValue::kValueOffset));
2090 __ LeaveBuiltinFrame(esi, edi, ebx); 2090 __ LeaveBuiltinFrame(esi, edi, ebx);
2091 __ SmiUntag(ebx); 2091 __ SmiUntag(ebx);
2092 } 2092 }
2093 2093
2094 __ bind(&drop_frame_and_ret); 2094 __ bind(&drop_frame_and_ret);
2095 { 2095 {
2096 // Drop all arguments including the receiver. 2096 // Drop all arguments including the receiver.
2097 __ PopReturnAddressTo(ecx); 2097 __ PopReturnAddressTo(ecx);
2098 __ lea(esp, Operand(esp, ebx, times_pointer_size, kPointerSize)); 2098 __ lea(esp, Operand(esp, ebx, times_pointer_size, kPointerSize));
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
3109 3109
3110 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { 3110 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
3111 Generate_OnStackReplacementHelper(masm, true); 3111 Generate_OnStackReplacementHelper(masm, true);
3112 } 3112 }
3113 3113
3114 #undef __ 3114 #undef __
3115 } // namespace internal 3115 } // namespace internal
3116 } // namespace v8 3116 } // namespace v8
3117 3117
3118 #endif // V8_TARGET_ARCH_IA32 3118 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/builtins/builtins-constructor.cc ('k') | src/builtins/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698