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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 | 880 |
881 Handle<ByteArray> Factory::NewByteArray(int length, PretenureFlag pretenure) { | 881 Handle<ByteArray> Factory::NewByteArray(int length, PretenureFlag pretenure) { |
882 DCHECK(0 <= length); | 882 DCHECK(0 <= length); |
883 CALL_HEAP_FUNCTION( | 883 CALL_HEAP_FUNCTION( |
884 isolate(), | 884 isolate(), |
885 isolate()->heap()->AllocateByteArray(length, pretenure), | 885 isolate()->heap()->AllocateByteArray(length, pretenure), |
886 ByteArray); | 886 ByteArray); |
887 } | 887 } |
888 | 888 |
889 | 889 |
890 Handle<BytecodeArray> Factory::NewBytecodeArray(int length, | 890 Handle<BytecodeArray> Factory::NewBytecodeArray( |
891 const byte* raw_bytecodes, | 891 int length, const byte* raw_bytecodes, int frame_size, int parameter_count, |
892 int frame_size, | 892 Handle<FixedArray> constant_pool) { |
893 int parameter_count) { | |
894 DCHECK(0 <= length); | 893 DCHECK(0 <= length); |
895 CALL_HEAP_FUNCTION(isolate(), | 894 CALL_HEAP_FUNCTION(isolate(), isolate()->heap()->AllocateBytecodeArray( |
896 isolate()->heap()->AllocateBytecodeArray( | 895 length, raw_bytecodes, frame_size, |
897 length, raw_bytecodes, frame_size, parameter_count), | 896 parameter_count, *constant_pool), |
898 BytecodeArray); | 897 BytecodeArray); |
899 } | 898 } |
900 | 899 |
901 | 900 |
902 Handle<FixedTypedArrayBase> Factory::NewFixedTypedArrayWithExternalPointer( | 901 Handle<FixedTypedArrayBase> Factory::NewFixedTypedArrayWithExternalPointer( |
903 int length, ExternalArrayType array_type, void* external_pointer, | 902 int length, ExternalArrayType array_type, void* external_pointer, |
904 PretenureFlag pretenure) { | 903 PretenureFlag pretenure) { |
905 DCHECK(0 <= length && length <= Smi::kMaxValue); | 904 DCHECK(0 <= length && length <= Smi::kMaxValue); |
906 CALL_HEAP_FUNCTION( | 905 CALL_HEAP_FUNCTION( |
907 isolate(), isolate()->heap()->AllocateFixedTypedArrayWithExternalPointer( | 906 isolate(), isolate()->heap()->AllocateFixedTypedArrayWithExternalPointer( |
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2333 } | 2332 } |
2334 | 2333 |
2335 | 2334 |
2336 Handle<Object> Factory::ToBoolean(bool value) { | 2335 Handle<Object> Factory::ToBoolean(bool value) { |
2337 return value ? true_value() : false_value(); | 2336 return value ? true_value() : false_value(); |
2338 } | 2337 } |
2339 | 2338 |
2340 | 2339 |
2341 } // namespace internal | 2340 } // namespace internal |
2342 } // namespace v8 | 2341 } // namespace v8 |
OLD | NEW |