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

Side by Side Diff: src/objects-inl.h

Issue 267049: Removed 31-bit smis. (Closed)
Patch Set: Created 11 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 | « include/v8.h ('k') | src/x64/macro-assembler-x64.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 return reinterpret_cast<Failure*>( 828 return reinterpret_cast<Failure*>(
829 (static_cast<intptr_t>(info) << kFailureTagSize) | kFailureTag); 829 (static_cast<intptr_t>(info) << kFailureTagSize) | kFailureTag);
830 } 830 }
831 831
832 832
833 bool Smi::IsValid(intptr_t value) { 833 bool Smi::IsValid(intptr_t value) {
834 #ifdef DEBUG 834 #ifdef DEBUG
835 bool in_range = (value >= kMinValue) && (value <= kMaxValue); 835 bool in_range = (value >= kMinValue) && (value <= kMaxValue);
836 #endif 836 #endif
837 837
838 #ifdef V8_LONG_SMI 838 #ifdef V8_TARGET_ARCH_X64
839 // To be representable as a long smi, the value must be a 32-bit integer. 839 // To be representable as a long smi, the value must be a 32-bit integer.
840 bool result = (value == static_cast<int32_t>(value)); 840 bool result = (value == static_cast<int32_t>(value));
841 #else 841 #else
842 // To be representable as an tagged small integer, the two 842 // To be representable as an tagged small integer, the two
843 // most-significant bits of 'value' must be either 00 or 11 due to 843 // most-significant bits of 'value' must be either 00 or 11 due to
844 // sign-extension. To check this we add 01 to the two 844 // sign-extension. To check this we add 01 to the two
845 // most-significant bits, and check if the most-significant bit is 0 845 // most-significant bits, and check if the most-significant bit is 0
846 // 846 //
847 // CAUTION: The original code below: 847 // CAUTION: The original code below:
848 // bool result = ((value + 0x40000000) & 0x80000000) == 0; 848 // bool result = ((value + 0x40000000) & 0x80000000) == 0;
(...skipping 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after
2887 #undef WRITE_INT_FIELD 2887 #undef WRITE_INT_FIELD
2888 #undef READ_SHORT_FIELD 2888 #undef READ_SHORT_FIELD
2889 #undef WRITE_SHORT_FIELD 2889 #undef WRITE_SHORT_FIELD
2890 #undef READ_BYTE_FIELD 2890 #undef READ_BYTE_FIELD
2891 #undef WRITE_BYTE_FIELD 2891 #undef WRITE_BYTE_FIELD
2892 2892
2893 2893
2894 } } // namespace v8::internal 2894 } } // namespace v8::internal
2895 2895
2896 #endif // V8_OBJECTS_INL_H_ 2896 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698