| 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 if (!obj->needs_access_check() && | 545 type = JS_OBJECT_TYPE; |
| 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 } | |
| 552 instance_size += JSObject::kHeaderSize; | 546 instance_size += JSObject::kHeaderSize; |
| 553 break; | 547 break; |
| 554 case GlobalObjectType: | 548 case GlobalObjectType: |
| 555 type = JS_GLOBAL_OBJECT_TYPE; | 549 type = JS_GLOBAL_OBJECT_TYPE; |
| 556 instance_size += JSGlobalObject::kSize; | 550 instance_size += JSGlobalObject::kSize; |
| 557 break; | 551 break; |
| 558 case GlobalProxyType: | 552 case GlobalProxyType: |
| 559 type = JS_GLOBAL_PROXY_TYPE; | 553 type = JS_GLOBAL_PROXY_TYPE; |
| 560 instance_size += JSGlobalProxy::kSize; | 554 instance_size += JSGlobalProxy::kSize; |
| 561 break; | 555 break; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 map->set_is_callable(); | 618 map->set_is_callable(); |
| 625 map->set_is_constructor(true); | 619 map->set_is_constructor(true); |
| 626 } | 620 } |
| 627 | 621 |
| 628 DCHECK(result->shared()->IsApiFunction()); | 622 DCHECK(result->shared()->IsApiFunction()); |
| 629 return result; | 623 return result; |
| 630 } | 624 } |
| 631 | 625 |
| 632 } // namespace internal | 626 } // namespace internal |
| 633 } // namespace v8 | 627 } // namespace v8 |
| OLD | NEW |