| OLD | NEW |
| 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 Loading... |
| 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 2427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2773 } | 2781 } |
| 2774 // Must be small, since an iteration is used for lookup. | 2782 // Must be small, since an iteration is used for lookup. |
| 2775 static const int kMaxComments = 64; | 2783 static const int kMaxComments = 64; |
| 2776 }; | 2784 }; |
| 2777 #endif | 2785 #endif |
| 2778 | 2786 |
| 2779 | 2787 |
| 2780 } } // namespace v8::internal | 2788 } } // namespace v8::internal |
| 2781 | 2789 |
| 2782 #endif // V8_SPACES_H_ | 2790 #endif // V8_SPACES_H_ |
| OLD | NEW |