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

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

Issue 2608203002: X87: [stubs] Port FastNewObjectStub to TF. (Closed)
Patch Set: 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 | « no previous file | src/x87/code-stubs-x87.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_X87 5 #if V8_TARGET_ARCH_X87
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 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after
1931 1931
1932 __ bind(&done_alloc); 1932 __ bind(&done_alloc);
1933 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); // Restore esi. 1933 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); // Restore esi.
1934 1934
1935 // 6. Fallback to the runtime to create new object. 1935 // 6. Fallback to the runtime to create new object.
1936 __ bind(&new_object); 1936 __ bind(&new_object);
1937 { 1937 {
1938 FrameScope scope(masm, StackFrame::MANUAL); 1938 FrameScope scope(masm, StackFrame::MANUAL);
1939 __ EnterBuiltinFrame(esi, edi, ecx); 1939 __ EnterBuiltinFrame(esi, edi, ecx);
1940 __ Push(ebx); // the first argument 1940 __ Push(ebx); // the first argument
1941 FastNewObjectStub stub(masm->isolate()); 1941 __ Call(CodeFactory::FastNewObject(masm->isolate()).code(),
1942 __ CallStub(&stub); 1942 RelocInfo::CODE_TARGET);
1943 __ Pop(FieldOperand(eax, JSValue::kValueOffset)); 1943 __ Pop(FieldOperand(eax, JSValue::kValueOffset));
1944 __ LeaveBuiltinFrame(esi, edi, ecx); 1944 __ LeaveBuiltinFrame(esi, edi, ecx);
1945 } 1945 }
1946 1946
1947 __ bind(&drop_frame_and_ret); 1947 __ bind(&drop_frame_and_ret);
1948 { 1948 {
1949 // Drop all arguments including the receiver. 1949 // Drop all arguments including the receiver.
1950 __ PopReturnAddressTo(esi); 1950 __ PopReturnAddressTo(esi);
1951 __ SmiUntag(ecx); 1951 __ SmiUntag(ecx);
1952 __ lea(esp, Operand(esp, ecx, times_pointer_size, kPointerSize)); 1952 __ lea(esp, Operand(esp, ecx, times_pointer_size, kPointerSize));
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2094 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); 2094 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
2095 } 2095 }
2096 2096
2097 // 6. Fallback to the runtime to create new object. 2097 // 6. Fallback to the runtime to create new object.
2098 __ bind(&new_object); 2098 __ bind(&new_object);
2099 { 2099 {
2100 FrameScope scope(masm, StackFrame::MANUAL); 2100 FrameScope scope(masm, StackFrame::MANUAL);
2101 __ SmiTag(ebx); 2101 __ SmiTag(ebx);
2102 __ EnterBuiltinFrame(esi, edi, ebx); 2102 __ EnterBuiltinFrame(esi, edi, ebx);
2103 __ Push(eax); // the first argument 2103 __ Push(eax); // the first argument
2104 FastNewObjectStub stub(masm->isolate()); 2104 __ Call(CodeFactory::FastNewObject(masm->isolate()).code(),
2105 __ CallStub(&stub); 2105 RelocInfo::CODE_TARGET);
2106 __ Pop(FieldOperand(eax, JSValue::kValueOffset)); 2106 __ Pop(FieldOperand(eax, JSValue::kValueOffset));
2107 __ LeaveBuiltinFrame(esi, edi, ebx); 2107 __ LeaveBuiltinFrame(esi, edi, ebx);
2108 __ SmiUntag(ebx); 2108 __ SmiUntag(ebx);
2109 } 2109 }
2110 2110
2111 __ bind(&drop_frame_and_ret); 2111 __ bind(&drop_frame_and_ret);
2112 { 2112 {
2113 // Drop all arguments including the receiver. 2113 // Drop all arguments including the receiver.
2114 __ PopReturnAddressTo(ecx); 2114 __ PopReturnAddressTo(ecx);
2115 __ lea(esp, Operand(esp, ebx, times_pointer_size, kPointerSize)); 2115 __ lea(esp, Operand(esp, ebx, times_pointer_size, kPointerSize));
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
3137 3137
3138 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { 3138 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
3139 Generate_OnStackReplacementHelper(masm, true); 3139 Generate_OnStackReplacementHelper(masm, true);
3140 } 3140 }
3141 3141
3142 #undef __ 3142 #undef __
3143 } // namespace internal 3143 } // namespace internal
3144 } // namespace v8 3144 } // namespace v8
3145 3145
3146 #endif // V8_TARGET_ARCH_X87 3146 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698