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

Side by Side Diff: src/spaces.h

Issue 12090072: Work around a bug in Clang that optimizes away a NULL check (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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/spaces.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 } 326 }
327 } 327 }
328 328
329 void set_owner(Space* space) { 329 void set_owner(Space* space) {
330 ASSERT((reinterpret_cast<intptr_t>(space) & kFailureTagMask) == 0); 330 ASSERT((reinterpret_cast<intptr_t>(space) & kFailureTagMask) == 0);
331 owner_ = reinterpret_cast<Address>(space) + kFailureTag; 331 owner_ = reinterpret_cast<Address>(space) + kFailureTag;
332 ASSERT((reinterpret_cast<intptr_t>(owner_) & kFailureTagMask) == 332 ASSERT((reinterpret_cast<intptr_t>(owner_) & kFailureTagMask) ==
333 kFailureTag); 333 kFailureTag);
334 } 334 }
335 335
336 // Workaround for a bug in Clang-3.3 which in some situations optimizes away
337 // an "if (chunk->owner() != NULL)" check.
338 bool has_owner() {
339 if (owner_ == 0) return false;
340 if (reinterpret_cast<intptr_t>(owner_) == kFailureTag) return false;
341 return true;
342 }
343
336 VirtualMemory* reserved_memory() { 344 VirtualMemory* reserved_memory() {
337 return &reservation_; 345 return &reservation_;
338 } 346 }
339 347
340 void InitializeReservedMemory() { 348 void InitializeReservedMemory() {
341 reservation_.Reset(); 349 reservation_.Reset();
342 } 350 }
343 351
344 void set_reserved_memory(VirtualMemory* reservation) { 352 void set_reserved_memory(VirtualMemory* reservation) {
345 ASSERT_NOT_NULL(reservation); 353 ASSERT_NOT_NULL(reservation);
(...skipping 2473 matching lines...) Expand 10 before | Expand all | Expand 10 after
2819 } 2827 }
2820 // Must be small, since an iteration is used for lookup. 2828 // Must be small, since an iteration is used for lookup.
2821 static const int kMaxComments = 64; 2829 static const int kMaxComments = 64;
2822 }; 2830 };
2823 #endif 2831 #endif
2824 2832
2825 2833
2826 } } // namespace v8::internal 2834 } } // namespace v8::internal
2827 2835
2828 #endif // V8_SPACES_H_ 2836 #endif // V8_SPACES_H_
OLDNEW
« no previous file with comments | « no previous file | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698