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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 911363002: Revert of new classes: implement new.target passing to superclass constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/ia32/builtins-ia32.cc ('k') | src/ia32/deoptimizer-ia32.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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 StubRuntimeCallHelper call_helper; 731 StubRuntimeCallHelper call_helper;
732 char_at_generator.GenerateSlow(masm, call_helper); 732 char_at_generator.GenerateSlow(masm, call_helper);
733 733
734 __ bind(&miss); 734 __ bind(&miss);
735 PropertyAccessCompiler::TailCallBuiltin( 735 PropertyAccessCompiler::TailCallBuiltin(
736 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); 736 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC));
737 } 737 }
738 738
739 739
740 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { 740 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
741 CHECK(!has_new_target());
742 // The key is in edx and the parameter count is in eax. 741 // The key is in edx and the parameter count is in eax.
743 DCHECK(edx.is(ArgumentsAccessReadDescriptor::index())); 742 DCHECK(edx.is(ArgumentsAccessReadDescriptor::index()));
744 DCHECK(eax.is(ArgumentsAccessReadDescriptor::parameter_count())); 743 DCHECK(eax.is(ArgumentsAccessReadDescriptor::parameter_count()));
745 744
746 // The displacement is used for skipping the frame pointer on the 745 // The displacement is used for skipping the frame pointer on the
747 // stack. It is the offset of the last parameter (if any) relative 746 // stack. It is the offset of the last parameter (if any) relative
748 // to the frame pointer. 747 // to the frame pointer.
749 static const int kDisplacement = 1 * kPointerSize; 748 static const int kDisplacement = 1 * kPointerSize;
750 749
751 // Check that the key is a smi. 750 // Check that the key is a smi.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); 797 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1);
799 } 798 }
800 799
801 800
802 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { 801 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) {
803 // esp[0] : return address 802 // esp[0] : return address
804 // esp[4] : number of parameters 803 // esp[4] : number of parameters
805 // esp[8] : receiver displacement 804 // esp[8] : receiver displacement
806 // esp[12] : function 805 // esp[12] : function
807 806
808 CHECK(!has_new_target());
809
810 // Check if the calling frame is an arguments adaptor frame. 807 // Check if the calling frame is an arguments adaptor frame.
811 Label runtime; 808 Label runtime;
812 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); 809 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
813 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset)); 810 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset));
814 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 811 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
815 __ j(not_equal, &runtime, Label::kNear); 812 __ j(not_equal, &runtime, Label::kNear);
816 813
817 // Patch the arguments.length and the parameters pointer. 814 // Patch the arguments.length and the parameters pointer.
818 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); 815 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset));
819 __ mov(Operand(esp, 1 * kPointerSize), ecx); 816 __ mov(Operand(esp, 1 * kPointerSize), ecx);
820 __ lea(edx, Operand(edx, ecx, times_2, 817 __ lea(edx, Operand(edx, ecx, times_2,
821 StandardFrameConstants::kCallerSPOffset)); 818 StandardFrameConstants::kCallerSPOffset));
822 __ mov(Operand(esp, 2 * kPointerSize), edx); 819 __ mov(Operand(esp, 2 * kPointerSize), edx);
823 820
824 __ bind(&runtime); 821 __ bind(&runtime);
825 __ TailCallRuntime(Runtime::kNewSloppyArguments, 3, 1); 822 __ TailCallRuntime(Runtime::kNewSloppyArguments, 3, 1);
826 } 823 }
827 824
828 825
829 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { 826 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) {
830 // esp[0] : return address 827 // esp[0] : return address
831 // esp[4] : number of parameters (tagged) 828 // esp[4] : number of parameters (tagged)
832 // esp[8] : receiver displacement 829 // esp[8] : receiver displacement
833 // esp[12] : function 830 // esp[12] : function
834 831
835 // ebx = parameter count (tagged) 832 // ebx = parameter count (tagged)
836 __ mov(ebx, Operand(esp, 1 * kPointerSize)); 833 __ mov(ebx, Operand(esp, 1 * kPointerSize));
837 834
838 CHECK(!has_new_target());
839
840 // Check if the calling frame is an arguments adaptor frame. 835 // Check if the calling frame is an arguments adaptor frame.
841 // TODO(rossberg): Factor out some of the bits that are shared with the other 836 // TODO(rossberg): Factor out some of the bits that are shared with the other
842 // Generate* functions. 837 // Generate* functions.
843 Label runtime; 838 Label runtime;
844 Label adaptor_frame, try_allocate; 839 Label adaptor_frame, try_allocate;
845 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); 840 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
846 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset)); 841 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset));
847 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 842 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
848 __ j(equal, &adaptor_frame, Label::kNear); 843 __ j(equal, &adaptor_frame, Label::kNear);
849 844
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 1064 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
1070 __ j(equal, &adaptor_frame, Label::kNear); 1065 __ j(equal, &adaptor_frame, Label::kNear);
1071 1066
1072 // Get the length from the frame. 1067 // Get the length from the frame.
1073 __ mov(ecx, Operand(esp, 1 * kPointerSize)); 1068 __ mov(ecx, Operand(esp, 1 * kPointerSize));
1074 __ jmp(&try_allocate, Label::kNear); 1069 __ jmp(&try_allocate, Label::kNear);
1075 1070
1076 // Patch the arguments.length and the parameters pointer. 1071 // Patch the arguments.length and the parameters pointer.
1077 __ bind(&adaptor_frame); 1072 __ bind(&adaptor_frame);
1078 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); 1073 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset));
1079 1074 __ mov(Operand(esp, 1 * kPointerSize), ecx);
1080 if (has_new_target()) {
1081 // Subtract 1 from smi-tagged arguments count.
1082 __ sub(ecx, Immediate(2));
1083 }
1084
1085 __ lea(edx, Operand(edx, ecx, times_2, 1075 __ lea(edx, Operand(edx, ecx, times_2,
1086 StandardFrameConstants::kCallerSPOffset)); 1076 StandardFrameConstants::kCallerSPOffset));
1087 __ mov(Operand(esp, 1 * kPointerSize), ecx);
1088 __ mov(Operand(esp, 2 * kPointerSize), edx); 1077 __ mov(Operand(esp, 2 * kPointerSize), edx);
1089 1078
1090 // Try the new space allocation. Start out with computing the size of 1079 // Try the new space allocation. Start out with computing the size of
1091 // the arguments object and the elements array. 1080 // the arguments object and the elements array.
1092 Label add_arguments_object; 1081 Label add_arguments_object;
1093 __ bind(&try_allocate); 1082 __ bind(&try_allocate);
1094 __ test(ecx, ecx); 1083 __ test(ecx, ecx);
1095 __ j(zero, &add_arguments_object, Label::kNear); 1084 __ j(zero, &add_arguments_object, Label::kNear);
1096 __ lea(ecx, Operand(ecx, times_2, FixedArray::kHeaderSize)); 1085 __ lea(ecx, Operand(ecx, times_2, FixedArray::kHeaderSize));
1097 __ bind(&add_arguments_object); 1086 __ bind(&add_arguments_object);
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
2153 isolate()->factory()->allocation_site_map(); 2142 isolate()->factory()->allocation_site_map();
2154 __ cmp(FieldOperand(ebx, 0), Immediate(allocation_site_map)); 2143 __ cmp(FieldOperand(ebx, 0), Immediate(allocation_site_map));
2155 __ j(equal, &feedback_register_initialized); 2144 __ j(equal, &feedback_register_initialized);
2156 __ mov(ebx, isolate()->factory()->undefined_value()); 2145 __ mov(ebx, isolate()->factory()->undefined_value());
2157 __ bind(&feedback_register_initialized); 2146 __ bind(&feedback_register_initialized);
2158 } 2147 }
2159 2148
2160 __ AssertUndefinedOrAllocationSite(ebx); 2149 __ AssertUndefinedOrAllocationSite(ebx);
2161 } 2150 }
2162 2151
2163 if (IsSuperConstructorCall()) { 2152 // Pass original constructor to construct stub.
2164 __ mov(edx, Operand(esp, eax, times_pointer_size, 2 * kPointerSize)); 2153 __ mov(edx, edi);
2165 } else {
2166 // Pass original constructor to construct stub.
2167 __ mov(edx, edi);
2168 }
2169 2154
2170 // Jump to the function-specific construct stub. 2155 // Jump to the function-specific construct stub.
2171 Register jmp_reg = ecx; 2156 Register jmp_reg = ecx;
2172 __ mov(jmp_reg, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); 2157 __ mov(jmp_reg, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
2173 __ mov(jmp_reg, FieldOperand(jmp_reg, 2158 __ mov(jmp_reg, FieldOperand(jmp_reg,
2174 SharedFunctionInfo::kConstructStubOffset)); 2159 SharedFunctionInfo::kConstructStubOffset));
2175 __ lea(jmp_reg, FieldOperand(jmp_reg, Code::kHeaderSize)); 2160 __ lea(jmp_reg, FieldOperand(jmp_reg, Code::kHeaderSize));
2176 __ jmp(jmp_reg); 2161 __ jmp(jmp_reg);
2177 2162
2178 // edi: called object 2163 // edi: called object
(...skipping 2934 matching lines...) Expand 10 before | Expand all | Expand 10 after
5113 ApiParameterOperand(2), kStackSpace, nullptr, 5098 ApiParameterOperand(2), kStackSpace, nullptr,
5114 Operand(ebp, 7 * kPointerSize), NULL); 5099 Operand(ebp, 7 * kPointerSize), NULL);
5115 } 5100 }
5116 5101
5117 5102
5118 #undef __ 5103 #undef __
5119 5104
5120 } } // namespace v8::internal 5105 } } // namespace v8::internal
5121 5106
5122 #endif // V8_TARGET_ARCH_IA32 5107 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ia32/deoptimizer-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698