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 5399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5410 } | 5410 } |
5411 V8_INLINE(static internal::Object* IntToSmi(int value)) { | 5411 V8_INLINE(static internal::Object* IntToSmi(int value)) { |
5412 return internal::IntToSmi<kSmiShiftSize>(value); | 5412 return internal::IntToSmi<kSmiShiftSize>(value); |
5413 } | 5413 } |
5414 V8_INLINE(static bool IsValidSmi(intptr_t value)) { | 5414 V8_INLINE(static bool IsValidSmi(intptr_t value)) { |
5415 // To be representable as a long smi, the value must be a 32-bit integer. | 5415 // To be representable as a long smi, the value must be a 32-bit integer. |
5416 return (value == static_cast<int32_t>(value)); | 5416 return (value == static_cast<int32_t>(value)); |
5417 } | 5417 } |
5418 }; | 5418 }; |
5419 | 5419 |
| 5420 #if V8_USE_31_BIT_SMI_VALUE |
| 5421 typedef SmiTagging<4> PlatformSmiTagging; |
| 5422 V8_INLINE(static bool SmiValuesAre31Bits()) { return true; } |
| 5423 V8_INLINE(static bool SmiValuesAre32Bits()) { return false; } |
| 5424 #else |
5420 typedef SmiTagging<kApiPointerSize> PlatformSmiTagging; | 5425 typedef SmiTagging<kApiPointerSize> PlatformSmiTagging; |
| 5426 V8_INLINE(static bool SmiValuesAre31Bits()) { return (kApiPointerSize == 4); } |
| 5427 V8_INLINE(static bool SmiValuesAre32Bits()) { return (kApiPointerSize == 8); } |
| 5428 #endif |
5421 const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize; | 5429 const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize; |
5422 const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize; | 5430 const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize; |
5423 | 5431 |
5424 /** | 5432 /** |
5425 * This class exports constants and functionality from within v8 that | 5433 * This class exports constants and functionality from within v8 that |
5426 * is necessary to implement inline functions in the v8 api. Don't | 5434 * is necessary to implement inline functions in the v8 api. Don't |
5427 * depend on functions and constants defined here. | 5435 * depend on functions and constants defined here. |
5428 */ | 5436 */ |
5429 class Internals { | 5437 class Internals { |
5430 public: | 5438 public: |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6537 | 6545 |
6538 | 6546 |
6539 } // namespace v8 | 6547 } // namespace v8 |
6540 | 6548 |
6541 | 6549 |
6542 #undef V8EXPORT | 6550 #undef V8EXPORT |
6543 #undef TYPE_CHECK | 6551 #undef TYPE_CHECK |
6544 | 6552 |
6545 | 6553 |
6546 #endif // V8_H_ | 6554 #endif // V8_H_ |
OLD | NEW |