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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 internal_field_count = | 535 internal_field_count = |
536 Smi::cast(instance_template->internal_field_count())->value(); | 536 Smi::cast(instance_template->internal_field_count())->value(); |
537 } | 537 } |
538 | 538 |
539 // TODO(svenpanne) Kill ApiInstanceType and refactor things by generalizing | 539 // TODO(svenpanne) Kill ApiInstanceType and refactor things by generalizing |
540 // JSObject::GetHeaderSize. | 540 // JSObject::GetHeaderSize. |
541 int instance_size = kPointerSize * internal_field_count; | 541 int instance_size = kPointerSize * internal_field_count; |
542 InstanceType type; | 542 InstanceType type; |
543 switch (instance_type) { | 543 switch (instance_type) { |
544 case JavaScriptObjectType: | 544 case JavaScriptObjectType: |
545 type = JS_OBJECT_TYPE; | 545 if (!obj->needs_access_check() && |
| 546 obj->named_property_handler()->IsUndefined() && |
| 547 obj->indexed_property_handler()->IsUndefined()) { |
| 548 type = JS_OBJECT_TYPE; |
| 549 } else { |
| 550 type = JS_SPECIAL_API_OBJECT_TYPE; |
| 551 } |
546 instance_size += JSObject::kHeaderSize; | 552 instance_size += JSObject::kHeaderSize; |
547 break; | 553 break; |
548 case GlobalObjectType: | 554 case GlobalObjectType: |
549 type = JS_GLOBAL_OBJECT_TYPE; | 555 type = JS_GLOBAL_OBJECT_TYPE; |
550 instance_size += JSGlobalObject::kSize; | 556 instance_size += JSGlobalObject::kSize; |
551 break; | 557 break; |
552 case GlobalProxyType: | 558 case GlobalProxyType: |
553 type = JS_GLOBAL_PROXY_TYPE; | 559 type = JS_GLOBAL_PROXY_TYPE; |
554 instance_size += JSGlobalProxy::kSize; | 560 instance_size += JSGlobalProxy::kSize; |
555 break; | 561 break; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 map->set_is_callable(); | 624 map->set_is_callable(); |
619 map->set_is_constructor(true); | 625 map->set_is_constructor(true); |
620 } | 626 } |
621 | 627 |
622 DCHECK(result->shared()->IsApiFunction()); | 628 DCHECK(result->shared()->IsApiFunction()); |
623 return result; | 629 return result; |
624 } | 630 } |
625 | 631 |
626 } // namespace internal | 632 } // namespace internal |
627 } // namespace v8 | 633 } // namespace v8 |
OLD | NEW |