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

Side by Side Diff: src/mips/macro-assembler-mips.cc

Issue 2396353002: Revert "Add Smi::Zero and replace all Smi::FromInt(0) calls" (Closed)
Patch Set: 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/mips/code-stubs-mips.cc ('k') | src/mips64/code-stubs-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 #include <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #if V8_TARGET_ARCH_MIPS 7 #if V8_TARGET_ARCH_MIPS
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/division-by-constant.h" 10 #include "src/base/division-by-constant.h"
(...skipping 6455 matching lines...) Expand 10 before | Expand all | Expand 10 after
6466 Label index_tag_ok, index_tag_bad; 6466 Label index_tag_ok, index_tag_bad;
6467 TrySmiTag(index, scratch, &index_tag_bad); 6467 TrySmiTag(index, scratch, &index_tag_bad);
6468 Branch(&index_tag_ok); 6468 Branch(&index_tag_ok);
6469 bind(&index_tag_bad); 6469 bind(&index_tag_bad);
6470 Abort(kIndexIsTooLarge); 6470 Abort(kIndexIsTooLarge);
6471 bind(&index_tag_ok); 6471 bind(&index_tag_ok);
6472 6472
6473 lw(at, FieldMemOperand(string, String::kLengthOffset)); 6473 lw(at, FieldMemOperand(string, String::kLengthOffset));
6474 Check(lt, kIndexIsTooLarge, index, Operand(at)); 6474 Check(lt, kIndexIsTooLarge, index, Operand(at));
6475 6475
6476 DCHECK(Smi::kZero == 0); 6476 DCHECK(Smi::FromInt(0) == 0);
6477 Check(ge, kIndexIsNegative, index, Operand(zero_reg)); 6477 Check(ge, kIndexIsNegative, index, Operand(zero_reg));
6478 6478
6479 SmiUntag(index, index); 6479 SmiUntag(index, index);
6480 } 6480 }
6481 6481
6482 6482
6483 void MacroAssembler::PrepareCallCFunction(int num_reg_arguments, 6483 void MacroAssembler::PrepareCallCFunction(int num_reg_arguments,
6484 int num_double_arguments, 6484 int num_double_arguments,
6485 Register scratch) { 6485 Register scratch) {
6486 int frame_alignment = ActivationFrameAlignment(); 6486 int frame_alignment = ActivationFrameAlignment();
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
6726 call_runtime, eq, a3, Operand(Smi::FromInt(kInvalidEnumCacheSentinel))); 6726 call_runtime, eq, a3, Operand(Smi::FromInt(kInvalidEnumCacheSentinel)));
6727 6727
6728 LoadRoot(null_value, Heap::kNullValueRootIndex); 6728 LoadRoot(null_value, Heap::kNullValueRootIndex);
6729 jmp(&start); 6729 jmp(&start);
6730 6730
6731 bind(&next); 6731 bind(&next);
6732 lw(a1, FieldMemOperand(a2, HeapObject::kMapOffset)); 6732 lw(a1, FieldMemOperand(a2, HeapObject::kMapOffset));
6733 6733
6734 // For all objects but the receiver, check that the cache is empty. 6734 // For all objects but the receiver, check that the cache is empty.
6735 EnumLength(a3, a1); 6735 EnumLength(a3, a1);
6736 Branch(call_runtime, ne, a3, Operand(Smi::kZero)); 6736 Branch(call_runtime, ne, a3, Operand(Smi::FromInt(0)));
6737 6737
6738 bind(&start); 6738 bind(&start);
6739 6739
6740 // Check that there are no elements. Register a2 contains the current JS 6740 // Check that there are no elements. Register a2 contains the current JS
6741 // object we've reached through the prototype chain. 6741 // object we've reached through the prototype chain.
6742 Label no_elements; 6742 Label no_elements;
6743 lw(a2, FieldMemOperand(a2, JSObject::kElementsOffset)); 6743 lw(a2, FieldMemOperand(a2, JSObject::kElementsOffset));
6744 Branch(&no_elements, eq, a2, Operand(empty_fixed_array_value)); 6744 Branch(&no_elements, eq, a2, Operand(empty_fixed_array_value));
6745 6745
6746 // Second chance, the object may be using the empty slow element dictionary. 6746 // Second chance, the object may be using the empty slow element dictionary.
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
6985 if (mag.shift > 0) sra(result, result, mag.shift); 6985 if (mag.shift > 0) sra(result, result, mag.shift);
6986 srl(at, dividend, 31); 6986 srl(at, dividend, 31);
6987 Addu(result, result, Operand(at)); 6987 Addu(result, result, Operand(at));
6988 } 6988 }
6989 6989
6990 6990
6991 } // namespace internal 6991 } // namespace internal
6992 } // namespace v8 6992 } // namespace v8
6993 6993
6994 #endif // V8_TARGET_ARCH_MIPS 6994 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698