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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 context->set(Context::THROWN_OBJECT_INDEX, *thrown_object); | 837 context->set(Context::THROWN_OBJECT_INDEX, *thrown_object); |
838 return context; | 838 return context; |
839 } | 839 } |
840 | 840 |
841 Handle<Context> Factory::NewDebugEvaluateContext(Handle<Context> previous, | 841 Handle<Context> Factory::NewDebugEvaluateContext(Handle<Context> previous, |
842 Handle<ScopeInfo> scope_info, | 842 Handle<ScopeInfo> scope_info, |
843 Handle<JSReceiver> extension, | 843 Handle<JSReceiver> extension, |
844 Handle<Context> wrapped, | 844 Handle<Context> wrapped, |
845 Handle<StringSet> whitelist) { | 845 Handle<StringSet> whitelist) { |
846 STATIC_ASSERT(Context::WHITE_LIST_INDEX == Context::MIN_CONTEXT_SLOTS + 1); | 846 STATIC_ASSERT(Context::WHITE_LIST_INDEX == Context::MIN_CONTEXT_SLOTS + 1); |
| 847 DCHECK(scope_info->IsDebugEvaluateScope()); |
847 Handle<ContextExtension> context_extension = NewContextExtension( | 848 Handle<ContextExtension> context_extension = NewContextExtension( |
848 scope_info, extension.is_null() ? Handle<Object>::cast(undefined_value()) | 849 scope_info, extension.is_null() ? Handle<Object>::cast(undefined_value()) |
849 : Handle<Object>::cast(extension)); | 850 : Handle<Object>::cast(extension)); |
850 Handle<FixedArray> array = NewFixedArray(Context::MIN_CONTEXT_SLOTS + 2); | 851 Handle<FixedArray> array = NewFixedArray(Context::MIN_CONTEXT_SLOTS + 2); |
851 array->set_map_no_write_barrier(*debug_evaluate_context_map()); | 852 array->set_map_no_write_barrier(*debug_evaluate_context_map()); |
852 Handle<Context> c = Handle<Context>::cast(array); | 853 Handle<Context> c = Handle<Context>::cast(array); |
853 c->set_closure(wrapped.is_null() ? previous->closure() : wrapped->closure()); | 854 c->set_closure(wrapped.is_null() ? previous->closure() : wrapped->closure()); |
854 c->set_previous(*previous); | 855 c->set_previous(*previous); |
855 c->set_native_context(previous->native_context()); | 856 c->set_native_context(previous->native_context()); |
856 c->set_extension(*context_extension); | 857 c->set_extension(*context_extension); |
(...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2530 Handle<AccessorInfo> prototype = | 2531 Handle<AccessorInfo> prototype = |
2531 Accessors::FunctionPrototypeInfo(isolate(), attribs); | 2532 Accessors::FunctionPrototypeInfo(isolate(), attribs); |
2532 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), | 2533 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), |
2533 prototype, attribs); | 2534 prototype, attribs); |
2534 map->AppendDescriptor(&d); | 2535 map->AppendDescriptor(&d); |
2535 } | 2536 } |
2536 } | 2537 } |
2537 | 2538 |
2538 } // namespace internal | 2539 } // namespace internal |
2539 } // namespace v8 | 2540 } // namespace v8 |
OLD | NEW |