| 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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 context->set_previous(*previous); | 824 context->set_previous(*previous); |
| 825 context->set_extension(*extension); | 825 context->set_extension(*extension); |
| 826 context->set_native_context(previous->native_context()); | 826 context->set_native_context(previous->native_context()); |
| 827 return context; | 827 return context; |
| 828 } | 828 } |
| 829 | 829 |
| 830 | 830 |
| 831 Handle<Context> Factory::NewBlockContext(Handle<JSFunction> function, | 831 Handle<Context> Factory::NewBlockContext(Handle<JSFunction> function, |
| 832 Handle<Context> previous, | 832 Handle<Context> previous, |
| 833 Handle<ScopeInfo> scope_info) { | 833 Handle<ScopeInfo> scope_info) { |
| 834 Handle<FixedArray> array = | 834 Handle<FixedArray> array = NewFixedArray(scope_info->ContextLength()); |
| 835 NewFixedArrayWithHoles(scope_info->ContextLength()); | |
| 836 array->set_map_no_write_barrier(*block_context_map()); | 835 array->set_map_no_write_barrier(*block_context_map()); |
| 837 Handle<Context> context = Handle<Context>::cast(array); | 836 Handle<Context> context = Handle<Context>::cast(array); |
| 838 context->set_closure(*function); | 837 context->set_closure(*function); |
| 839 context->set_previous(*previous); | 838 context->set_previous(*previous); |
| 840 context->set_extension(*scope_info); | 839 context->set_extension(*scope_info); |
| 841 context->set_native_context(previous->native_context()); | 840 context->set_native_context(previous->native_context()); |
| 842 return context; | 841 return context; |
| 843 } | 842 } |
| 844 | 843 |
| 845 | 844 |
| (...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2399 } | 2398 } |
| 2400 | 2399 |
| 2401 | 2400 |
| 2402 Handle<Object> Factory::ToBoolean(bool value) { | 2401 Handle<Object> Factory::ToBoolean(bool value) { |
| 2403 return value ? true_value() : false_value(); | 2402 return value ? true_value() : false_value(); |
| 2404 } | 2403 } |
| 2405 | 2404 |
| 2406 | 2405 |
| 2407 } // namespace internal | 2406 } // namespace internal |
| 2408 } // namespace v8 | 2407 } // namespace v8 |
| OLD | NEW |