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/mips64/macro-assembler-mips64.cc

Issue 2381843002: Add Smi::Zero and replace all Smi::FromInt(0) calls (Closed)
Patch Set: Mark Smi::kZero as V8_EXPORT_PRIVATE Created 4 years, 2 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/mips64/code-stubs-mips64.cc ('k') | src/objects.h » ('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 <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/base/division-by-constant.h" 9 #include "src/base/division-by-constant.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 6879 matching lines...) Expand 10 before | Expand all | Expand 10 after
6890 6890
6891 andi(at, at, kStringRepresentationMask | kStringEncodingMask); 6891 andi(at, at, kStringRepresentationMask | kStringEncodingMask);
6892 li(scratch, Operand(encoding_mask)); 6892 li(scratch, Operand(encoding_mask));
6893 Check(eq, kUnexpectedStringType, at, Operand(scratch)); 6893 Check(eq, kUnexpectedStringType, at, Operand(scratch));
6894 6894
6895 // TODO(plind): requires Smi size check code for mips32. 6895 // TODO(plind): requires Smi size check code for mips32.
6896 6896
6897 ld(at, FieldMemOperand(string, String::kLengthOffset)); 6897 ld(at, FieldMemOperand(string, String::kLengthOffset));
6898 Check(lt, kIndexIsTooLarge, index, Operand(at)); 6898 Check(lt, kIndexIsTooLarge, index, Operand(at));
6899 6899
6900 DCHECK(Smi::FromInt(0) == 0); 6900 DCHECK(Smi::kZero == 0);
6901 Check(ge, kIndexIsNegative, index, Operand(zero_reg)); 6901 Check(ge, kIndexIsNegative, index, Operand(zero_reg));
6902 } 6902 }
6903 6903
6904 6904
6905 void MacroAssembler::PrepareCallCFunction(int num_reg_arguments, 6905 void MacroAssembler::PrepareCallCFunction(int num_reg_arguments,
6906 int num_double_arguments, 6906 int num_double_arguments,
6907 Register scratch) { 6907 Register scratch) {
6908 int frame_alignment = ActivationFrameAlignment(); 6908 int frame_alignment = ActivationFrameAlignment();
6909 6909
6910 // n64: Up to eight simple arguments in a0..a3, a4..a7, No argument slots. 6910 // n64: Up to eight simple arguments in a0..a3, a4..a7, No argument slots.
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
7155 call_runtime, eq, a3, Operand(Smi::FromInt(kInvalidEnumCacheSentinel))); 7155 call_runtime, eq, a3, Operand(Smi::FromInt(kInvalidEnumCacheSentinel)));
7156 7156
7157 LoadRoot(null_value, Heap::kNullValueRootIndex); 7157 LoadRoot(null_value, Heap::kNullValueRootIndex);
7158 jmp(&start); 7158 jmp(&start);
7159 7159
7160 bind(&next); 7160 bind(&next);
7161 ld(a1, FieldMemOperand(a2, HeapObject::kMapOffset)); 7161 ld(a1, FieldMemOperand(a2, HeapObject::kMapOffset));
7162 7162
7163 // For all objects but the receiver, check that the cache is empty. 7163 // For all objects but the receiver, check that the cache is empty.
7164 EnumLength(a3, a1); 7164 EnumLength(a3, a1);
7165 Branch(call_runtime, ne, a3, Operand(Smi::FromInt(0))); 7165 Branch(call_runtime, ne, a3, Operand(Smi::kZero));
7166 7166
7167 bind(&start); 7167 bind(&start);
7168 7168
7169 // Check that there are no elements. Register a2 contains the current JS 7169 // Check that there are no elements. Register a2 contains the current JS
7170 // object we've reached through the prototype chain. 7170 // object we've reached through the prototype chain.
7171 Label no_elements; 7171 Label no_elements;
7172 ld(a2, FieldMemOperand(a2, JSObject::kElementsOffset)); 7172 ld(a2, FieldMemOperand(a2, JSObject::kElementsOffset));
7173 Branch(&no_elements, eq, a2, Operand(empty_fixed_array_value)); 7173 Branch(&no_elements, eq, a2, Operand(empty_fixed_array_value));
7174 7174
7175 // Second chance, the object may be using the empty slow element dictionary. 7175 // Second chance, the object may be using the empty slow element dictionary.
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
7413 if (mag.shift > 0) sra(result, result, mag.shift); 7413 if (mag.shift > 0) sra(result, result, mag.shift);
7414 srl(at, dividend, 31); 7414 srl(at, dividend, 31);
7415 Addu(result, result, Operand(at)); 7415 Addu(result, result, Operand(at));
7416 } 7416 }
7417 7417
7418 7418
7419 } // namespace internal 7419 } // namespace internal
7420 } // namespace v8 7420 } // namespace v8
7421 7421
7422 #endif // V8_TARGET_ARCH_MIPS64 7422 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698