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: include/v8.h

Issue 22350005: Introduce SmiValuesAre31Bits and SmiValuesAre32Bits global predicate functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen-instructions.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 // 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
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
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_
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698