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