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 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1692 if (size == kPointerSize) { | 1692 if (size == kPointerSize) { |
1693 filler->set_map(Heap::one_word_filler_map()); | 1693 filler->set_map(Heap::one_word_filler_map()); |
1694 } else { | 1694 } else { |
1695 filler->set_map(Heap::byte_array_map()); | 1695 filler->set_map(Heap::byte_array_map()); |
1696 ByteArray::cast(filler)->set_length(ByteArray::LengthFor(size)); | 1696 ByteArray::cast(filler)->set_length(ByteArray::LengthFor(size)); |
1697 } | 1697 } |
1698 } | 1698 } |
1699 | 1699 |
1700 | 1700 |
1701 Object* Heap::CreateCode(const CodeDesc& desc, | 1701 Object* Heap::CreateCode(const CodeDesc& desc, |
1702 ScopeInfo<>* sinfo, | 1702 ZoneScopeInfo* sinfo, |
1703 Code::Flags flags, | 1703 Code::Flags flags, |
1704 Handle<Object> self_reference) { | 1704 Handle<Object> self_reference) { |
1705 // Compute size | 1705 // Compute size |
1706 int body_size = RoundUp(desc.instr_size + desc.reloc_size, kObjectAlignment); | 1706 int body_size = RoundUp(desc.instr_size + desc.reloc_size, kObjectAlignment); |
1707 int sinfo_size = 0; | 1707 int sinfo_size = 0; |
1708 if (sinfo != NULL) sinfo_size = sinfo->Serialize(NULL); | 1708 if (sinfo != NULL) sinfo_size = sinfo->Serialize(NULL); |
1709 int obj_size = Code::SizeFor(body_size, sinfo_size); | 1709 int obj_size = Code::SizeFor(body_size, sinfo_size); |
1710 ASSERT(IsAligned(obj_size, Code::kCodeAlignment)); | 1710 ASSERT(IsAligned(obj_size, Code::kCodeAlignment)); |
1711 Object* result; | 1711 Object* result; |
1712 if (obj_size > MaxHeapObjectSize()) { | 1712 if (obj_size > MaxHeapObjectSize()) { |
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3431 #ifdef DEBUG | 3431 #ifdef DEBUG |
3432 bool Heap::GarbageCollectionGreedyCheck() { | 3432 bool Heap::GarbageCollectionGreedyCheck() { |
3433 ASSERT(FLAG_gc_greedy); | 3433 ASSERT(FLAG_gc_greedy); |
3434 if (Bootstrapper::IsActive()) return true; | 3434 if (Bootstrapper::IsActive()) return true; |
3435 if (disallow_allocation_failure()) return true; | 3435 if (disallow_allocation_failure()) return true; |
3436 return CollectGarbage(0, NEW_SPACE); | 3436 return CollectGarbage(0, NEW_SPACE); |
3437 } | 3437 } |
3438 #endif | 3438 #endif |
3439 | 3439 |
3440 } } // namespace v8::internal | 3440 } } // namespace v8::internal |
OLD | NEW |