| OLD | NEW |
| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 reinterpret_cast<PreallocatedStorage*>(new char[size]); | 249 reinterpret_cast<PreallocatedStorage*>(new char[size]); |
| 250 free_list_.next_ = free_list_.previous_ = free_chunk; | 250 free_list_.next_ = free_list_.previous_ = free_chunk; |
| 251 free_chunk->next_ = free_chunk->previous_ = &free_list_; | 251 free_chunk->next_ = free_chunk->previous_ = &free_list_; |
| 252 free_chunk->size_ = size - sizeof(PreallocatedStorage); | 252 free_chunk->size_ = size - sizeof(PreallocatedStorage); |
| 253 preallocated_storage_preallocated_ = true; | 253 preallocated_storage_preallocated_ = true; |
| 254 } | 254 } |
| 255 | 255 |
| 256 | 256 |
| 257 void* Isolate::PreallocatedStorageNew(size_t size) { | 257 void* Isolate::PreallocatedStorageNew(size_t size) { |
| 258 if (!preallocated_storage_preallocated_) { | 258 if (!preallocated_storage_preallocated_) { |
| 259 return FreeStoreAllocationPolicy::New(size); | 259 return FreeStoreAllocationPolicy().New(size); |
| 260 } | 260 } |
| 261 ASSERT(free_list_.next_ != &free_list_); | 261 ASSERT(free_list_.next_ != &free_list_); |
| 262 ASSERT(free_list_.previous_ != &free_list_); | 262 ASSERT(free_list_.previous_ != &free_list_); |
| 263 | 263 |
| 264 size = (size + kPointerSize - 1) & ~(kPointerSize - 1); | 264 size = (size + kPointerSize - 1) & ~(kPointerSize - 1); |
| 265 // Search for exact fit. | 265 // Search for exact fit. |
| 266 for (PreallocatedStorage* storage = free_list_.next_; | 266 for (PreallocatedStorage* storage = free_list_.next_; |
| 267 storage != &free_list_; | 267 storage != &free_list_; |
| 268 storage = storage->next_) { | 268 storage = storage->next_) { |
| 269 if (storage->size_ == size) { | 269 if (storage->size_ == size) { |
| (...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1961 | 1961 |
| 1962 #ifdef DEBUG | 1962 #ifdef DEBUG |
| 1963 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 1963 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 1964 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 1964 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 1965 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 1965 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 1966 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 1966 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 1967 #undef ISOLATE_FIELD_OFFSET | 1967 #undef ISOLATE_FIELD_OFFSET |
| 1968 #endif | 1968 #endif |
| 1969 | 1969 |
| 1970 } } // namespace v8::internal | 1970 } } // namespace v8::internal |
| OLD | NEW |