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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 } | 634 } |
635 instance_size += JSObject::kHeaderSize; | 635 instance_size += JSObject::kHeaderSize; |
636 break; | 636 break; |
637 case GlobalObjectType: | 637 case GlobalObjectType: |
638 type = JS_GLOBAL_OBJECT_TYPE; | 638 type = JS_GLOBAL_OBJECT_TYPE; |
639 instance_size += JSGlobalObject::kSize; | 639 instance_size += JSGlobalObject::kSize; |
640 break; | 640 break; |
641 case GlobalProxyType: | 641 case GlobalProxyType: |
642 type = JS_GLOBAL_PROXY_TYPE; | 642 type = JS_GLOBAL_PROXY_TYPE; |
643 instance_size += JSGlobalProxy::kSize; | 643 instance_size += JSGlobalProxy::kSize; |
| 644 DCHECK_EQ(instance_size, JSGlobalProxy::kSizeWithInternalFields); |
644 break; | 645 break; |
645 default: | 646 default: |
646 UNREACHABLE(); | 647 UNREACHABLE(); |
647 type = JS_OBJECT_TYPE; // Keep the compiler happy. | 648 type = JS_OBJECT_TYPE; // Keep the compiler happy. |
648 break; | 649 break; |
649 } | 650 } |
650 | 651 |
651 Handle<Map> map = | 652 Handle<Map> map = |
652 isolate->factory()->NewMap(type, instance_size, FAST_HOLEY_SMI_ELEMENTS); | 653 isolate->factory()->NewMap(type, instance_size, FAST_HOLEY_SMI_ELEMENTS); |
653 JSFunction::SetInitialMap(result, map, Handle<JSObject>::cast(prototype)); | 654 JSFunction::SetInitialMap(result, map, Handle<JSObject>::cast(prototype)); |
(...skipping 20 matching lines...) Expand all Loading... |
674 if (!obj->instance_call_handler()->IsUndefined(isolate)) { | 675 if (!obj->instance_call_handler()->IsUndefined(isolate)) { |
675 map->set_is_callable(); | 676 map->set_is_callable(); |
676 map->set_is_constructor(true); | 677 map->set_is_constructor(true); |
677 } | 678 } |
678 | 679 |
679 return result; | 680 return result; |
680 } | 681 } |
681 | 682 |
682 } // namespace internal | 683 } // namespace internal |
683 } // namespace v8 | 684 } // namespace v8 |
OLD | NEW |