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/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 } | 773 } |
774 | 774 |
775 | 775 |
776 Handle<Context> Factory::NewNativeContext() { | 776 Handle<Context> Factory::NewNativeContext() { |
777 Handle<FixedArray> array = | 777 Handle<FixedArray> array = |
778 NewFixedArray(Context::NATIVE_CONTEXT_SLOTS, TENURED); | 778 NewFixedArray(Context::NATIVE_CONTEXT_SLOTS, TENURED); |
779 array->set_map_no_write_barrier(*native_context_map()); | 779 array->set_map_no_write_barrier(*native_context_map()); |
780 Handle<Context> context = Handle<Context>::cast(array); | 780 Handle<Context> context = Handle<Context>::cast(array); |
781 context->set_native_context(*context); | 781 context->set_native_context(*context); |
782 context->set_errors_thrown(Smi::kZero); | 782 context->set_errors_thrown(Smi::kZero); |
| 783 context->set_math_random_index(Smi::kZero); |
783 Handle<WeakCell> weak_cell = NewWeakCell(context); | 784 Handle<WeakCell> weak_cell = NewWeakCell(context); |
784 context->set_self_weak_cell(*weak_cell); | 785 context->set_self_weak_cell(*weak_cell); |
785 DCHECK(context->IsNativeContext()); | 786 DCHECK(context->IsNativeContext()); |
786 return context; | 787 return context; |
787 } | 788 } |
788 | 789 |
789 | 790 |
790 Handle<Context> Factory::NewScriptContext(Handle<JSFunction> function, | 791 Handle<Context> Factory::NewScriptContext(Handle<JSFunction> function, |
791 Handle<ScopeInfo> scope_info) { | 792 Handle<ScopeInfo> scope_info) { |
792 DCHECK_EQ(scope_info->scope_type(), SCRIPT_SCOPE); | 793 DCHECK_EQ(scope_info->scope_type(), SCRIPT_SCOPE); |
(...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2604 Handle<AccessorInfo> prototype = | 2605 Handle<AccessorInfo> prototype = |
2605 Accessors::FunctionPrototypeInfo(isolate(), attribs); | 2606 Accessors::FunctionPrototypeInfo(isolate(), attribs); |
2606 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), | 2607 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), |
2607 prototype, attribs); | 2608 prototype, attribs); |
2608 map->AppendDescriptor(&d); | 2609 map->AppendDescriptor(&d); |
2609 } | 2610 } |
2610 } | 2611 } |
2611 | 2612 |
2612 } // namespace internal | 2613 } // namespace internal |
2613 } // namespace v8 | 2614 } // namespace v8 |
OLD | NEW |