| OLD | NEW |
| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 Object* Heap::NumberFromUint32(uint32_t value) { | 101 Object* Heap::NumberFromUint32(uint32_t value) { |
| 102 if ((int32_t)value >= 0 && Smi::IsValid((int32_t)value)) { | 102 if ((int32_t)value >= 0 && Smi::IsValid((int32_t)value)) { |
| 103 return Smi::FromInt((int32_t)value); | 103 return Smi::FromInt((int32_t)value); |
| 104 } | 104 } |
| 105 // Bypass NumberFromDouble to avoid various redundant checks. | 105 // Bypass NumberFromDouble to avoid various redundant checks. |
| 106 return AllocateHeapNumber(FastUI2D(value)); | 106 return AllocateHeapNumber(FastUI2D(value)); |
| 107 } | 107 } |
| 108 | 108 |
| 109 | 109 |
| 110 Object* Heap::AllocateRawMap(int size_in_bytes) { | 110 Object* Heap::AllocateRawMap() { |
| 111 #ifdef DEBUG | 111 #ifdef DEBUG |
| 112 Counters::objs_since_last_full.Increment(); | 112 Counters::objs_since_last_full.Increment(); |
| 113 Counters::objs_since_last_young.Increment(); | 113 Counters::objs_since_last_young.Increment(); |
| 114 #endif | 114 #endif |
| 115 Object* result = map_space_->AllocateRaw(size_in_bytes); | 115 Object* result = map_space_->AllocateRaw(Map::kSize); |
| 116 if (result->IsFailure()) old_gen_exhausted_ = true; |
| 117 return result; |
| 118 } |
| 119 |
| 120 |
| 121 Object* Heap::AllocateRawGlobalPropertyCell() { |
| 122 #ifdef DEBUG |
| 123 Counters::objs_since_last_full.Increment(); |
| 124 Counters::objs_since_last_young.Increment(); |
| 125 #endif |
| 126 Object* result = |
| 127 global_property_cell_space_->AllocateRaw(JSGlobalPropertyCell::kSize); |
| 116 if (result->IsFailure()) old_gen_exhausted_ = true; | 128 if (result->IsFailure()) old_gen_exhausted_ = true; |
| 117 return result; | 129 return result; |
| 118 } | 130 } |
| 119 | 131 |
| 120 | 132 |
| 121 bool Heap::InNewSpace(Object* object) { | 133 bool Heap::InNewSpace(Object* object) { |
| 122 return new_space_.Contains(object); | 134 return new_space_.Contains(object); |
| 123 } | 135 } |
| 124 | 136 |
| 125 | 137 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 allocation_allowed_ = new_state; | 293 allocation_allowed_ = new_state; |
| 282 return old; | 294 return old; |
| 283 } | 295 } |
| 284 | 296 |
| 285 #endif | 297 #endif |
| 286 | 298 |
| 287 | 299 |
| 288 } } // namespace v8::internal | 300 } } // namespace v8::internal |
| 289 | 301 |
| 290 #endif // V8_HEAP_INL_H_ | 302 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |