| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 Isolate* isolate, | 107 Isolate* isolate, |
| 108 CodeStubInterfaceDescriptor* descriptor) { | 108 CodeStubInterfaceDescriptor* descriptor) { |
| 109 static Register registers[] = { a1, a0 }; | 109 static Register registers[] = { a1, a0 }; |
| 110 descriptor->register_param_count_ = 2; | 110 descriptor->register_param_count_ = 2; |
| 111 descriptor->register_params_ = registers; | 111 descriptor->register_params_ = registers; |
| 112 descriptor->deoptimization_handler_ = | 112 descriptor->deoptimization_handler_ = |
| 113 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); | 113 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); |
| 114 } | 114 } |
| 115 | 115 |
| 116 | 116 |
| 117 void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( |
| 118 Isolate* isolate, |
| 119 CodeStubInterfaceDescriptor* descriptor) { |
| 120 static Register registers[] = {a1, a0 }; |
| 121 descriptor->register_param_count_ = 2; |
| 122 descriptor->register_params_ = registers; |
| 123 descriptor->deoptimization_handler_ = |
| 124 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); |
| 125 } |
| 126 |
| 127 |
| 117 void LoadFieldStub::InitializeInterfaceDescriptor( | 128 void LoadFieldStub::InitializeInterfaceDescriptor( |
| 118 Isolate* isolate, | 129 Isolate* isolate, |
| 119 CodeStubInterfaceDescriptor* descriptor) { | 130 CodeStubInterfaceDescriptor* descriptor) { |
| 120 static Register registers[] = { a0 }; | 131 static Register registers[] = { a0 }; |
| 121 descriptor->register_param_count_ = 1; | 132 descriptor->register_param_count_ = 1; |
| 122 descriptor->register_params_ = registers; | 133 descriptor->register_params_ = registers; |
| 123 descriptor->deoptimization_handler_ = NULL; | 134 descriptor->deoptimization_handler_ = NULL; |
| 124 } | 135 } |
| 125 | 136 |
| 126 | 137 |
| 127 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( | 138 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( |
| 128 Isolate* isolate, | 139 Isolate* isolate, |
| 129 CodeStubInterfaceDescriptor* descriptor) { | 140 CodeStubInterfaceDescriptor* descriptor) { |
| 130 static Register registers[] = { a1 }; | 141 static Register registers[] = { a1 }; |
| 131 descriptor->register_param_count_ = 1; | 142 descriptor->register_param_count_ = 1; |
| 132 descriptor->register_params_ = registers; | 143 descriptor->register_params_ = registers; |
| 133 descriptor->deoptimization_handler_ = NULL; | 144 descriptor->deoptimization_handler_ = NULL; |
| 134 } | 145 } |
| 135 | 146 |
| 136 | 147 |
| 148 void KeyedArrayCallStub::InitializeInterfaceDescriptor( |
| 149 Isolate* isolate, |
| 150 CodeStubInterfaceDescriptor* descriptor) { |
| 151 static Register registers[] = { a2 }; |
| 152 descriptor->register_param_count_ = 1; |
| 153 descriptor->register_params_ = registers; |
| 154 descriptor->continuation_type_ = TAIL_CALL_CONTINUATION; |
| 155 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
| 156 descriptor->deoptimization_handler_ = |
| 157 FUNCTION_ADDR(KeyedCallIC_MissFromStubFailure); |
| 158 } |
| 159 |
| 160 |
| 137 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( | 161 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( |
| 138 Isolate* isolate, | 162 Isolate* isolate, |
| 139 CodeStubInterfaceDescriptor* descriptor) { | 163 CodeStubInterfaceDescriptor* descriptor) { |
| 140 static Register registers[] = { a2, a1, a0 }; | 164 static Register registers[] = { a2, a1, a0 }; |
| 141 descriptor->register_param_count_ = 3; | 165 descriptor->register_param_count_ = 3; |
| 142 descriptor->register_params_ = registers; | 166 descriptor->register_params_ = registers; |
| 143 descriptor->deoptimization_handler_ = | 167 descriptor->deoptimization_handler_ = |
| 144 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); | 168 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); |
| 145 } | 169 } |
| 146 | 170 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 171 | 195 |
| 172 | 196 |
| 173 static void InitializeArrayConstructorDescriptor( | 197 static void InitializeArrayConstructorDescriptor( |
| 174 Isolate* isolate, | 198 Isolate* isolate, |
| 175 CodeStubInterfaceDescriptor* descriptor, | 199 CodeStubInterfaceDescriptor* descriptor, |
| 176 int constant_stack_parameter_count) { | 200 int constant_stack_parameter_count) { |
| 177 // register state | 201 // register state |
| 178 // a0 -- number of arguments | 202 // a0 -- number of arguments |
| 179 // a1 -- function | 203 // a1 -- function |
| 180 // a2 -- type info cell with elements kind | 204 // a2 -- type info cell with elements kind |
| 181 static Register registers[] = { a1, a2 }; | 205 static Register registers_variable_args[] = { a1, a2, a0 }; |
| 182 descriptor->register_param_count_ = 2; | 206 static Register registers_no_args[] = { a1, a2 }; |
| 183 if (constant_stack_parameter_count != 0) { | 207 |
| 208 if (constant_stack_parameter_count == 0) { |
| 209 descriptor->register_param_count_ = 2; |
| 210 descriptor->register_params_ = registers_no_args; |
| 211 } else { |
| 184 // stack param count needs (constructor pointer, and single argument) | 212 // stack param count needs (constructor pointer, and single argument) |
| 213 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
| 185 descriptor->stack_parameter_count_ = a0; | 214 descriptor->stack_parameter_count_ = a0; |
| 215 descriptor->register_param_count_ = 3; |
| 216 descriptor->register_params_ = registers_variable_args; |
| 186 } | 217 } |
| 218 |
| 187 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 219 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
| 188 descriptor->register_params_ = registers; | |
| 189 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 220 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
| 190 descriptor->deoptimization_handler_ = | 221 descriptor->deoptimization_handler_ = |
| 191 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; | 222 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; |
| 192 } | 223 } |
| 193 | 224 |
| 194 | 225 |
| 195 static void InitializeInternalArrayConstructorDescriptor( | 226 static void InitializeInternalArrayConstructorDescriptor( |
| 196 Isolate* isolate, | 227 Isolate* isolate, |
| 197 CodeStubInterfaceDescriptor* descriptor, | 228 CodeStubInterfaceDescriptor* descriptor, |
| 198 int constant_stack_parameter_count) { | 229 int constant_stack_parameter_count) { |
| 199 // register state | 230 // register state |
| 200 // a0 -- number of arguments | 231 // a0 -- number of arguments |
| 201 // a1 -- constructor function | 232 // a1 -- constructor function |
| 202 static Register registers[] = { a1 }; | 233 static Register registers_variable_args[] = { a1, a0 }; |
| 203 descriptor->register_param_count_ = 1; | 234 static Register registers_no_args[] = { a1 }; |
| 204 | 235 |
| 205 if (constant_stack_parameter_count != 0) { | 236 if (constant_stack_parameter_count == 0) { |
| 206 // Stack param count needs (constructor pointer, and single argument). | 237 descriptor->register_param_count_ = 1; |
| 238 descriptor->register_params_ = registers_no_args; |
| 239 } else { |
| 240 // stack param count needs (constructor pointer, and single argument) |
| 241 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
| 207 descriptor->stack_parameter_count_ = a0; | 242 descriptor->stack_parameter_count_ = a0; |
| 243 descriptor->register_param_count_ = 2; |
| 244 descriptor->register_params_ = registers_variable_args; |
| 208 } | 245 } |
| 246 |
| 209 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 247 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
| 210 descriptor->register_params_ = registers; | |
| 211 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 248 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
| 212 descriptor->deoptimization_handler_ = | 249 descriptor->deoptimization_handler_ = |
| 213 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; | 250 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; |
| 214 } | 251 } |
| 215 | 252 |
| 216 | 253 |
| 217 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 254 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
| 218 Isolate* isolate, | 255 Isolate* isolate, |
| 219 CodeStubInterfaceDescriptor* descriptor) { | 256 CodeStubInterfaceDescriptor* descriptor) { |
| 220 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); | 257 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); |
| (...skipping 2704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2925 // Check that the first argument is a JSRegExp object. | 2962 // Check that the first argument is a JSRegExp object. |
| 2926 __ lw(a0, MemOperand(sp, kJSRegExpOffset)); | 2963 __ lw(a0, MemOperand(sp, kJSRegExpOffset)); |
| 2927 STATIC_ASSERT(kSmiTag == 0); | 2964 STATIC_ASSERT(kSmiTag == 0); |
| 2928 __ JumpIfSmi(a0, &runtime); | 2965 __ JumpIfSmi(a0, &runtime); |
| 2929 __ GetObjectType(a0, a1, a1); | 2966 __ GetObjectType(a0, a1, a1); |
| 2930 __ Branch(&runtime, ne, a1, Operand(JS_REGEXP_TYPE)); | 2967 __ Branch(&runtime, ne, a1, Operand(JS_REGEXP_TYPE)); |
| 2931 | 2968 |
| 2932 // Check that the RegExp has been compiled (data contains a fixed array). | 2969 // Check that the RegExp has been compiled (data contains a fixed array). |
| 2933 __ lw(regexp_data, FieldMemOperand(a0, JSRegExp::kDataOffset)); | 2970 __ lw(regexp_data, FieldMemOperand(a0, JSRegExp::kDataOffset)); |
| 2934 if (FLAG_debug_code) { | 2971 if (FLAG_debug_code) { |
| 2935 __ And(t0, regexp_data, Operand(kSmiTagMask)); | 2972 __ SmiTst(regexp_data, t0); |
| 2936 __ Check(nz, | 2973 __ Check(nz, |
| 2937 kUnexpectedTypeForRegExpDataFixedArrayExpected, | 2974 kUnexpectedTypeForRegExpDataFixedArrayExpected, |
| 2938 t0, | 2975 t0, |
| 2939 Operand(zero_reg)); | 2976 Operand(zero_reg)); |
| 2940 __ GetObjectType(regexp_data, a0, a0); | 2977 __ GetObjectType(regexp_data, a0, a0); |
| 2941 __ Check(eq, | 2978 __ Check(eq, |
| 2942 kUnexpectedTypeForRegExpDataFixedArrayExpected, | 2979 kUnexpectedTypeForRegExpDataFixedArrayExpected, |
| 2943 a0, | 2980 a0, |
| 2944 Operand(FIXED_ARRAY_TYPE)); | 2981 Operand(FIXED_ARRAY_TYPE)); |
| 2945 } | 2982 } |
| (...skipping 2888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5834 if (function_mode_ == JS_FUNCTION_STUB_MODE) { | 5871 if (function_mode_ == JS_FUNCTION_STUB_MODE) { |
| 5835 __ Addu(a1, a1, Operand(1)); | 5872 __ Addu(a1, a1, Operand(1)); |
| 5836 } | 5873 } |
| 5837 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | 5874 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); |
| 5838 __ sll(a1, a1, kPointerSizeLog2); | 5875 __ sll(a1, a1, kPointerSizeLog2); |
| 5839 __ Ret(USE_DELAY_SLOT); | 5876 __ Ret(USE_DELAY_SLOT); |
| 5840 __ Addu(sp, sp, a1); | 5877 __ Addu(sp, sp, a1); |
| 5841 } | 5878 } |
| 5842 | 5879 |
| 5843 | 5880 |
| 5881 void StubFailureTailCallTrampolineStub::Generate(MacroAssembler* masm) { |
| 5882 CEntryStub ces(1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs); |
| 5883 __ Call(ces.GetCode(masm->isolate()), RelocInfo::CODE_TARGET); |
| 5884 __ mov(a1, v0); |
| 5885 int parameter_count_offset = |
| 5886 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; |
| 5887 __ lw(a0, MemOperand(fp, parameter_count_offset)); |
| 5888 // The parameter count above includes the receiver for the arguments passed to |
| 5889 // the deoptimization handler. Subtract the receiver for the parameter count |
| 5890 // for the call. |
| 5891 __ Subu(a0, a0, 1); |
| 5892 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); |
| 5893 ParameterCount argument_count(a0); |
| 5894 __ InvokeFunction( |
| 5895 a1, argument_count, JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); |
| 5896 } |
| 5897 |
| 5898 |
| 5844 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { | 5899 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { |
| 5845 if (masm->isolate()->function_entry_hook() != NULL) { | 5900 if (masm->isolate()->function_entry_hook() != NULL) { |
| 5846 AllowStubCallsScope allow_stub_calls(masm, true); | 5901 AllowStubCallsScope allow_stub_calls(masm, true); |
| 5847 ProfileEntryHookStub stub; | 5902 ProfileEntryHookStub stub; |
| 5848 __ push(ra); | 5903 __ push(ra); |
| 5849 __ CallStub(&stub); | 5904 __ CallStub(&stub); |
| 5850 __ pop(ra); | 5905 __ pop(ra); |
| 5851 } | 5906 } |
| 5852 } | 5907 } |
| 5853 | 5908 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5985 __ Addu(a3, a3, Operand(1)); | 6040 __ Addu(a3, a3, Operand(1)); |
| 5986 __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset)); | 6041 __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset)); |
| 5987 | 6042 |
| 5988 if (FLAG_debug_code) { | 6043 if (FLAG_debug_code) { |
| 5989 __ lw(t1, FieldMemOperand(t1, 0)); | 6044 __ lw(t1, FieldMemOperand(t1, 0)); |
| 5990 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); | 6045 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); |
| 5991 __ Assert(eq, kExpectedAllocationSiteInCell, t1, Operand(at)); | 6046 __ Assert(eq, kExpectedAllocationSiteInCell, t1, Operand(at)); |
| 5992 __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset)); | 6047 __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset)); |
| 5993 } | 6048 } |
| 5994 | 6049 |
| 5995 // Save the resulting elements kind in type info | 6050 // Save the resulting elements kind in type info. We can't just store a3 |
| 5996 __ SmiTag(a3); | 6051 // in the AllocationSite::transition_info field because elements kind is |
| 5997 __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset)); | 6052 // restricted to a portion of the field...upper bits need to be left alone. |
| 5998 __ sw(a3, FieldMemOperand(t1, AllocationSite::kTransitionInfoOffset)); | 6053 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); |
| 5999 __ SmiUntag(a3); | 6054 __ lw(t0, FieldMemOperand(t1, AllocationSite::kTransitionInfoOffset)); |
| 6055 __ Addu(t0, t0, Operand(Smi::FromInt(kFastElementsKindPackedToHoley))); |
| 6056 __ sw(t0, FieldMemOperand(t1, AllocationSite::kTransitionInfoOffset)); |
| 6057 |
| 6000 | 6058 |
| 6001 __ bind(&normal_sequence); | 6059 __ bind(&normal_sequence); |
| 6002 int last_index = GetSequenceIndexFromFastElementsKind( | 6060 int last_index = GetSequenceIndexFromFastElementsKind( |
| 6003 TERMINAL_FAST_ELEMENTS_KIND); | 6061 TERMINAL_FAST_ELEMENTS_KIND); |
| 6004 for (int i = 0; i <= last_index; ++i) { | 6062 for (int i = 0; i <= last_index; ++i) { |
| 6005 Label next; | 6063 Label next; |
| 6006 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); | 6064 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); |
| 6007 __ Branch(&next, ne, a3, Operand(kind)); | 6065 __ Branch(&next, ne, a3, Operand(kind)); |
| 6008 ArraySingleArgumentConstructorStub stub(kind); | 6066 ArraySingleArgumentConstructorStub stub(kind); |
| 6009 __ TailCallStub(&stub); | 6067 __ TailCallStub(&stub); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6099 // -- sp[0] : return address | 6157 // -- sp[0] : return address |
| 6100 // -- sp[4] : last argument | 6158 // -- sp[4] : last argument |
| 6101 // ----------------------------------- | 6159 // ----------------------------------- |
| 6102 if (FLAG_debug_code) { | 6160 if (FLAG_debug_code) { |
| 6103 // The array construct code is only set for the global and natives | 6161 // The array construct code is only set for the global and natives |
| 6104 // builtin Array functions which always have maps. | 6162 // builtin Array functions which always have maps. |
| 6105 | 6163 |
| 6106 // Initial map for the builtin Array function should be a map. | 6164 // Initial map for the builtin Array function should be a map. |
| 6107 __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset)); | 6165 __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset)); |
| 6108 // Will both indicate a NULL and a Smi. | 6166 // Will both indicate a NULL and a Smi. |
| 6109 __ And(at, a3, Operand(kSmiTagMask)); | 6167 __ SmiTst(a3, at); |
| 6110 __ Assert(ne, kUnexpectedInitialMapForArrayFunction, | 6168 __ Assert(ne, kUnexpectedInitialMapForArrayFunction, |
| 6111 at, Operand(zero_reg)); | 6169 at, Operand(zero_reg)); |
| 6112 __ GetObjectType(a3, a3, t0); | 6170 __ GetObjectType(a3, a3, t0); |
| 6113 __ Assert(eq, kUnexpectedInitialMapForArrayFunction, | 6171 __ Assert(eq, kUnexpectedInitialMapForArrayFunction, |
| 6114 t0, Operand(MAP_TYPE)); | 6172 t0, Operand(MAP_TYPE)); |
| 6115 | 6173 |
| 6116 // We should either have undefined in a2 or a valid cell. | 6174 // We should either have undefined in a2 or a valid cell. |
| 6117 Label okay_here; | 6175 Label okay_here; |
| 6118 Handle<Map> cell_map = masm->isolate()->factory()->cell_map(); | 6176 Handle<Map> cell_map = masm->isolate()->factory()->cell_map(); |
| 6119 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 6177 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 6131 __ lw(a3, FieldMemOperand(a2, Cell::kValueOffset)); | 6189 __ lw(a3, FieldMemOperand(a2, Cell::kValueOffset)); |
| 6132 | 6190 |
| 6133 // If the type cell is undefined, or contains anything other than an | 6191 // If the type cell is undefined, or contains anything other than an |
| 6134 // AllocationSite, call an array constructor that doesn't use AllocationSites. | 6192 // AllocationSite, call an array constructor that doesn't use AllocationSites. |
| 6135 __ lw(t0, FieldMemOperand(a3, 0)); | 6193 __ lw(t0, FieldMemOperand(a3, 0)); |
| 6136 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); | 6194 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); |
| 6137 __ Branch(&no_info, ne, t0, Operand(at)); | 6195 __ Branch(&no_info, ne, t0, Operand(at)); |
| 6138 | 6196 |
| 6139 __ lw(a3, FieldMemOperand(a3, AllocationSite::kTransitionInfoOffset)); | 6197 __ lw(a3, FieldMemOperand(a3, AllocationSite::kTransitionInfoOffset)); |
| 6140 __ SmiUntag(a3); | 6198 __ SmiUntag(a3); |
| 6199 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); |
| 6200 __ And(a3, a3, Operand(AllocationSite::ElementsKindBits::kMask)); |
| 6141 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); | 6201 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); |
| 6142 | 6202 |
| 6143 __ bind(&no_info); | 6203 __ bind(&no_info); |
| 6144 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); | 6204 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); |
| 6145 } | 6205 } |
| 6146 | 6206 |
| 6147 | 6207 |
| 6148 void InternalArrayConstructorStub::GenerateCase( | 6208 void InternalArrayConstructorStub::GenerateCase( |
| 6149 MacroAssembler* masm, ElementsKind kind) { | 6209 MacroAssembler* masm, ElementsKind kind) { |
| 6150 Label not_zero_case, not_one_case; | 6210 Label not_zero_case, not_one_case; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6186 // -- sp[4] : last argument | 6246 // -- sp[4] : last argument |
| 6187 // ----------------------------------- | 6247 // ----------------------------------- |
| 6188 | 6248 |
| 6189 if (FLAG_debug_code) { | 6249 if (FLAG_debug_code) { |
| 6190 // The array construct code is only set for the global and natives | 6250 // The array construct code is only set for the global and natives |
| 6191 // builtin Array functions which always have maps. | 6251 // builtin Array functions which always have maps. |
| 6192 | 6252 |
| 6193 // Initial map for the builtin Array function should be a map. | 6253 // Initial map for the builtin Array function should be a map. |
| 6194 __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset)); | 6254 __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset)); |
| 6195 // Will both indicate a NULL and a Smi. | 6255 // Will both indicate a NULL and a Smi. |
| 6196 __ And(at, a3, Operand(kSmiTagMask)); | 6256 __ SmiTst(a3, at); |
| 6197 __ Assert(ne, kUnexpectedInitialMapForArrayFunction, | 6257 __ Assert(ne, kUnexpectedInitialMapForArrayFunction, |
| 6198 at, Operand(zero_reg)); | 6258 at, Operand(zero_reg)); |
| 6199 __ GetObjectType(a3, a3, t0); | 6259 __ GetObjectType(a3, a3, t0); |
| 6200 __ Assert(eq, kUnexpectedInitialMapForArrayFunction, | 6260 __ Assert(eq, kUnexpectedInitialMapForArrayFunction, |
| 6201 t0, Operand(MAP_TYPE)); | 6261 t0, Operand(MAP_TYPE)); |
| 6202 } | 6262 } |
| 6203 | 6263 |
| 6204 // Figure out the right elements kind. | 6264 // Figure out the right elements kind. |
| 6205 __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset)); | 6265 __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset)); |
| 6206 | 6266 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 6226 __ bind(&fast_elements_case); | 6286 __ bind(&fast_elements_case); |
| 6227 GenerateCase(masm, FAST_ELEMENTS); | 6287 GenerateCase(masm, FAST_ELEMENTS); |
| 6228 } | 6288 } |
| 6229 | 6289 |
| 6230 | 6290 |
| 6231 #undef __ | 6291 #undef __ |
| 6232 | 6292 |
| 6233 } } // namespace v8::internal | 6293 } } // namespace v8::internal |
| 6234 | 6294 |
| 6235 #endif // V8_TARGET_ARCH_MIPS | 6295 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |