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

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

Issue 2634393002: [MIPS] Fix Apply builtin always taking the slow path. (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/builtins/mips64/builtins-mips64.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.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 2126 matching lines...) Expand 10 before | Expand all | Expand 10 after
2137 // Load native context into t0. 2137 // Load native context into t0.
2138 __ lw(t0, NativeContextMemOperand()); 2138 __ lw(t0, NativeContextMemOperand());
2139 2139
2140 // Check if argumentsList is an (unmodified) arguments object. 2140 // Check if argumentsList is an (unmodified) arguments object.
2141 __ lw(at, ContextMemOperand(t0, Context::SLOPPY_ARGUMENTS_MAP_INDEX)); 2141 __ lw(at, ContextMemOperand(t0, Context::SLOPPY_ARGUMENTS_MAP_INDEX));
2142 __ Branch(&create_arguments, eq, a2, Operand(at)); 2142 __ Branch(&create_arguments, eq, a2, Operand(at));
2143 __ lw(at, ContextMemOperand(t0, Context::STRICT_ARGUMENTS_MAP_INDEX)); 2143 __ lw(at, ContextMemOperand(t0, Context::STRICT_ARGUMENTS_MAP_INDEX));
2144 __ Branch(&create_arguments, eq, a2, Operand(at)); 2144 __ Branch(&create_arguments, eq, a2, Operand(at));
2145 2145
2146 // Check if argumentsList is a fast JSArray. 2146 // Check if argumentsList is a fast JSArray.
2147 __ lw(v0, FieldMemOperand(a2, HeapObject::kMapOffset)); 2147 __ lbu(v0, FieldMemOperand(a2, Map::kInstanceTypeOffset));
2148 __ lbu(v0, FieldMemOperand(v0, Map::kInstanceTypeOffset));
2149 __ Branch(&create_array, eq, v0, Operand(JS_ARRAY_TYPE)); 2148 __ Branch(&create_array, eq, v0, Operand(JS_ARRAY_TYPE));
2150 2149
2151 // Ask the runtime to create the list (actually a FixedArray). 2150 // Ask the runtime to create the list (actually a FixedArray).
2152 __ bind(&create_runtime); 2151 __ bind(&create_runtime);
2153 { 2152 {
2154 FrameScope scope(masm, StackFrame::INTERNAL); 2153 FrameScope scope(masm, StackFrame::INTERNAL);
2155 __ Push(a1, a3, a0); 2154 __ Push(a1, a3, a0);
2156 __ CallRuntime(Runtime::kCreateListFromArrayLike); 2155 __ CallRuntime(Runtime::kCreateListFromArrayLike);
2157 __ mov(a0, v0); 2156 __ mov(a0, v0);
2158 __ Pop(a1, a3); 2157 __ Pop(a1, a3);
(...skipping 22 matching lines...) Expand all
2181 __ lw(a2, FieldMemOperand(at, PropertyCell::kValueOffset)); 2180 __ lw(a2, FieldMemOperand(at, PropertyCell::kValueOffset));
2182 __ Branch(&create_runtime, ne, a2, 2181 __ Branch(&create_runtime, ne, a2,
2183 Operand(Smi::FromInt(Isolate::kProtectorValid))); 2182 Operand(Smi::FromInt(Isolate::kProtectorValid)));
2184 __ lw(a2, FieldMemOperand(a0, JSArray::kLengthOffset)); 2183 __ lw(a2, FieldMemOperand(a0, JSArray::kLengthOffset));
2185 __ lw(a0, FieldMemOperand(a0, JSArray::kElementsOffset)); 2184 __ lw(a0, FieldMemOperand(a0, JSArray::kElementsOffset));
2186 __ SmiUntag(a2); 2185 __ SmiUntag(a2);
2187 __ Branch(&done_create); 2186 __ Branch(&done_create);
2188 2187
2189 // Try to create the list from a JSArray object. 2188 // Try to create the list from a JSArray object.
2190 __ bind(&create_array); 2189 __ bind(&create_array);
2191 __ lw(a2, FieldMemOperand(a2, Map::kBitField2Offset)); 2190 __ lbu(t1, FieldMemOperand(a2, Map::kBitField2Offset));
2192 __ DecodeField<Map::ElementsKindBits>(a2); 2191 __ DecodeField<Map::ElementsKindBits>(t1);
2193 STATIC_ASSERT(FAST_SMI_ELEMENTS == 0); 2192 STATIC_ASSERT(FAST_SMI_ELEMENTS == 0);
2194 STATIC_ASSERT(FAST_HOLEY_SMI_ELEMENTS == 1); 2193 STATIC_ASSERT(FAST_HOLEY_SMI_ELEMENTS == 1);
2195 STATIC_ASSERT(FAST_ELEMENTS == 2); 2194 STATIC_ASSERT(FAST_ELEMENTS == 2);
2196 STATIC_ASSERT(FAST_HOLEY_ELEMENTS == 3); 2195 STATIC_ASSERT(FAST_HOLEY_ELEMENTS == 3);
2197 __ Branch(&create_holey_array, eq, a2, Operand(FAST_HOLEY_SMI_ELEMENTS)); 2196 __ Branch(&create_holey_array, eq, t1, Operand(FAST_HOLEY_SMI_ELEMENTS));
2198 __ Branch(&create_holey_array, eq, a2, Operand(FAST_HOLEY_ELEMENTS)); 2197 __ Branch(&create_holey_array, eq, t1, Operand(FAST_HOLEY_ELEMENTS));
2199 __ Branch(&create_runtime, hi, a2, Operand(FAST_ELEMENTS)); 2198 __ Branch(&create_runtime, hi, t1, Operand(FAST_ELEMENTS));
2200 __ lw(a2, FieldMemOperand(a0, JSArray::kLengthOffset)); 2199 __ lw(a2, FieldMemOperand(a0, JSArray::kLengthOffset));
2201 __ lw(a0, FieldMemOperand(a0, JSArray::kElementsOffset)); 2200 __ lw(a0, FieldMemOperand(a0, JSArray::kElementsOffset));
2202 __ SmiUntag(a2); 2201 __ SmiUntag(a2);
2203 2202
2204 __ bind(&done_create); 2203 __ bind(&done_create);
2205 } 2204 }
2206 2205
2207 // Check for stack overflow. 2206 // Check for stack overflow.
2208 { 2207 {
2209 // Check the stack for overflow. We are not trying to catch interruptions 2208 // Check the stack for overflow. We are not trying to catch interruptions
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
2962 __ break_(0xCC); 2961 __ break_(0xCC);
2963 } 2962 }
2964 } 2963 }
2965 2964
2966 #undef __ 2965 #undef __
2967 2966
2968 } // namespace internal 2967 } // namespace internal
2969 } // namespace v8 2968 } // namespace v8
2970 2969
2971 #endif // V8_TARGET_ARCH_MIPS 2970 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/builtins/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698