Chromium Code Reviews| 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 3995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4006 | 4006 |
| 4007 | 4007 |
| 4008 MaybeObject* Heap::AllocateByteArray(int length, PretenureFlag pretenure) { | 4008 MaybeObject* Heap::AllocateByteArray(int length, PretenureFlag pretenure) { |
| 4009 if (length < 0 || length > ByteArray::kMaxLength) { | 4009 if (length < 0 || length > ByteArray::kMaxLength) { |
| 4010 return Failure::OutOfMemoryException(0x7); | 4010 return Failure::OutOfMemoryException(0x7); |
| 4011 } | 4011 } |
| 4012 if (pretenure == NOT_TENURED) { | 4012 if (pretenure == NOT_TENURED) { |
| 4013 return AllocateByteArray(length); | 4013 return AllocateByteArray(length); |
| 4014 } | 4014 } |
| 4015 int size = ByteArray::SizeFor(length); | 4015 int size = ByteArray::SizeFor(length); |
| 4016 AllocationSpace space = | |
| 4017 (size > Page::kMaxNonCodeHeapObjectSize) ? LO_SPACE : OLD_DATA_SPACE; | |
| 4016 Object* result; | 4018 Object* result; |
| 4017 { MaybeObject* maybe_result = (size <= Page::kMaxNonCodeHeapObjectSize) | 4019 { MaybeObject* maybe_result = AllocateRaw(size, space, space); |
|
Hannes Payer (out of office)
2013/08/16 13:56:28
We should use AllocateRaw in all Allocate* functio
Michael Starzinger
2013/08/16 15:10:54
Yes, I wholeheartedly agree. It's on my plate as a
| |
| 4018 ? old_data_space_->AllocateRaw(size) | |
| 4019 : lo_space_->AllocateRaw(size, NOT_EXECUTABLE); | |
| 4020 if (!maybe_result->ToObject(&result)) return maybe_result; | 4020 if (!maybe_result->ToObject(&result)) return maybe_result; |
| 4021 } | 4021 } |
| 4022 | 4022 |
| 4023 reinterpret_cast<ByteArray*>(result)->set_map_no_write_barrier( | 4023 reinterpret_cast<ByteArray*>(result)->set_map_no_write_barrier( |
| 4024 byte_array_map()); | 4024 byte_array_map()); |
| 4025 reinterpret_cast<ByteArray*>(result)->set_length(length); | 4025 reinterpret_cast<ByteArray*>(result)->set_length(length); |
| 4026 return result; | 4026 return result; |
| 4027 } | 4027 } |
| 4028 | 4028 |
| 4029 | 4029 |
| (...skipping 4015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8045 if (FLAG_parallel_recompilation) { | 8045 if (FLAG_parallel_recompilation) { |
| 8046 heap_->relocation_mutex_->Lock(); | 8046 heap_->relocation_mutex_->Lock(); |
| 8047 #ifdef DEBUG | 8047 #ifdef DEBUG |
| 8048 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 8048 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
| 8049 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 8049 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
| 8050 #endif // DEBUG | 8050 #endif // DEBUG |
| 8051 } | 8051 } |
| 8052 } | 8052 } |
| 8053 | 8053 |
| 8054 } } // namespace v8::internal | 8054 } } // namespace v8::internal |
| OLD | NEW |