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/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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 | 846 |
847 | 847 |
848 Handle<Struct> Factory::NewStruct(InstanceType type) { | 848 Handle<Struct> Factory::NewStruct(InstanceType type) { |
849 CALL_HEAP_FUNCTION( | 849 CALL_HEAP_FUNCTION( |
850 isolate(), | 850 isolate(), |
851 isolate()->heap()->AllocateStruct(type), | 851 isolate()->heap()->AllocateStruct(type), |
852 Struct); | 852 Struct); |
853 } | 853 } |
854 | 854 |
855 | 855 |
856 Handle<CodeCache> Factory::NewCodeCache() { | |
857 Handle<CodeCache> code_cache = | |
858 Handle<CodeCache>::cast(NewStruct(CODE_CACHE_TYPE)); | |
859 code_cache->set_default_cache(*empty_fixed_array(), SKIP_WRITE_BARRIER); | |
860 code_cache->set_normal_type_cache(*undefined_value(), SKIP_WRITE_BARRIER); | |
861 return code_cache; | |
862 } | |
863 | |
864 | |
865 Handle<AliasedArgumentsEntry> Factory::NewAliasedArgumentsEntry( | 856 Handle<AliasedArgumentsEntry> Factory::NewAliasedArgumentsEntry( |
866 int aliased_context_slot) { | 857 int aliased_context_slot) { |
867 Handle<AliasedArgumentsEntry> entry = Handle<AliasedArgumentsEntry>::cast( | 858 Handle<AliasedArgumentsEntry> entry = Handle<AliasedArgumentsEntry>::cast( |
868 NewStruct(ALIASED_ARGUMENTS_ENTRY_TYPE)); | 859 NewStruct(ALIASED_ARGUMENTS_ENTRY_TYPE)); |
869 entry->set_aliased_context_slot(aliased_context_slot); | 860 entry->set_aliased_context_slot(aliased_context_slot); |
870 return entry; | 861 return entry; |
871 } | 862 } |
872 | 863 |
873 | 864 |
874 Handle<AccessorInfo> Factory::NewAccessorInfo() { | 865 Handle<AccessorInfo> Factory::NewAccessorInfo() { |
(...skipping 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2371 } | 2362 } |
2372 | 2363 |
2373 | 2364 |
2374 Handle<Object> Factory::ToBoolean(bool value) { | 2365 Handle<Object> Factory::ToBoolean(bool value) { |
2375 return value ? true_value() : false_value(); | 2366 return value ? true_value() : false_value(); |
2376 } | 2367 } |
2377 | 2368 |
2378 | 2369 |
2379 } // namespace internal | 2370 } // namespace internal |
2380 } // namespace v8 | 2371 } // namespace v8 |
OLD | NEW |