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/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 2156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2167 if (obj->remove_prototype()) { | 2167 if (obj->remove_prototype()) { |
2168 DCHECK(result->shared()->IsApiFunction()); | 2168 DCHECK(result->shared()->IsApiFunction()); |
2169 DCHECK(!result->has_initial_map()); | 2169 DCHECK(!result->has_initial_map()); |
2170 DCHECK(!result->has_prototype()); | 2170 DCHECK(!result->has_prototype()); |
2171 return result; | 2171 return result; |
2172 } | 2172 } |
2173 | 2173 |
2174 if (prototype->IsTheHole()) { | 2174 if (prototype->IsTheHole()) { |
2175 #ifdef DEBUG | 2175 #ifdef DEBUG |
2176 LookupIterator it(handle(JSObject::cast(result->prototype())), | 2176 LookupIterator it(handle(JSObject::cast(result->prototype())), |
2177 constructor_string(), LookupIterator::CHECK_PROPERTY); | 2177 constructor_string(), LookupIterator::OWN_PROPERTY); |
2178 MaybeHandle<Object> maybe_prop = Object::GetProperty(&it); | 2178 MaybeHandle<Object> maybe_prop = Object::GetProperty(&it); |
2179 DCHECK(it.IsFound()); | 2179 DCHECK(it.IsFound()); |
2180 DCHECK(maybe_prop.ToHandleChecked().is_identical_to(result)); | 2180 DCHECK(maybe_prop.ToHandleChecked().is_identical_to(result)); |
2181 #endif | 2181 #endif |
2182 } else { | 2182 } else { |
2183 JSObject::AddProperty(handle(JSObject::cast(result->prototype())), | 2183 JSObject::AddProperty(handle(JSObject::cast(result->prototype())), |
2184 constructor_string(), result, DONT_ENUM); | 2184 constructor_string(), result, DONT_ENUM); |
2185 } | 2185 } |
2186 | 2186 |
2187 // Down from here is only valid for API functions that can be used as a | 2187 // Down from here is only valid for API functions that can be used as a |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2379 return Handle<Object>::null(); | 2379 return Handle<Object>::null(); |
2380 } | 2380 } |
2381 | 2381 |
2382 | 2382 |
2383 Handle<Object> Factory::ToBoolean(bool value) { | 2383 Handle<Object> Factory::ToBoolean(bool value) { |
2384 return value ? true_value() : false_value(); | 2384 return value ? true_value() : false_value(); |
2385 } | 2385 } |
2386 | 2386 |
2387 | 2387 |
2388 } } // namespace v8::internal | 2388 } } // namespace v8::internal |
OLD | NEW |