OLD | NEW |
---|---|
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
676 int internal_field_count = 0; | 676 int internal_field_count = 0; |
677 if (!obj->instance_template()->IsUndefined()) { | 677 if (!obj->instance_template()->IsUndefined()) { |
678 Handle<ObjectTemplateInfo> instance_template = | 678 Handle<ObjectTemplateInfo> instance_template = |
679 Handle<ObjectTemplateInfo>( | 679 Handle<ObjectTemplateInfo>( |
680 ObjectTemplateInfo::cast(obj->instance_template())); | 680 ObjectTemplateInfo::cast(obj->instance_template())); |
681 internal_field_count = | 681 internal_field_count = |
682 Smi::cast(instance_template->internal_field_count())->value(); | 682 Smi::cast(instance_template->internal_field_count())->value(); |
683 } | 683 } |
684 | 684 |
685 int instance_size = kPointerSize * internal_field_count; | 685 int instance_size = kPointerSize * internal_field_count; |
686 InstanceType type; | 686 InstanceType type = JS_OBJECT_TYPE; // initialize to a valid value |
iposva
2008/10/21 20:13:39
I would prefer to see a NO_TYPE in the InstanceTyp
| |
687 switch (instance_type) { | 687 switch (instance_type) { |
688 case JavaScriptObject: | 688 case JavaScriptObject: |
689 type = JS_OBJECT_TYPE; | 689 type = JS_OBJECT_TYPE; |
690 instance_size += JSObject::kHeaderSize; | 690 instance_size += JSObject::kHeaderSize; |
691 break; | 691 break; |
692 case InnerGlobalObject: | 692 case InnerGlobalObject: |
693 type = JS_GLOBAL_OBJECT_TYPE; | 693 type = JS_GLOBAL_OBJECT_TYPE; |
694 instance_size += JSGlobalObject::kSize; | 694 instance_size += JSGlobalObject::kSize; |
695 break; | 695 break; |
696 case OuterGlobalObject: | 696 case OuterGlobalObject: |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
816 Execution::ConfigureInstance(instance, | 816 Execution::ConfigureInstance(instance, |
817 instance_template, | 817 instance_template, |
818 pending_exception); | 818 pending_exception); |
819 } else { | 819 } else { |
820 *pending_exception = false; | 820 *pending_exception = false; |
821 } | 821 } |
822 } | 822 } |
823 | 823 |
824 | 824 |
825 } } // namespace v8::internal | 825 } } // namespace v8::internal |
OLD | NEW |