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 2300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2311 { MaybeObject* maybe_obj = AllocateHeapNumber(OS::nan_value(), TENURED); | 2311 { MaybeObject* maybe_obj = AllocateHeapNumber(OS::nan_value(), TENURED); |
2312 if (!maybe_obj->ToObject(&obj)) return false; | 2312 if (!maybe_obj->ToObject(&obj)) return false; |
2313 } | 2313 } |
2314 set_nan_value(HeapNumber::cast(obj)); | 2314 set_nan_value(HeapNumber::cast(obj)); |
2315 | 2315 |
2316 { MaybeObject* maybe_obj = AllocateHeapNumber(V8_INFINITY, TENURED); | 2316 { MaybeObject* maybe_obj = AllocateHeapNumber(V8_INFINITY, TENURED); |
2317 if (!maybe_obj->ToObject(&obj)) return false; | 2317 if (!maybe_obj->ToObject(&obj)) return false; |
2318 } | 2318 } |
2319 set_infinity_value(HeapNumber::cast(obj)); | 2319 set_infinity_value(HeapNumber::cast(obj)); |
2320 | 2320 |
| 2321 // The oddbals have not been created yet, but we want to put something predict
able |
| 2322 // in the gaps in the symbol table, so lets make that Smi zero. |
| 2323 set_undefined(reinterpret_cast<Oddball*>(Smi::FromInt(0))); |
| 2324 set_the_hole_value(reinterpret_cast<Oddball*>(Smi::FromInt(0))); |
| 2325 |
2321 // Allocate initial symbol table. | 2326 // Allocate initial symbol table. |
2322 { MaybeObject* maybe_obj = SymbolTable::Allocate(kInitialSymbolTableSize); | 2327 { MaybeObject* maybe_obj = SymbolTable::Allocate(kInitialSymbolTableSize); |
2323 if (!maybe_obj->ToObject(&obj)) return false; | 2328 if (!maybe_obj->ToObject(&obj)) return false; |
2324 } | 2329 } |
2325 // Don't use set_symbol_table() due to asserts. | 2330 // Don't use set_symbol_table() due to asserts. |
2326 roots_[kSymbolTableRootIndex] = obj; | 2331 roots_[kSymbolTableRootIndex] = obj; |
2327 | 2332 |
2328 // Finish initializing oddballs after creating symboltable. | 2333 // Finish initializing oddballs after creating symboltable. |
2329 { MaybeObject* maybe_obj = | 2334 { MaybeObject* maybe_obj = |
2330 undefined_value()->Initialize("undefined", | 2335 undefined_value()->Initialize("undefined", |
(...skipping 4272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6603 isolate_->heap()->store_buffer()->Compact(); | 6608 isolate_->heap()->store_buffer()->Compact(); |
6604 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); | 6609 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); |
6605 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { | 6610 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { |
6606 next = chunk->next_chunk(); | 6611 next = chunk->next_chunk(); |
6607 isolate_->memory_allocator()->Free(chunk); | 6612 isolate_->memory_allocator()->Free(chunk); |
6608 } | 6613 } |
6609 chunks_queued_for_free_ = NULL; | 6614 chunks_queued_for_free_ = NULL; |
6610 } | 6615 } |
6611 | 6616 |
6612 } } // namespace v8::internal | 6617 } } // namespace v8::internal |
OLD | NEW |