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

Side by Side Diff: src/factory.cc

Issue 1516433005: [contexts] Place the initial JSArray maps on the native context directly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment. Created 5 years 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/crankshaft/hydrogen.cc ('k') | src/ia32/macro-assembler-ia32.cc » ('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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 return symbol; 719 return symbol;
720 } 720 }
721 721
722 722
723 Handle<Context> Factory::NewNativeContext() { 723 Handle<Context> Factory::NewNativeContext() {
724 Handle<FixedArray> array = 724 Handle<FixedArray> array =
725 NewFixedArray(Context::NATIVE_CONTEXT_SLOTS, TENURED); 725 NewFixedArray(Context::NATIVE_CONTEXT_SLOTS, TENURED);
726 array->set_map_no_write_barrier(*native_context_map()); 726 array->set_map_no_write_barrier(*native_context_map());
727 Handle<Context> context = Handle<Context>::cast(array); 727 Handle<Context> context = Handle<Context>::cast(array);
728 context->set_native_context(*context); 728 context->set_native_context(*context);
729 context->set_js_array_maps(*undefined_value());
730 context->set_errors_thrown(Smi::FromInt(0)); 729 context->set_errors_thrown(Smi::FromInt(0));
731 Handle<WeakCell> weak_cell = NewWeakCell(context); 730 Handle<WeakCell> weak_cell = NewWeakCell(context);
732 context->set_self_weak_cell(*weak_cell); 731 context->set_self_weak_cell(*weak_cell);
733 DCHECK(context->IsNativeContext()); 732 DCHECK(context->IsNativeContext());
734 return context; 733 return context;
735 } 734 }
736 735
737 736
738 Handle<Context> Factory::NewScriptContext(Handle<JSFunction> function, 737 Handle<Context> Factory::NewScriptContext(Handle<JSFunction> function,
739 Handle<ScopeInfo> scope_info) { 738 Handle<ScopeInfo> scope_info) {
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after
2321 } 2320 }
2322 2321
2323 2322
2324 Handle<Object> Factory::ToBoolean(bool value) { 2323 Handle<Object> Factory::ToBoolean(bool value) {
2325 return value ? true_value() : false_value(); 2324 return value ? true_value() : false_value();
2326 } 2325 }
2327 2326
2328 2327
2329 } // namespace internal 2328 } // namespace internal
2330 } // namespace v8 2329 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698