Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: src/factory.cc

Issue 1834633003: [debugger] allow debug-evaluate to change stack and context values. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: address comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 array->set_map_no_write_barrier(*catch_context_map()); 793 array->set_map_no_write_barrier(*catch_context_map());
794 Handle<Context> context = Handle<Context>::cast(array); 794 Handle<Context> context = Handle<Context>::cast(array);
795 context->set_closure(*function); 795 context->set_closure(*function);
796 context->set_previous(*previous); 796 context->set_previous(*previous);
797 context->set_extension(*name); 797 context->set_extension(*name);
798 context->set_native_context(previous->native_context()); 798 context->set_native_context(previous->native_context());
799 context->set(Context::THROWN_OBJECT_INDEX, *thrown_object); 799 context->set(Context::THROWN_OBJECT_INDEX, *thrown_object);
800 return context; 800 return context;
801 } 801 }
802 802
803 Handle<Context> Factory::NewDebugEvaluateContext(Handle<Context> previous,
804 Handle<JSReceiver> extension,
805 Handle<Context> wrapped,
806 Handle<StringSet> whitelist) {
807 STATIC_ASSERT(Context::WHITE_LIST_INDEX == Context::MIN_CONTEXT_SLOTS + 1);
808 Handle<FixedArray> array = NewFixedArray(Context::MIN_CONTEXT_SLOTS + 2);
809 array->set_map_no_write_barrier(*debug_evaluate_context_map());
810 Handle<Context> c = Handle<Context>::cast(array);
811 c->set_closure(wrapped.is_null() ? previous->closure() : wrapped->closure());
812 c->set_previous(*previous);
813 c->set_native_context(previous->native_context());
814 if (!extension.is_null()) c->set(Context::EXTENSION_INDEX, *extension);
815 if (!wrapped.is_null()) c->set(Context::WRAPPED_CONTEXT_INDEX, *wrapped);
816 if (!whitelist.is_null()) c->set(Context::WHITE_LIST_INDEX, *whitelist);
817 return c;
818 }
803 819
804 Handle<Context> Factory::NewWithContext(Handle<JSFunction> function, 820 Handle<Context> Factory::NewWithContext(Handle<JSFunction> function,
805 Handle<Context> previous, 821 Handle<Context> previous,
806 Handle<JSReceiver> extension) { 822 Handle<JSReceiver> extension) {
807 Handle<FixedArray> array = NewFixedArray(Context::MIN_CONTEXT_SLOTS); 823 Handle<FixedArray> array = NewFixedArray(Context::MIN_CONTEXT_SLOTS);
808 array->set_map_no_write_barrier(*with_context_map()); 824 array->set_map_no_write_barrier(*with_context_map());
809 Handle<Context> context = Handle<Context>::cast(array); 825 Handle<Context> context = Handle<Context>::cast(array);
810 context->set_closure(*function); 826 context->set_closure(*function);
811 context->set_previous(*previous); 827 context->set_previous(*previous);
812 context->set_extension(*extension); 828 context->set_extension(*extension);
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after
2355 } 2371 }
2356 2372
2357 2373
2358 Handle<Object> Factory::ToBoolean(bool value) { 2374 Handle<Object> Factory::ToBoolean(bool value) {
2359 return value ? true_value() : false_value(); 2375 return value ? true_value() : false_value();
2360 } 2376 }
2361 2377
2362 2378
2363 } // namespace internal 2379 } // namespace internal
2364 } // namespace v8 2380 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698