| 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/conversions.h" | 9 #include "src/conversions.h" |
| 10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 Handle<Context> context = Handle<Context>::cast(array); | 701 Handle<Context> context = Handle<Context>::cast(array); |
| 702 context->set_closure(*function); | 702 context->set_closure(*function); |
| 703 context->set_previous(function->context()); | 703 context->set_previous(function->context()); |
| 704 context->set_extension(*scope_info); | 704 context->set_extension(*scope_info); |
| 705 context->set_global_object(function->context()->global_object()); | 705 context->set_global_object(function->context()->global_object()); |
| 706 DCHECK(context->IsGlobalContext()); | 706 DCHECK(context->IsGlobalContext()); |
| 707 return context; | 707 return context; |
| 708 } | 708 } |
| 709 | 709 |
| 710 | 710 |
| 711 Handle<GlobalContextTable> Factory::NewEmptyGlobalContextTable() { |
| 712 Handle<FixedArray> array = NewFixedArray(1); |
| 713 array->set_map_no_write_barrier(*global_context_table_map()); |
| 714 array->set(0, Smi::FromInt(0)); |
| 715 Handle<GlobalContextTable> context_table = |
| 716 Handle<GlobalContextTable>::cast(array); |
| 717 return context_table; |
| 718 } |
| 719 |
| 720 |
| 711 Handle<Context> Factory::NewModuleContext(Handle<ScopeInfo> scope_info) { | 721 Handle<Context> Factory::NewModuleContext(Handle<ScopeInfo> scope_info) { |
| 712 Handle<FixedArray> array = | 722 Handle<FixedArray> array = |
| 713 NewFixedArray(scope_info->ContextLength(), TENURED); | 723 NewFixedArray(scope_info->ContextLength(), TENURED); |
| 714 array->set_map_no_write_barrier(*module_context_map()); | 724 array->set_map_no_write_barrier(*module_context_map()); |
| 715 // Instance link will be set later. | 725 // Instance link will be set later. |
| 716 Handle<Context> context = Handle<Context>::cast(array); | 726 Handle<Context> context = Handle<Context>::cast(array); |
| 717 context->set_extension(Smi::FromInt(0)); | 727 context->set_extension(Smi::FromInt(0)); |
| 718 return context; | 728 return context; |
| 719 } | 729 } |
| 720 | 730 |
| (...skipping 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2498 return Handle<Object>::null(); | 2508 return Handle<Object>::null(); |
| 2499 } | 2509 } |
| 2500 | 2510 |
| 2501 | 2511 |
| 2502 Handle<Object> Factory::ToBoolean(bool value) { | 2512 Handle<Object> Factory::ToBoolean(bool value) { |
| 2503 return value ? true_value() : false_value(); | 2513 return value ? true_value() : false_value(); |
| 2504 } | 2514 } |
| 2505 | 2515 |
| 2506 | 2516 |
| 2507 } } // namespace v8::internal | 2517 } } // namespace v8::internal |
| OLD | NEW |