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

Side by Side Diff: src/heap-inl.h

Issue 11644097: Use C++ style type casts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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 | « src/conversions-inl.h ('k') | src/mark-compact.cc » ('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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 MaybeObject* Heap::NumberFromInt32( 254 MaybeObject* Heap::NumberFromInt32(
255 int32_t value, PretenureFlag pretenure) { 255 int32_t value, PretenureFlag pretenure) {
256 if (Smi::IsValid(value)) return Smi::FromInt(value); 256 if (Smi::IsValid(value)) return Smi::FromInt(value);
257 // Bypass NumberFromDouble to avoid various redundant checks. 257 // Bypass NumberFromDouble to avoid various redundant checks.
258 return AllocateHeapNumber(FastI2D(value), pretenure); 258 return AllocateHeapNumber(FastI2D(value), pretenure);
259 } 259 }
260 260
261 261
262 MaybeObject* Heap::NumberFromUint32( 262 MaybeObject* Heap::NumberFromUint32(
263 uint32_t value, PretenureFlag pretenure) { 263 uint32_t value, PretenureFlag pretenure) {
264 if ((int32_t)value >= 0 && Smi::IsValid((int32_t)value)) { 264 if (static_cast<int32_t>(value) >= 0 &&
265 return Smi::FromInt((int32_t)value); 265 Smi::IsValid(static_cast<int32_t>(value))) {
266 return Smi::FromInt(static_cast<int32_t>(value));
266 } 267 }
267 // Bypass NumberFromDouble to avoid various redundant checks. 268 // Bypass NumberFromDouble to avoid various redundant checks.
268 return AllocateHeapNumber(FastUI2D(value), pretenure); 269 return AllocateHeapNumber(FastUI2D(value), pretenure);
269 } 270 }
270 271
271 272
272 void Heap::FinalizeExternalString(String* string) { 273 void Heap::FinalizeExternalString(String* string) {
273 ASSERT(string->IsExternalString()); 274 ASSERT(string->IsExternalString());
274 v8::String::ExternalStringResourceBase** resource_addr = 275 v8::String::ExternalStringResourceBase** resource_addr =
275 reinterpret_cast<v8::String::ExternalStringResourceBase**>( 276 reinterpret_cast<v8::String::ExternalStringResourceBase**>(
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 AssertNoAllocation::~AssertNoAllocation() { } 827 AssertNoAllocation::~AssertNoAllocation() { }
827 DisableAssertNoAllocation::DisableAssertNoAllocation() { } 828 DisableAssertNoAllocation::DisableAssertNoAllocation() { }
828 DisableAssertNoAllocation::~DisableAssertNoAllocation() { } 829 DisableAssertNoAllocation::~DisableAssertNoAllocation() { }
829 830
830 #endif 831 #endif
831 832
832 833
833 } } // namespace v8::internal 834 } } // namespace v8::internal
834 835
835 #endif // V8_HEAP_INL_H_ 836 #endif // V8_HEAP_INL_H_
OLDNEW
« no previous file with comments | « src/conversions-inl.h ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698