| 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 "factory.h" | 5 #include "factory.h" |
| 6 | 6 |
| 7 #include "conversions.h" | 7 #include "conversions.h" |
| 8 #include "isolate-inl.h" | 8 #include "isolate-inl.h" |
| 9 #include "macro-assembler.h" | 9 #include "macro-assembler.h" |
| 10 | 10 |
| (...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 // Each function prototype gets a fresh map to avoid unwanted sharing of | 1287 // Each function prototype gets a fresh map to avoid unwanted sharing of |
| 1288 // maps between prototypes of different constructors. | 1288 // maps between prototypes of different constructors. |
| 1289 Handle<JSFunction> object_function(native_context->object_function()); | 1289 Handle<JSFunction> object_function(native_context->object_function()); |
| 1290 ASSERT(object_function->has_initial_map()); | 1290 ASSERT(object_function->has_initial_map()); |
| 1291 new_map = Map::Copy(handle(object_function->initial_map())); | 1291 new_map = Map::Copy(handle(object_function->initial_map())); |
| 1292 } | 1292 } |
| 1293 | 1293 |
| 1294 Handle<JSObject> prototype = NewJSObjectFromMap(new_map); | 1294 Handle<JSObject> prototype = NewJSObjectFromMap(new_map); |
| 1295 | 1295 |
| 1296 if (!function->shared()->is_generator()) { | 1296 if (!function->shared()->is_generator()) { |
| 1297 JSObject::SetLocalPropertyIgnoreAttributes(prototype, | 1297 JSObject::SetOwnPropertyIgnoreAttributes(prototype, |
| 1298 constructor_string(), | 1298 constructor_string(), |
| 1299 function, | 1299 function, |
| 1300 DONT_ENUM).Assert(); | 1300 DONT_ENUM).Assert(); |
| 1301 } | 1301 } |
| 1302 | 1302 |
| 1303 return prototype; | 1303 return prototype; |
| 1304 } | 1304 } |
| 1305 | 1305 |
| 1306 | 1306 |
| 1307 Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo( | 1307 Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo( |
| 1308 Handle<SharedFunctionInfo> info, | 1308 Handle<SharedFunctionInfo> info, |
| 1309 Handle<Context> context, | 1309 Handle<Context> context, |
| 1310 PretenureFlag pretenure) { | 1310 PretenureFlag pretenure) { |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2124 result->shared()->set_construct_stub(*construct_stub); | 2124 result->shared()->set_construct_stub(*construct_stub); |
| 2125 result->shared()->DontAdaptArguments(); | 2125 result->shared()->DontAdaptArguments(); |
| 2126 | 2126 |
| 2127 if (obj->remove_prototype()) { | 2127 if (obj->remove_prototype()) { |
| 2128 ASSERT(result->shared()->IsApiFunction()); | 2128 ASSERT(result->shared()->IsApiFunction()); |
| 2129 ASSERT(!result->has_initial_map()); | 2129 ASSERT(!result->has_initial_map()); |
| 2130 ASSERT(!result->has_prototype()); | 2130 ASSERT(!result->has_prototype()); |
| 2131 return result; | 2131 return result; |
| 2132 } | 2132 } |
| 2133 | 2133 |
| 2134 JSObject::SetLocalPropertyIgnoreAttributes( | 2134 JSObject::SetOwnPropertyIgnoreAttributes( |
| 2135 handle(JSObject::cast(result->prototype())), | 2135 handle(JSObject::cast(result->prototype())), |
| 2136 constructor_string(), | 2136 constructor_string(), |
| 2137 result, | 2137 result, |
| 2138 DONT_ENUM).Assert(); | 2138 DONT_ENUM).Assert(); |
| 2139 | 2139 |
| 2140 // Down from here is only valid for API functions that can be used as a | 2140 // Down from here is only valid for API functions that can be used as a |
| 2141 // constructor (don't set the "remove prototype" flag). | 2141 // constructor (don't set the "remove prototype" flag). |
| 2142 | 2142 |
| 2143 Handle<Map> map(result->initial_map()); | 2143 Handle<Map> map(result->initial_map()); |
| 2144 | 2144 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2332 return Handle<Object>::null(); | 2332 return Handle<Object>::null(); |
| 2333 } | 2333 } |
| 2334 | 2334 |
| 2335 | 2335 |
| 2336 Handle<Object> Factory::ToBoolean(bool value) { | 2336 Handle<Object> Factory::ToBoolean(bool value) { |
| 2337 return value ? true_value() : false_value(); | 2337 return value ? true_value() : false_value(); |
| 2338 } | 2338 } |
| 2339 | 2339 |
| 2340 | 2340 |
| 2341 } } // namespace v8::internal | 2341 } } // namespace v8::internal |
| OLD | NEW |