Chromium Code Reviews| 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 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 866 | 866 |
| 867 Handle<ByteArray> Factory::NewByteArray(int length, PretenureFlag pretenure) { | 867 Handle<ByteArray> Factory::NewByteArray(int length, PretenureFlag pretenure) { |
| 868 DCHECK(0 <= length); | 868 DCHECK(0 <= length); |
| 869 CALL_HEAP_FUNCTION( | 869 CALL_HEAP_FUNCTION( |
| 870 isolate(), | 870 isolate(), |
| 871 isolate()->heap()->AllocateByteArray(length, pretenure), | 871 isolate()->heap()->AllocateByteArray(length, pretenure), |
| 872 ByteArray); | 872 ByteArray); |
| 873 } | 873 } |
| 874 | 874 |
| 875 | 875 |
| 876 Handle<BytecodeArray> Factory::NewBytecodeArray(int length, const byte* start, | |
| 877 PretenureFlag pretenure) { | |
| 878 DCHECK(0 <= length); | |
| 879 CALL_HEAP_FUNCTION(isolate(), isolate()->heap()->AllocateBytecodeArray( | |
| 880 length, start, pretenure), | |
|
rmcilroy
2015/07/15 13:33:37
strange indentation here - did you run "git cl for
oth
2015/07/16 09:15:49
Done. git cl bogon.
| |
| 881 BytecodeArray); | |
| 882 } | |
| 883 | |
| 884 | |
| 876 Handle<ExternalArray> Factory::NewExternalArray(int length, | 885 Handle<ExternalArray> Factory::NewExternalArray(int length, |
| 877 ExternalArrayType array_type, | 886 ExternalArrayType array_type, |
| 878 void* external_pointer, | 887 void* external_pointer, |
| 879 PretenureFlag pretenure) { | 888 PretenureFlag pretenure) { |
| 880 DCHECK(0 <= length && length <= Smi::kMaxValue); | 889 DCHECK(0 <= length && length <= Smi::kMaxValue); |
| 881 CALL_HEAP_FUNCTION( | 890 CALL_HEAP_FUNCTION( |
| 882 isolate(), | 891 isolate(), |
| 883 isolate()->heap()->AllocateExternalArray(length, | 892 isolate()->heap()->AllocateExternalArray(length, |
| 884 array_type, | 893 array_type, |
| 885 external_pointer, | 894 external_pointer, |
| (...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2173 share->set_construct_stub(construct_stub); | 2182 share->set_construct_stub(construct_stub); |
| 2174 share->set_instance_class_name(*Object_string()); | 2183 share->set_instance_class_name(*Object_string()); |
| 2175 share->set_function_data(*undefined_value(), SKIP_WRITE_BARRIER); | 2184 share->set_function_data(*undefined_value(), SKIP_WRITE_BARRIER); |
| 2176 share->set_script(*undefined_value(), SKIP_WRITE_BARRIER); | 2185 share->set_script(*undefined_value(), SKIP_WRITE_BARRIER); |
| 2177 share->set_debug_info(*undefined_value(), SKIP_WRITE_BARRIER); | 2186 share->set_debug_info(*undefined_value(), SKIP_WRITE_BARRIER); |
| 2178 share->set_inferred_name(*empty_string(), SKIP_WRITE_BARRIER); | 2187 share->set_inferred_name(*empty_string(), SKIP_WRITE_BARRIER); |
| 2179 FeedbackVectorSpec empty_spec(0); | 2188 FeedbackVectorSpec empty_spec(0); |
| 2180 Handle<TypeFeedbackVector> feedback_vector = | 2189 Handle<TypeFeedbackVector> feedback_vector = |
| 2181 NewTypeFeedbackVector(&empty_spec); | 2190 NewTypeFeedbackVector(&empty_spec); |
| 2182 share->set_feedback_vector(*feedback_vector, SKIP_WRITE_BARRIER); | 2191 share->set_feedback_vector(*feedback_vector, SKIP_WRITE_BARRIER); |
| 2192 share->set_bytecode_array(*empty_bytecode_array(), SKIP_WRITE_BARRIER); | |
| 2183 #if TRACE_MAPS | 2193 #if TRACE_MAPS |
| 2184 share->set_unique_id(isolate()->GetNextUniqueSharedFunctionInfoId()); | 2194 share->set_unique_id(isolate()->GetNextUniqueSharedFunctionInfoId()); |
| 2185 #endif | 2195 #endif |
| 2186 share->set_profiler_ticks(0); | 2196 share->set_profiler_ticks(0); |
| 2187 share->set_ast_node_count(0); | 2197 share->set_ast_node_count(0); |
| 2188 share->set_counters(0); | 2198 share->set_counters(0); |
| 2189 | 2199 |
| 2190 // Set integer fields (smi or int, depending on the architecture). | 2200 // Set integer fields (smi or int, depending on the architecture). |
| 2191 share->set_length(0); | 2201 share->set_length(0); |
| 2192 share->set_internal_formal_parameter_count(0); | 2202 share->set_internal_formal_parameter_count(0); |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2431 } | 2441 } |
| 2432 | 2442 |
| 2433 | 2443 |
| 2434 Handle<Object> Factory::ToBoolean(bool value) { | 2444 Handle<Object> Factory::ToBoolean(bool value) { |
| 2435 return value ? true_value() : false_value(); | 2445 return value ? true_value() : false_value(); |
| 2436 } | 2446 } |
| 2437 | 2447 |
| 2438 | 2448 |
| 2439 } // namespace internal | 2449 } // namespace internal |
| 2440 } // namespace v8 | 2450 } // namespace v8 |
| OLD | NEW |