OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/api-natives.h" | 5 #include "src/api-natives.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/isolate-inl.h" | 8 #include "src/isolate-inl.h" |
9 #include "src/lookup.h" | 9 #include "src/lookup.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 isolate->native_context()->set_template_instantiations_cache(*new_cache); | 280 isolate->native_context()->set_template_instantiations_cache(*new_cache); |
281 } | 281 } |
282 | 282 |
283 void UncacheTemplateInstantiation(Isolate* isolate, uint32_t serial_number) { | 283 void UncacheTemplateInstantiation(Isolate* isolate, uint32_t serial_number) { |
284 auto cache = isolate->template_instantiations_cache(); | 284 auto cache = isolate->template_instantiations_cache(); |
285 int entry = cache->FindEntry(serial_number); | 285 int entry = cache->FindEntry(serial_number); |
286 DCHECK(entry != UnseededNumberDictionary::kNotFound); | 286 DCHECK(entry != UnseededNumberDictionary::kNotFound); |
287 Handle<Object> result = | 287 Handle<Object> result = |
288 UnseededNumberDictionary::DeleteProperty(cache, entry); | 288 UnseededNumberDictionary::DeleteProperty(cache, entry); |
289 USE(result); | 289 USE(result); |
290 DCHECK(result->IsTrue()); | 290 DCHECK(result->IsTrue(isolate)); |
291 auto new_cache = UnseededNumberDictionary::Shrink(cache, entry); | 291 auto new_cache = UnseededNumberDictionary::Shrink(cache, entry); |
292 isolate->native_context()->set_template_instantiations_cache(*new_cache); | 292 isolate->native_context()->set_template_instantiations_cache(*new_cache); |
293 } | 293 } |
294 | 294 |
295 MaybeHandle<JSObject> InstantiateObject(Isolate* isolate, | 295 MaybeHandle<JSObject> InstantiateObject(Isolate* isolate, |
296 Handle<ObjectTemplateInfo> info, | 296 Handle<ObjectTemplateInfo> info, |
297 Handle<JSReceiver> new_target, | 297 Handle<JSReceiver> new_target, |
298 bool is_hidden_prototype) { | 298 bool is_hidden_prototype) { |
299 Handle<JSFunction> constructor; | 299 Handle<JSFunction> constructor; |
300 uint32_t serial_number = | 300 uint32_t serial_number = |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 map->set_is_callable(); | 650 map->set_is_callable(); |
651 map->set_is_constructor(true); | 651 map->set_is_constructor(true); |
652 } | 652 } |
653 | 653 |
654 DCHECK(result->shared()->IsApiFunction()); | 654 DCHECK(result->shared()->IsApiFunction()); |
655 return result; | 655 return result; |
656 } | 656 } |
657 | 657 |
658 } // namespace internal | 658 } // namespace internal |
659 } // namespace v8 | 659 } // namespace v8 |
OLD | NEW |