| 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 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2035 object->synchronized_set_map(*map); | 2035 object->synchronized_set_map(*map); |
| 2036 | 2036 |
| 2037 Heap* heap = isolate()->heap(); | 2037 Heap* heap = isolate()->heap(); |
| 2038 // Reinitialize the object from the constructor map. | 2038 // Reinitialize the object from the constructor map. |
| 2039 heap->InitializeJSObjectFromMap(*object, *properties, *map); | 2039 heap->InitializeJSObjectFromMap(*object, *properties, *map); |
| 2040 | 2040 |
| 2041 // Restore the saved hash. | 2041 // Restore the saved hash. |
| 2042 object->set_hash(*hash); | 2042 object->set_hash(*hash); |
| 2043 } | 2043 } |
| 2044 | 2044 |
| 2045 | |
| 2046 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( | 2045 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( |
| 2047 Handle<String> name, int number_of_literals, FunctionKind kind, | 2046 Handle<String> name, int number_of_literals, FunctionKind kind, |
| 2048 Handle<Code> code, Handle<ScopeInfo> scope_info, | 2047 Handle<Code> code, Handle<ScopeInfo> scope_info) { |
| 2049 Handle<TypeFeedbackVector> feedback_vector) { | |
| 2050 DCHECK(IsValidFunctionKind(kind)); | 2048 DCHECK(IsValidFunctionKind(kind)); |
| 2051 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo( | 2049 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo( |
| 2052 name, code, IsConstructable(kind, scope_info->language_mode())); | 2050 name, code, IsConstructable(kind, scope_info->language_mode())); |
| 2053 shared->set_scope_info(*scope_info); | 2051 shared->set_scope_info(*scope_info); |
| 2054 shared->set_feedback_vector(*feedback_vector); | |
| 2055 shared->set_kind(kind); | 2052 shared->set_kind(kind); |
| 2056 shared->set_num_literals(number_of_literals); | 2053 shared->set_num_literals(number_of_literals); |
| 2057 if (IsGeneratorFunction(kind)) { | 2054 if (IsGeneratorFunction(kind)) { |
| 2058 shared->set_instance_class_name(isolate()->heap()->Generator_string()); | 2055 shared->set_instance_class_name(isolate()->heap()->Generator_string()); |
| 2059 shared->DisableOptimization(kGenerator); | 2056 shared->DisableOptimization(kGenerator); |
| 2060 } | 2057 } |
| 2061 return shared; | 2058 return shared; |
| 2062 } | 2059 } |
| 2063 | 2060 |
| 2064 | 2061 |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2358 } | 2355 } |
| 2359 | 2356 |
| 2360 | 2357 |
| 2361 Handle<Object> Factory::ToBoolean(bool value) { | 2358 Handle<Object> Factory::ToBoolean(bool value) { |
| 2362 return value ? true_value() : false_value(); | 2359 return value ? true_value() : false_value(); |
| 2363 } | 2360 } |
| 2364 | 2361 |
| 2365 | 2362 |
| 2366 } // namespace internal | 2363 } // namespace internal |
| 2367 } // namespace v8 | 2364 } // namespace v8 |
| OLD | NEW |