| 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 shared->set_num_literals(number_of_literals); | 2133 shared->set_num_literals(number_of_literals); |
| 2134 if (IsGeneratorFunction(kind)) { | 2134 if (IsGeneratorFunction(kind)) { |
| 2135 shared->set_instance_class_name(isolate()->heap()->Generator_string()); | 2135 shared->set_instance_class_name(isolate()->heap()->Generator_string()); |
| 2136 shared->DisableOptimization(kGenerator); | 2136 shared->DisableOptimization(kGenerator); |
| 2137 } | 2137 } |
| 2138 return shared; | 2138 return shared; |
| 2139 } | 2139 } |
| 2140 | 2140 |
| 2141 | 2141 |
| 2142 Handle<JSMessageObject> Factory::NewJSMessageObject( | 2142 Handle<JSMessageObject> Factory::NewJSMessageObject( |
| 2143 Handle<String> type, | 2143 MessageTemplate::Template message, Handle<Object> argument, |
| 2144 Handle<JSArray> arguments, | 2144 int start_position, int end_position, Handle<Object> script, |
| 2145 int start_position, | |
| 2146 int end_position, | |
| 2147 Handle<Object> script, | |
| 2148 Handle<Object> stack_frames) { | 2145 Handle<Object> stack_frames) { |
| 2149 Handle<Map> map = message_object_map(); | 2146 Handle<Map> map = message_object_map(); |
| 2150 Handle<JSMessageObject> message = New<JSMessageObject>(map, NEW_SPACE); | 2147 Handle<JSMessageObject> message_obj = New<JSMessageObject>(map, NEW_SPACE); |
| 2151 message->set_properties(*empty_fixed_array(), SKIP_WRITE_BARRIER); | 2148 message_obj->set_properties(*empty_fixed_array(), SKIP_WRITE_BARRIER); |
| 2152 message->initialize_elements(); | 2149 message_obj->initialize_elements(); |
| 2153 message->set_elements(*empty_fixed_array(), SKIP_WRITE_BARRIER); | 2150 message_obj->set_elements(*empty_fixed_array(), SKIP_WRITE_BARRIER); |
| 2154 message->set_type(*type); | 2151 message_obj->set_type(message); |
| 2155 message->set_arguments(*arguments); | 2152 message_obj->set_argument(*argument); |
| 2156 message->set_start_position(start_position); | 2153 message_obj->set_start_position(start_position); |
| 2157 message->set_end_position(end_position); | 2154 message_obj->set_end_position(end_position); |
| 2158 message->set_script(*script); | 2155 message_obj->set_script(*script); |
| 2159 message->set_stack_frames(*stack_frames); | 2156 message_obj->set_stack_frames(*stack_frames); |
| 2160 return message; | 2157 return message_obj; |
| 2161 } | 2158 } |
| 2162 | 2159 |
| 2163 | 2160 |
| 2164 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( | 2161 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( |
| 2165 Handle<String> name, | 2162 Handle<String> name, |
| 2166 MaybeHandle<Code> maybe_code) { | 2163 MaybeHandle<Code> maybe_code) { |
| 2167 Handle<Map> map = shared_function_info_map(); | 2164 Handle<Map> map = shared_function_info_map(); |
| 2168 Handle<SharedFunctionInfo> share = New<SharedFunctionInfo>(map, OLD_SPACE); | 2165 Handle<SharedFunctionInfo> share = New<SharedFunctionInfo>(map, OLD_SPACE); |
| 2169 | 2166 |
| 2170 // Set pointer fields. | 2167 // Set pointer fields. |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2425 return Handle<Object>::null(); | 2422 return Handle<Object>::null(); |
| 2426 } | 2423 } |
| 2427 | 2424 |
| 2428 | 2425 |
| 2429 Handle<Object> Factory::ToBoolean(bool value) { | 2426 Handle<Object> Factory::ToBoolean(bool value) { |
| 2430 return value ? true_value() : false_value(); | 2427 return value ? true_value() : false_value(); |
| 2431 } | 2428 } |
| 2432 | 2429 |
| 2433 | 2430 |
| 2434 } } // namespace v8::internal | 2431 } } // namespace v8::internal |
| OLD | NEW |