| 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 2067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2078 Handle<String> name, int number_of_literals, FunctionKind kind, | 2078 Handle<String> name, int number_of_literals, FunctionKind kind, |
| 2079 Handle<Code> code, Handle<ScopeInfo> scope_info) { | 2079 Handle<Code> code, Handle<ScopeInfo> scope_info) { |
| 2080 DCHECK(IsValidFunctionKind(kind)); | 2080 DCHECK(IsValidFunctionKind(kind)); |
| 2081 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo( | 2081 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo( |
| 2082 name, code, IsConstructable(kind, scope_info->language_mode())); | 2082 name, code, IsConstructable(kind, scope_info->language_mode())); |
| 2083 shared->set_scope_info(*scope_info); | 2083 shared->set_scope_info(*scope_info); |
| 2084 shared->set_kind(kind); | 2084 shared->set_kind(kind); |
| 2085 shared->set_num_literals(number_of_literals); | 2085 shared->set_num_literals(number_of_literals); |
| 2086 if (IsGeneratorFunction(kind)) { | 2086 if (IsGeneratorFunction(kind)) { |
| 2087 shared->set_instance_class_name(isolate()->heap()->Generator_string()); | 2087 shared->set_instance_class_name(isolate()->heap()->Generator_string()); |
| 2088 shared->DisableOptimization(kGenerator); | |
| 2089 } | |
| 2090 if (IsAsyncFunction(kind)) { | |
| 2091 // TODO(caitp): Enable optimization of async functions when they are enabled | |
| 2092 // for generators functions. | |
| 2093 shared->DisableOptimization(kGenerator); | |
| 2094 } | 2088 } |
| 2095 return shared; | 2089 return shared; |
| 2096 } | 2090 } |
| 2097 | 2091 |
| 2098 | 2092 |
| 2099 Handle<JSMessageObject> Factory::NewJSMessageObject( | 2093 Handle<JSMessageObject> Factory::NewJSMessageObject( |
| 2100 MessageTemplate::Template message, Handle<Object> argument, | 2094 MessageTemplate::Template message, Handle<Object> argument, |
| 2101 int start_position, int end_position, Handle<Object> script, | 2095 int start_position, int end_position, Handle<Object> script, |
| 2102 Handle<Object> stack_frames) { | 2096 Handle<Object> stack_frames) { |
| 2103 Handle<Map> map = message_object_map(); | 2097 Handle<Map> map = message_object_map(); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2395 } | 2389 } |
| 2396 | 2390 |
| 2397 | 2391 |
| 2398 Handle<Object> Factory::ToBoolean(bool value) { | 2392 Handle<Object> Factory::ToBoolean(bool value) { |
| 2399 return value ? true_value() : false_value(); | 2393 return value ? true_value() : false_value(); |
| 2400 } | 2394 } |
| 2401 | 2395 |
| 2402 | 2396 |
| 2403 } // namespace internal | 2397 } // namespace internal |
| 2404 } // namespace v8 | 2398 } // namespace v8 |
| OLD | NEW |