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 20 matching lines...) Expand all Loading... |
31 #include "log.h" | 31 #include "log.h" |
32 #include "v8-counters.h" | 32 #include "v8-counters.h" |
33 | 33 |
34 namespace v8 { namespace internal { | 34 namespace v8 { namespace internal { |
35 | 35 |
36 int Heap::MaxHeapObjectSize() { | 36 int Heap::MaxHeapObjectSize() { |
37 return Page::kMaxHeapObjectSize; | 37 return Page::kMaxHeapObjectSize; |
38 } | 38 } |
39 | 39 |
40 | 40 |
| 41 Object* Heap::AllocateSymbol(Vector<const char> str, |
| 42 int chars, |
| 43 uint32_t length_field) { |
| 44 if (global_external_symbol_callback_) { |
| 45 return AllocateExternalSymbol(str, chars); |
| 46 } |
| 47 unibrow::Utf8InputBuffer<> buffer(str.start(), |
| 48 static_cast<unsigned>(str.length())); |
| 49 return AllocateInternalSymbol(&buffer, chars, length_field); |
| 50 } |
| 51 |
| 52 |
| 53 |
41 Object* Heap::AllocateRaw(int size_in_bytes, | 54 Object* Heap::AllocateRaw(int size_in_bytes, |
42 AllocationSpace space, | 55 AllocationSpace space, |
43 AllocationSpace retry_space) { | 56 AllocationSpace retry_space) { |
44 ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC); | 57 ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC); |
45 ASSERT(space != NEW_SPACE || | 58 ASSERT(space != NEW_SPACE || |
46 retry_space == OLD_POINTER_SPACE || | 59 retry_space == OLD_POINTER_SPACE || |
47 retry_space == OLD_DATA_SPACE); | 60 retry_space == OLD_DATA_SPACE); |
48 #ifdef DEBUG | 61 #ifdef DEBUG |
49 if (FLAG_gc_interval >= 0 && | 62 if (FLAG_gc_interval >= 0 && |
50 !disallow_allocation_failure_ && | 63 !disallow_allocation_failure_ && |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 allocation_allowed_ = new_state; | 276 allocation_allowed_ = new_state; |
264 return old; | 277 return old; |
265 } | 278 } |
266 | 279 |
267 #endif | 280 #endif |
268 | 281 |
269 | 282 |
270 } } // namespace v8::internal | 283 } } // namespace v8::internal |
271 | 284 |
272 #endif // V8_HEAP_INL_H_ | 285 #endif // V8_HEAP_INL_H_ |
OLD | NEW |