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/conversions.h" | 7 #include "src/conversions.h" |
8 #include "src/isolate-inl.h" | 8 #include "src/isolate-inl.h" |
9 #include "src/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
10 | 10 |
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 bool is_debug) { | 1404 bool is_debug) { |
1405 Handle<ByteArray> reloc_info = NewByteArray(desc.reloc_size, TENURED); | 1405 Handle<ByteArray> reloc_info = NewByteArray(desc.reloc_size, TENURED); |
1406 Handle<ConstantPoolArray> constant_pool = | 1406 Handle<ConstantPoolArray> constant_pool = |
1407 desc.origin->NewConstantPool(isolate()); | 1407 desc.origin->NewConstantPool(isolate()); |
1408 | 1408 |
1409 // Compute size. | 1409 // Compute size. |
1410 int body_size = RoundUp(desc.instr_size, kObjectAlignment); | 1410 int body_size = RoundUp(desc.instr_size, kObjectAlignment); |
1411 int obj_size = Code::SizeFor(body_size); | 1411 int obj_size = Code::SizeFor(body_size); |
1412 | 1412 |
1413 Handle<Code> code = NewCodeRaw(obj_size, immovable); | 1413 Handle<Code> code = NewCodeRaw(obj_size, immovable); |
1414 ASSERT(!isolate()->code_range()->exists() || | 1414 ASSERT(isolate()->code_range() == NULL || |
| 1415 !isolate()->code_range()->valid() || |
1415 isolate()->code_range()->contains(code->address())); | 1416 isolate()->code_range()->contains(code->address())); |
1416 | 1417 |
1417 // The code object has not been fully initialized yet. We rely on the | 1418 // The code object has not been fully initialized yet. We rely on the |
1418 // fact that no allocation will happen from this point on. | 1419 // fact that no allocation will happen from this point on. |
1419 DisallowHeapAllocation no_gc; | 1420 DisallowHeapAllocation no_gc; |
1420 code->set_gc_metadata(Smi::FromInt(0)); | 1421 code->set_gc_metadata(Smi::FromInt(0)); |
1421 code->set_ic_age(isolate()->heap()->global_ic_age()); | 1422 code->set_ic_age(isolate()->heap()->global_ic_age()); |
1422 code->set_instruction_size(desc.instr_size); | 1423 code->set_instruction_size(desc.instr_size); |
1423 code->set_relocation_info(*reloc_info); | 1424 code->set_relocation_info(*reloc_info); |
1424 code->set_flags(flags); | 1425 code->set_flags(flags); |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2336 return Handle<Object>::null(); | 2337 return Handle<Object>::null(); |
2337 } | 2338 } |
2338 | 2339 |
2339 | 2340 |
2340 Handle<Object> Factory::ToBoolean(bool value) { | 2341 Handle<Object> Factory::ToBoolean(bool value) { |
2341 return value ? true_value() : false_value(); | 2342 return value ? true_value() : false_value(); |
2342 } | 2343 } |
2343 | 2344 |
2344 | 2345 |
2345 } } // namespace v8::internal | 2346 } } // namespace v8::internal |
OLD | NEW |