OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 | 871 |
872 __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); | 872 __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); |
873 reg = holder_reg; // From now on the object will be in holder_reg. | 873 reg = holder_reg; // From now on the object will be in holder_reg. |
874 __ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset)); | 874 __ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset)); |
875 } else { | 875 } else { |
876 bool in_new_space = heap()->InNewSpace(*prototype); | 876 bool in_new_space = heap()->InNewSpace(*prototype); |
877 Handle<Map> current_map(current->map()); | 877 Handle<Map> current_map(current->map()); |
878 if (in_new_space) { | 878 if (in_new_space) { |
879 // Save the map in scratch1 for later. | 879 // Save the map in scratch1 for later. |
880 __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); | 880 __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); |
| 881 __ cmp(scratch1, Immediate(current_map)); |
| 882 } else { |
| 883 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), |
| 884 Immediate(current_map)); |
881 } | 885 } |
882 __ CheckMap(reg, current_map, miss, DONT_DO_SMI_CHECK, | 886 // Branch on the result of the map check. |
883 ALLOW_ELEMENT_TRANSITION_MAPS); | 887 __ j(not_equal, miss); |
884 | |
885 // Check access rights to the global object. This has to happen after | 888 // Check access rights to the global object. This has to happen after |
886 // the map check so that we know that the object is actually a global | 889 // the map check so that we know that the object is actually a global |
887 // object. | 890 // object. |
888 if (current->IsJSGlobalProxy()) { | 891 if (current->IsJSGlobalProxy()) { |
889 __ CheckAccessGlobalProxy(reg, scratch2, miss); | 892 __ CheckAccessGlobalProxy(reg, scratch2, miss); |
890 } | 893 } |
891 reg = holder_reg; // From now on the object will be in holder_reg. | 894 reg = holder_reg; // From now on the object will be in holder_reg. |
892 | 895 |
893 if (in_new_space) { | 896 if (in_new_space) { |
894 // The prototype is in new space; we cannot store a reference to it | 897 // The prototype is in new space; we cannot store a reference to it |
(...skipping 11 matching lines...) Expand all Loading... |
906 | 909 |
907 // Go to the next object in the prototype chain. | 910 // Go to the next object in the prototype chain. |
908 current = prototype; | 911 current = prototype; |
909 } | 912 } |
910 ASSERT(current.is_identical_to(holder)); | 913 ASSERT(current.is_identical_to(holder)); |
911 | 914 |
912 // Log the check depth. | 915 // Log the check depth. |
913 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); | 916 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); |
914 | 917 |
915 // Check the holder map. | 918 // Check the holder map. |
916 __ CheckMap(reg, Handle<Map>(holder->map()), | 919 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), |
917 miss, DONT_DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); | 920 Immediate(Handle<Map>(holder->map()))); |
| 921 __ j(not_equal, miss); |
918 | 922 |
919 // Perform security check for access to the global object. | 923 // Perform security check for access to the global object. |
920 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded()); | 924 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded()); |
921 if (holder->IsJSGlobalProxy()) { | 925 if (holder->IsJSGlobalProxy()) { |
922 __ CheckAccessGlobalProxy(reg, scratch1, miss); | 926 __ CheckAccessGlobalProxy(reg, scratch1, miss); |
923 } | 927 } |
924 | 928 |
925 // If we've skipped any global objects, it's not enough to verify that | 929 // If we've skipped any global objects, it's not enough to verify that |
926 // their maps haven't changed. We also need to check that the property | 930 // their maps haven't changed. We also need to check that the property |
927 // cell for the property is still empty. | 931 // cell for the property is still empty. |
(...skipping 2899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3827 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); | 3831 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); |
3828 __ jmp(ic_miss, RelocInfo::CODE_TARGET); | 3832 __ jmp(ic_miss, RelocInfo::CODE_TARGET); |
3829 } | 3833 } |
3830 | 3834 |
3831 | 3835 |
3832 #undef __ | 3836 #undef __ |
3833 | 3837 |
3834 } } // namespace v8::internal | 3838 } } // namespace v8::internal |
3835 | 3839 |
3836 #endif // V8_TARGET_ARCH_IA32 | 3840 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |