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

Side by Side Diff: src/objects.h

Issue 100337: Changed some int casts to intptr_t. (Closed)
Patch Set: Created 11 years, 7 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 | « src/checks.h ('k') | src/objects-inl.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 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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 // Casting. 788 // Casting.
789 static inline Smi* cast(Object* object); 789 static inline Smi* cast(Object* object);
790 790
791 // Dispatched behavior. 791 // Dispatched behavior.
792 void SmiPrint(); 792 void SmiPrint();
793 void SmiPrint(StringStream* accumulator); 793 void SmiPrint(StringStream* accumulator);
794 #ifdef DEBUG 794 #ifdef DEBUG
795 void SmiVerify(); 795 void SmiVerify();
796 #endif 796 #endif
797 797
798 static const int kSmiPrecission = 31;
798 // Min and max limits for Smi values. 799 // Min and max limits for Smi values.
799 static const int kMinValue = -(1 << (kBitsPerPointer - (kSmiTagSize + 1))); 800 static const int kMinValue = -(1 << (kSmiPrecission - (kSmiTagSize)));
800 static const int kMaxValue = (1 << (kBitsPerPointer - (kSmiTagSize + 1))) - 1; 801 static const int kMaxValue = (1 << (kSmiPrecission - (kSmiTagSize))) - 1;
Dean McNamee 2009/05/04 13:04:14 I would call this kSmiNumBits, precision (spelling
801 802
802 private: 803 private:
803 DISALLOW_IMPLICIT_CONSTRUCTORS(Smi); 804 DISALLOW_IMPLICIT_CONSTRUCTORS(Smi);
804 }; 805 };
805 806
806 807
807 // Failure is used for reporting out of memory situations and 808 // Failure is used for reporting out of memory situations and
808 // propagating exceptions through the runtime system. Failure objects 809 // propagating exceptions through the runtime system. Failure objects
809 // are transient and cannot occur as part of the objects graph. 810 // are transient and cannot occur as part of the objects graph.
810 // 811 //
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after
2317 static int SizeFor(int body_size, int sinfo_size) { 2318 static int SizeFor(int body_size, int sinfo_size) {
2318 ASSERT_SIZE_TAG_ALIGNED(body_size); 2319 ASSERT_SIZE_TAG_ALIGNED(body_size);
2319 ASSERT_SIZE_TAG_ALIGNED(sinfo_size); 2320 ASSERT_SIZE_TAG_ALIGNED(sinfo_size);
2320 return RoundUp(kHeaderSize + body_size + sinfo_size, kCodeAlignment); 2321 return RoundUp(kHeaderSize + body_size + sinfo_size, kCodeAlignment);
2321 } 2322 }
2322 2323
2323 // Calculate the size of the code object to report for log events. This takes 2324 // Calculate the size of the code object to report for log events. This takes
2324 // the layout of the code object into account. 2325 // the layout of the code object into account.
2325 int ExecutableSize() { 2326 int ExecutableSize() {
2326 // Check that the assumptions about the layout of the code object holds. 2327 // Check that the assumptions about the layout of the code object holds.
2327 ASSERT_EQ(reinterpret_cast<unsigned int>(instruction_start()) - 2328 ASSERT_EQ(reinterpret_cast<uintptr_t>(instruction_start()) -
2328 reinterpret_cast<unsigned int>(address()), 2329 reinterpret_cast<uintptr_t>(address()),
Dean McNamee 2009/05/04 13:04:14 Do we really need this, both should be returning p
2329 Code::kHeaderSize); 2330 Code::kHeaderSize);
2330 return instruction_size() + Code::kHeaderSize; 2331 return instruction_size() + Code::kHeaderSize;
2331 } 2332 }
2332 2333
2333 // Locating source position. 2334 // Locating source position.
2334 int SourcePosition(Address pc); 2335 int SourcePosition(Address pc);
2335 int SourceStatementPosition(Address pc); 2336 int SourceStatementPosition(Address pc);
2336 2337
2337 // Casting. 2338 // Casting.
2338 static inline Code* cast(Object* obj); 2339 static inline Code* cast(Object* obj);
(...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after
4368 } else { 4369 } else {
4369 value &= ~(1 << bit_position); 4370 value &= ~(1 << bit_position);
4370 } 4371 }
4371 return value; 4372 return value;
4372 } 4373 }
4373 }; 4374 };
4374 4375
4375 } } // namespace v8::internal 4376 } } // namespace v8::internal
4376 4377
4377 #endif // V8_OBJECTS_H_ 4378 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/checks.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698