OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 | 857 |
858 __ movq(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); | 858 __ movq(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); |
859 reg = holder_reg; // From now on the object will be in holder_reg. | 859 reg = holder_reg; // From now on the object will be in holder_reg. |
860 __ movq(reg, FieldOperand(scratch1, Map::kPrototypeOffset)); | 860 __ movq(reg, FieldOperand(scratch1, Map::kPrototypeOffset)); |
861 } else { | 861 } else { |
862 bool in_new_space = heap()->InNewSpace(*prototype); | 862 bool in_new_space = heap()->InNewSpace(*prototype); |
863 Handle<Map> current_map(current->map()); | 863 Handle<Map> current_map(current->map()); |
864 if (in_new_space) { | 864 if (in_new_space) { |
865 // Save the map in scratch1 for later. | 865 // Save the map in scratch1 for later. |
866 __ movq(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); | 866 __ movq(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); |
867 __ Cmp(scratch1, current_map); | |
868 } else { | |
869 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), current_map); | |
870 } | 867 } |
871 // Branch on the result of the map check. | 868 __ CheckMap(reg, Handle<Map>(current_map), |
872 __ j(not_equal, miss); | 869 miss, DONT_DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); |
| 870 |
873 // Check access rights to the global object. This has to happen after | 871 // Check access rights to the global object. This has to happen after |
874 // the map check so that we know that the object is actually a global | 872 // the map check so that we know that the object is actually a global |
875 // object. | 873 // object. |
876 if (current->IsJSGlobalProxy()) { | 874 if (current->IsJSGlobalProxy()) { |
877 __ CheckAccessGlobalProxy(reg, scratch2, miss); | 875 __ CheckAccessGlobalProxy(reg, scratch2, miss); |
878 } | 876 } |
879 reg = holder_reg; // From now on the object will be in holder_reg. | 877 reg = holder_reg; // From now on the object will be in holder_reg. |
880 | 878 |
881 if (in_new_space) { | 879 if (in_new_space) { |
882 // The prototype is in new space; we cannot store a reference to it | 880 // The prototype is in new space; we cannot store a reference to it |
(...skipping 11 matching lines...) Expand all Loading... |
894 | 892 |
895 // Go to the next object in the prototype chain. | 893 // Go to the next object in the prototype chain. |
896 current = prototype; | 894 current = prototype; |
897 } | 895 } |
898 ASSERT(current.is_identical_to(holder)); | 896 ASSERT(current.is_identical_to(holder)); |
899 | 897 |
900 // Log the check depth. | 898 // Log the check depth. |
901 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); | 899 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); |
902 | 900 |
903 // Check the holder map. | 901 // Check the holder map. |
904 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), Handle<Map>(holder->map())); | 902 __ CheckMap(reg, Handle<Map>(holder->map()), |
905 __ j(not_equal, miss); | 903 miss, DONT_DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); |
906 | 904 |
907 // Perform security check for access to the global object. | 905 // Perform security check for access to the global object. |
908 ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded()); | 906 ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded()); |
909 if (current->IsJSGlobalProxy()) { | 907 if (current->IsJSGlobalProxy()) { |
910 __ CheckAccessGlobalProxy(reg, scratch1, miss); | 908 __ CheckAccessGlobalProxy(reg, scratch1, miss); |
911 } | 909 } |
912 | 910 |
913 // If we've skipped any global objects, it's not enough to verify that | 911 // If we've skipped any global objects, it's not enough to verify that |
914 // their maps haven't changed. We also need to check that the property | 912 // their maps haven't changed. We also need to check that the property |
915 // cell for the property is still empty. | 913 // cell for the property is still empty. |
(...skipping 2684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3600 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); | 3598 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); |
3601 __ jmp(ic_miss, RelocInfo::CODE_TARGET); | 3599 __ jmp(ic_miss, RelocInfo::CODE_TARGET); |
3602 } | 3600 } |
3603 | 3601 |
3604 | 3602 |
3605 #undef __ | 3603 #undef __ |
3606 | 3604 |
3607 } } // namespace v8::internal | 3605 } } // namespace v8::internal |
3608 | 3606 |
3609 #endif // V8_TARGET_ARCH_X64 | 3607 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |