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