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); | |
645 break; | 644 break; |
646 default: | 645 default: |
647 UNREACHABLE(); | 646 UNREACHABLE(); |
648 type = JS_OBJECT_TYPE; // Keep the compiler happy. | 647 type = JS_OBJECT_TYPE; // Keep the compiler happy. |
649 break; | 648 break; |
650 } | 649 } |
651 | 650 |
652 Handle<Map> map = | 651 Handle<Map> map = |
653 isolate->factory()->NewMap(type, instance_size, FAST_HOLEY_SMI_ELEMENTS); | 652 isolate->factory()->NewMap(type, instance_size, FAST_HOLEY_SMI_ELEMENTS); |
654 JSFunction::SetInitialMap(result, map, Handle<JSObject>::cast(prototype)); | 653 JSFunction::SetInitialMap(result, map, Handle<JSObject>::cast(prototype)); |
(...skipping 20 matching lines...) Expand all Loading... |
675 if (!obj->instance_call_handler()->IsUndefined(isolate)) { | 674 if (!obj->instance_call_handler()->IsUndefined(isolate)) { |
676 map->set_is_callable(); | 675 map->set_is_callable(); |
677 map->set_is_constructor(true); | 676 map->set_is_constructor(true); |
678 } | 677 } |
679 | 678 |
680 return result; | 679 return result; |
681 } | 680 } |
682 | 681 |
683 } // namespace internal | 682 } // namespace internal |
684 } // namespace v8 | 683 } // namespace v8 |
OLD | NEW |