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 2122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2133 Handle<Map> map = shared_function_info_map(); | 2133 Handle<Map> map = shared_function_info_map(); |
2134 Handle<SharedFunctionInfo> share = New<SharedFunctionInfo>(map, OLD_SPACE); | 2134 Handle<SharedFunctionInfo> share = New<SharedFunctionInfo>(map, OLD_SPACE); |
2135 | 2135 |
2136 // Set pointer fields. | 2136 // Set pointer fields. |
2137 share->set_name(*name); | 2137 share->set_name(*name); |
2138 Handle<Code> code; | 2138 Handle<Code> code; |
2139 if (!maybe_code.ToHandle(&code)) { | 2139 if (!maybe_code.ToHandle(&code)) { |
2140 code = handle(isolate()->builtins()->builtin(Builtins::kIllegal)); | 2140 code = handle(isolate()->builtins()->builtin(Builtins::kIllegal)); |
2141 } | 2141 } |
2142 share->set_code(*code); | 2142 share->set_code(*code); |
2143 share->set_optimized_code_map(Smi::FromInt(0)); | 2143 share->set_optimized_code_map(*cleared_optimized_code_map()); |
2144 share->set_scope_info(ScopeInfo::Empty(isolate())); | 2144 share->set_scope_info(ScopeInfo::Empty(isolate())); |
2145 Code* construct_stub = | 2145 Code* construct_stub = |
2146 isolate()->builtins()->builtin(Builtins::kJSConstructStubGeneric); | 2146 isolate()->builtins()->builtin(Builtins::kJSConstructStubGeneric); |
2147 share->set_construct_stub(construct_stub); | 2147 share->set_construct_stub(construct_stub); |
2148 share->set_instance_class_name(*Object_string()); | 2148 share->set_instance_class_name(*Object_string()); |
2149 share->set_function_data(*undefined_value(), SKIP_WRITE_BARRIER); | 2149 share->set_function_data(*undefined_value(), SKIP_WRITE_BARRIER); |
2150 share->set_script(*undefined_value(), SKIP_WRITE_BARRIER); | 2150 share->set_script(*undefined_value(), SKIP_WRITE_BARRIER); |
2151 share->set_debug_info(*undefined_value(), SKIP_WRITE_BARRIER); | 2151 share->set_debug_info(*undefined_value(), SKIP_WRITE_BARRIER); |
2152 share->set_inferred_name(*empty_string(), SKIP_WRITE_BARRIER); | 2152 share->set_inferred_name(*empty_string(), SKIP_WRITE_BARRIER); |
2153 StaticFeedbackVectorSpec empty_spec; | 2153 StaticFeedbackVectorSpec empty_spec; |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2403 } | 2403 } |
2404 | 2404 |
2405 | 2405 |
2406 Handle<Object> Factory::ToBoolean(bool value) { | 2406 Handle<Object> Factory::ToBoolean(bool value) { |
2407 return value ? true_value() : false_value(); | 2407 return value ? true_value() : false_value(); |
2408 } | 2408 } |
2409 | 2409 |
2410 | 2410 |
2411 } // namespace internal | 2411 } // namespace internal |
2412 } // namespace v8 | 2412 } // namespace v8 |
OLD | NEW |