| OLD | NEW |
| 1 // Copyright 2006-2008 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 31 #include "splay-tree-inl.h" | 31 #include "splay-tree-inl.h" |
| 32 | 32 |
| 33 namespace v8 { | 33 namespace v8 { |
| 34 namespace internal { | 34 namespace internal { |
| 35 | 35 |
| 36 | 36 |
| 37 Address Zone::position_ = 0; | 37 Address Zone::position_ = 0; |
| 38 Address Zone::limit_ = 0; | 38 Address Zone::limit_ = 0; |
| 39 int Zone::zone_excess_limit_ = 256 * MB; | 39 int Zone::zone_excess_limit_ = 256 * MB; |
| 40 int Zone::segment_bytes_allocated_ = 0; | 40 int Zone::segment_bytes_allocated_ = 0; |
| 41 unsigned Zone::allocation_size_ = 0; |
| 41 | 42 |
| 42 bool AssertNoZoneAllocation::allow_allocation_ = true; | 43 bool AssertNoZoneAllocation::allow_allocation_ = true; |
| 43 | 44 |
| 44 int ZoneScope::nesting_ = 0; | 45 int ZoneScope::nesting_ = 0; |
| 45 | 46 |
| 46 // Segments represent chunks of memory: They have starting address | 47 // Segments represent chunks of memory: They have starting address |
| 47 // (encoded in the this pointer) and a size in bytes. Segments are | 48 // (encoded in the this pointer) and a size in bytes. Segments are |
| 48 // chained together forming a LIFO structure with the newest segment | 49 // chained together forming a LIFO structure with the newest segment |
| 49 // available as Segment::head(). Segments are allocated using malloc() | 50 // available as Segment::head(). Segments are allocated using malloc() |
| 50 // and de-allocated using free(). | 51 // and de-allocated using free(). |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // Recompute 'top' and 'limit' based on the new segment. | 186 // Recompute 'top' and 'limit' based on the new segment. |
| 186 Address result = RoundUp(segment->start(), kAlignment); | 187 Address result = RoundUp(segment->start(), kAlignment); |
| 187 position_ = result + size; | 188 position_ = result + size; |
| 188 limit_ = segment->end(); | 189 limit_ = segment->end(); |
| 189 ASSERT(position_ <= limit_); | 190 ASSERT(position_ <= limit_); |
| 190 return result; | 191 return result; |
| 191 } | 192 } |
| 192 | 193 |
| 193 | 194 |
| 194 } } // namespace v8::internal | 195 } } // namespace v8::internal |
| OLD | NEW |