Chromium Code Reviews| 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 5432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5443 V8_INLINE(static internal::Object* IntToSmi(int value)) { | 5443 V8_INLINE(static internal::Object* IntToSmi(int value)) { |
| 5444 return internal::IntToSmi<kSmiShiftSize>(value); | 5444 return internal::IntToSmi<kSmiShiftSize>(value); |
| 5445 } | 5445 } |
| 5446 V8_INLINE(static bool IsValidSmi(intptr_t value)) { | 5446 V8_INLINE(static bool IsValidSmi(intptr_t value)) { |
| 5447 // To be representable as a long smi, the value must be a 32-bit integer. | 5447 // To be representable as a long smi, the value must be a 32-bit integer. |
| 5448 return (value == static_cast<int32_t>(value)); | 5448 return (value == static_cast<int32_t>(value)); |
| 5449 } | 5449 } |
| 5450 }; | 5450 }; |
| 5451 | 5451 |
| 5452 typedef SmiTagging<kApiPointerSize> PlatformSmiTagging; | 5452 typedef SmiTagging<kApiPointerSize> PlatformSmiTagging; |
| 5453 V8_INLINE(static bool SmiValuesAre31Bits()) { return kApiPointerSize == 4; } | |
| 5454 V8_INLINE(static bool SmiValuesAre32Bits()) { return kApiPointerSize == 8; } | |
|
danno
2013/08/13 09:41:36
Please put this after "const int kSmiValueSize..."
haitao.feng
2013/08/13 10:37:53
Done.
| |
| 5455 | |
| 5453 const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize; | 5456 const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize; |
| 5454 const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize; | 5457 const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize; |
| 5455 | 5458 |
| 5456 /** | 5459 /** |
| 5457 * This class exports constants and functionality from within v8 that | 5460 * This class exports constants and functionality from within v8 that |
| 5458 * is necessary to implement inline functions in the v8 api. Don't | 5461 * is necessary to implement inline functions in the v8 api. Don't |
| 5459 * depend on functions and constants defined here. | 5462 * depend on functions and constants defined here. |
| 5460 */ | 5463 */ |
| 5461 class Internals { | 5464 class Internals { |
| 5462 public: | 5465 public: |
| (...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6586 */ | 6589 */ |
| 6587 | 6590 |
| 6588 | 6591 |
| 6589 } // namespace v8 | 6592 } // namespace v8 |
| 6590 | 6593 |
| 6591 | 6594 |
| 6592 #undef TYPE_CHECK | 6595 #undef TYPE_CHECK |
| 6593 | 6596 |
| 6594 | 6597 |
| 6595 #endif // V8_H_ | 6598 #endif // V8_H_ |
| OLD | NEW |