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

Side by Side Diff: include/v8.h

Issue 21014003: Optionally use 31-bits SMI value for 64-bit system (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use (kSmiValueSize == 31) or (kSmiValueSize == 32) for SMI functions in macro assembler" 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
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 5347 matching lines...) Expand 10 before | Expand all | Expand 10 after
5358 } 5358 }
5359 V8_INLINE(static internal::Object* IntToSmi(int value)) { 5359 V8_INLINE(static internal::Object* IntToSmi(int value)) {
5360 return internal::IntToSmi<kSmiShiftSize>(value); 5360 return internal::IntToSmi<kSmiShiftSize>(value);
5361 } 5361 }
5362 V8_INLINE(static bool IsValidSmi(intptr_t value)) { 5362 V8_INLINE(static bool IsValidSmi(intptr_t value)) {
5363 // To be representable as a long smi, the value must be a 32-bit integer. 5363 // To be representable as a long smi, the value must be a 32-bit integer.
5364 return (value == static_cast<int32_t>(value)); 5364 return (value == static_cast<int32_t>(value));
5365 } 5365 }
5366 }; 5366 };
5367 5367
5368 #if V8_USE_31_BIT_SMI_VALUE
5369 typedef SmiTagging<4> PlatformSmiTagging;
5370 #else
5368 typedef SmiTagging<kApiPointerSize> PlatformSmiTagging; 5371 typedef SmiTagging<kApiPointerSize> PlatformSmiTagging;
5372 #endif
5369 const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize; 5373 const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize;
5370 const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize; 5374 const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize;
5371 5375
5372 /** 5376 /**
5373 * This class exports constants and functionality from within v8 that 5377 * This class exports constants and functionality from within v8 that
5374 * is necessary to implement inline functions in the v8 api. Don't 5378 * is necessary to implement inline functions in the v8 api. Don't
5375 * depend on functions and constants defined here. 5379 * depend on functions and constants defined here.
5376 */ 5380 */
5377 class Internals { 5381 class Internals {
5378 public: 5382 public:
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
6481 6485
6482 6486
6483 } // namespace v8 6487 } // namespace v8
6484 6488
6485 6489
6486 #undef V8EXPORT 6490 #undef V8EXPORT
6487 #undef TYPE_CHECK 6491 #undef TYPE_CHECK
6488 6492
6489 6493
6490 #endif // V8_H_ 6494 #endif // V8_H_
OLDNEW
« no previous file with comments | « build/features.gypi ('k') | src/x64/assembler-x64.h » ('j') | src/x64/code-stubs-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698