| 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 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2109 return message_obj; | 2109 return message_obj; |
| 2110 } | 2110 } |
| 2111 | 2111 |
| 2112 | 2112 |
| 2113 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( | 2113 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( |
| 2114 Handle<String> name, MaybeHandle<Code> maybe_code, bool is_constructor) { | 2114 Handle<String> name, MaybeHandle<Code> maybe_code, bool is_constructor) { |
| 2115 Handle<Map> map = shared_function_info_map(); | 2115 Handle<Map> map = shared_function_info_map(); |
| 2116 Handle<SharedFunctionInfo> share = New<SharedFunctionInfo>(map, OLD_SPACE); | 2116 Handle<SharedFunctionInfo> share = New<SharedFunctionInfo>(map, OLD_SPACE); |
| 2117 | 2117 |
| 2118 // Set pointer fields. | 2118 // Set pointer fields. |
| 2119 name = String::Flatten(name, TENURED); |
| 2119 share->set_name(*name); | 2120 share->set_name(*name); |
| 2120 Handle<Code> code; | 2121 Handle<Code> code; |
| 2121 if (!maybe_code.ToHandle(&code)) { | 2122 if (!maybe_code.ToHandle(&code)) { |
| 2122 code = isolate()->builtins()->Illegal(); | 2123 code = isolate()->builtins()->Illegal(); |
| 2123 } | 2124 } |
| 2124 share->set_code(*code); | 2125 share->set_code(*code); |
| 2125 share->set_optimized_code_map(*cleared_optimized_code_map()); | 2126 share->set_optimized_code_map(*cleared_optimized_code_map()); |
| 2126 share->set_scope_info(ScopeInfo::Empty(isolate())); | 2127 share->set_scope_info(ScopeInfo::Empty(isolate())); |
| 2127 Handle<Code> construct_stub = | 2128 Handle<Code> construct_stub = |
| 2128 is_constructor ? isolate()->builtins()->JSConstructStubGeneric() | 2129 is_constructor ? isolate()->builtins()->JSConstructStubGeneric() |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2390 } | 2391 } |
| 2391 | 2392 |
| 2392 | 2393 |
| 2393 Handle<Object> Factory::ToBoolean(bool value) { | 2394 Handle<Object> Factory::ToBoolean(bool value) { |
| 2394 return value ? true_value() : false_value(); | 2395 return value ? true_value() : false_value(); |
| 2395 } | 2396 } |
| 2396 | 2397 |
| 2397 | 2398 |
| 2398 } // namespace internal | 2399 } // namespace internal |
| 2399 } // namespace v8 | 2400 } // namespace v8 |
| OLD | NEW |