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

Side by Side Diff: src/factory.cc

Issue 1584243002: Don't pre-initialise block contexts with holes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adapt Turbofan Created 4 years, 11 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/compiler/js-typed-lowering.cc ('k') | test/mjsunit/harmony/regress/regress-crbug-571149.js » ('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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | test/mjsunit/harmony/regress/regress-crbug-571149.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698