| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1385 obj = AllocateSymbol(CStrVector(""), 0, String::kHashComputedMask); | 1385 obj = AllocateSymbol(CStrVector(""), 0, String::kHashComputedMask); |
| 1386 if (obj->IsFailure()) return false; | 1386 if (obj->IsFailure()) return false; |
| 1387 hidden_symbol_ = String::cast(obj); | 1387 hidden_symbol_ = String::cast(obj); |
| 1388 | 1388 |
| 1389 // Allocate the proxy for __proto__. | 1389 // Allocate the proxy for __proto__. |
| 1390 obj = AllocateProxy((Address) &Accessors::ObjectPrototype); | 1390 obj = AllocateProxy((Address) &Accessors::ObjectPrototype); |
| 1391 if (obj->IsFailure()) return false; | 1391 if (obj->IsFailure()) return false; |
| 1392 prototype_accessors_ = Proxy::cast(obj); | 1392 prototype_accessors_ = Proxy::cast(obj); |
| 1393 | 1393 |
| 1394 // Allocate the code_stubs dictionary. | 1394 // Allocate the code_stubs dictionary. |
| 1395 obj = Dictionary::Allocate(4); | 1395 obj = NumberDictionary::Allocate(4); |
| 1396 if (obj->IsFailure()) return false; | 1396 if (obj->IsFailure()) return false; |
| 1397 code_stubs_ = Dictionary::cast(obj); | 1397 code_stubs_ = NumberDictionary::cast(obj); |
| 1398 | 1398 |
| 1399 // Allocate the non_monomorphic_cache used in stub-cache.cc | 1399 // Allocate the non_monomorphic_cache used in stub-cache.cc |
| 1400 obj = Dictionary::Allocate(4); | 1400 obj = NumberDictionary::Allocate(4); |
| 1401 if (obj->IsFailure()) return false; | 1401 if (obj->IsFailure()) return false; |
| 1402 non_monomorphic_cache_ = Dictionary::cast(obj); | 1402 non_monomorphic_cache_ = NumberDictionary::cast(obj); |
| 1403 | 1403 |
| 1404 CreateFixedStubs(); | 1404 CreateFixedStubs(); |
| 1405 | 1405 |
| 1406 // Allocate the number->string conversion cache | 1406 // Allocate the number->string conversion cache |
| 1407 obj = AllocateFixedArray(kNumberStringCacheSize * 2); | 1407 obj = AllocateFixedArray(kNumberStringCacheSize * 2); |
| 1408 if (obj->IsFailure()) return false; | 1408 if (obj->IsFailure()) return false; |
| 1409 number_string_cache_ = FixedArray::cast(obj); | 1409 number_string_cache_ = FixedArray::cast(obj); |
| 1410 | 1410 |
| 1411 // Allocate cache for single character strings. | 1411 // Allocate cache for single character strings. |
| 1412 obj = AllocateFixedArray(String::kMaxAsciiCharCode+1); | 1412 obj = AllocateFixedArray(String::kMaxAsciiCharCode+1); |
| (...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2556 } | 2556 } |
| 2557 } | 2557 } |
| 2558 return result; | 2558 return result; |
| 2559 } | 2559 } |
| 2560 | 2560 |
| 2561 | 2561 |
| 2562 Object* Heap::AllocateHashTable(int length) { | 2562 Object* Heap::AllocateHashTable(int length) { |
| 2563 Object* result = Heap::AllocateFixedArray(length); | 2563 Object* result = Heap::AllocateFixedArray(length); |
| 2564 if (result->IsFailure()) return result; | 2564 if (result->IsFailure()) return result; |
| 2565 reinterpret_cast<Array*>(result)->set_map(hash_table_map()); | 2565 reinterpret_cast<Array*>(result)->set_map(hash_table_map()); |
| 2566 ASSERT(result->IsDictionary()); | 2566 ASSERT(result->IsHashTable()); |
| 2567 return result; | 2567 return result; |
| 2568 } | 2568 } |
| 2569 | 2569 |
| 2570 | 2570 |
| 2571 Object* Heap::AllocateGlobalContext() { | 2571 Object* Heap::AllocateGlobalContext() { |
| 2572 Object* result = Heap::AllocateFixedArray(Context::GLOBAL_CONTEXT_SLOTS); | 2572 Object* result = Heap::AllocateFixedArray(Context::GLOBAL_CONTEXT_SLOTS); |
| 2573 if (result->IsFailure()) return result; | 2573 if (result->IsFailure()) return result; |
| 2574 Context* context = reinterpret_cast<Context*>(result); | 2574 Context* context = reinterpret_cast<Context*>(result); |
| 2575 context->set_map(global_context_map()); | 2575 context->set_map(global_context_map()); |
| 2576 ASSERT(context->IsGlobalContext()); | 2576 ASSERT(context->IsGlobalContext()); |
| (...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3657 #ifdef DEBUG | 3657 #ifdef DEBUG |
| 3658 bool Heap::GarbageCollectionGreedyCheck() { | 3658 bool Heap::GarbageCollectionGreedyCheck() { |
| 3659 ASSERT(FLAG_gc_greedy); | 3659 ASSERT(FLAG_gc_greedy); |
| 3660 if (Bootstrapper::IsActive()) return true; | 3660 if (Bootstrapper::IsActive()) return true; |
| 3661 if (disallow_allocation_failure()) return true; | 3661 if (disallow_allocation_failure()) return true; |
| 3662 return CollectGarbage(0, NEW_SPACE); | 3662 return CollectGarbage(0, NEW_SPACE); |
| 3663 } | 3663 } |
| 3664 #endif | 3664 #endif |
| 3665 | 3665 |
| 3666 } } // namespace v8::internal | 3666 } } // namespace v8::internal |
| OLD | NEW |