| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/factory.h" | 5 #include "src/factory.h" |
| 6 | 6 |
| 7 #include "src/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
| (...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1429 bool crankshafted, | 1429 bool crankshafted, |
| 1430 int prologue_offset, | 1430 int prologue_offset, |
| 1431 bool is_debug) { | 1431 bool is_debug) { |
| 1432 Handle<ByteArray> reloc_info = NewByteArray(desc.reloc_size, TENURED); | 1432 Handle<ByteArray> reloc_info = NewByteArray(desc.reloc_size, TENURED); |
| 1433 | 1433 |
| 1434 // Compute size. | 1434 // Compute size. |
| 1435 int body_size = RoundUp(desc.instr_size, kObjectAlignment); | 1435 int body_size = RoundUp(desc.instr_size, kObjectAlignment); |
| 1436 int obj_size = Code::SizeFor(body_size); | 1436 int obj_size = Code::SizeFor(body_size); |
| 1437 | 1437 |
| 1438 Handle<Code> code = NewCodeRaw(obj_size, immovable); | 1438 Handle<Code> code = NewCodeRaw(obj_size, immovable); |
| 1439 DCHECK(isolate()->code_range() == NULL || | 1439 DCHECK(isolate()->code_range() == NULL || !isolate()->code_range()->valid() || |
| 1440 !isolate()->code_range()->valid() || | 1440 isolate()->code_range()->contains(code->address()) || |
| 1441 isolate()->code_range()->contains(code->address())); | 1441 obj_size <= isolate()->heap()->code_space()->AreaSize()); |
| 1442 | 1442 |
| 1443 // The code object has not been fully initialized yet. We rely on the | 1443 // The code object has not been fully initialized yet. We rely on the |
| 1444 // fact that no allocation will happen from this point on. | 1444 // fact that no allocation will happen from this point on. |
| 1445 DisallowHeapAllocation no_gc; | 1445 DisallowHeapAllocation no_gc; |
| 1446 code->set_gc_metadata(Smi::FromInt(0)); | 1446 code->set_gc_metadata(Smi::FromInt(0)); |
| 1447 code->set_ic_age(isolate()->heap()->global_ic_age()); | 1447 code->set_ic_age(isolate()->heap()->global_ic_age()); |
| 1448 code->set_instruction_size(desc.instr_size); | 1448 code->set_instruction_size(desc.instr_size); |
| 1449 code->set_relocation_info(*reloc_info); | 1449 code->set_relocation_info(*reloc_info); |
| 1450 code->set_flags(flags); | 1450 code->set_flags(flags); |
| 1451 code->set_raw_kind_specific_flags1(0); | 1451 code->set_raw_kind_specific_flags1(0); |
| (...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2430 } | 2430 } |
| 2431 | 2431 |
| 2432 | 2432 |
| 2433 Handle<Object> Factory::ToBoolean(bool value) { | 2433 Handle<Object> Factory::ToBoolean(bool value) { |
| 2434 return value ? true_value() : false_value(); | 2434 return value ? true_value() : false_value(); |
| 2435 } | 2435 } |
| 2436 | 2436 |
| 2437 | 2437 |
| 2438 } // namespace internal | 2438 } // namespace internal |
| 2439 } // namespace v8 | 2439 } // namespace v8 |
| OLD | NEW |