| OLD | NEW |
| 1 // Copyright 2012 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 |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 Handle<Name> name, | 758 Handle<Name> name, |
| 759 Register receiver_reg, | 759 Register receiver_reg, |
| 760 Register name_reg, | 760 Register name_reg, |
| 761 Register value_reg, | 761 Register value_reg, |
| 762 Register scratch1, | 762 Register scratch1, |
| 763 Register scratch2, | 763 Register scratch2, |
| 764 Label* miss_label, | 764 Label* miss_label, |
| 765 Label* miss_restore_name) { | 765 Label* miss_restore_name) { |
| 766 // Check that the map of the object hasn't changed. | 766 // Check that the map of the object hasn't changed. |
| 767 __ CheckMap(receiver_reg, Handle<Map>(object->map()), | 767 __ CheckMap(receiver_reg, Handle<Map>(object->map()), |
| 768 miss_label, DO_SMI_CHECK, REQUIRE_EXACT_MAP); | 768 miss_label, DO_SMI_CHECK); |
| 769 | 769 |
| 770 // Perform global security token check if needed. | 770 // Perform global security token check if needed. |
| 771 if (object->IsJSGlobalProxy()) { | 771 if (object->IsJSGlobalProxy()) { |
| 772 __ CheckAccessGlobalProxy(receiver_reg, scratch1, scratch2, miss_label); | 772 __ CheckAccessGlobalProxy(receiver_reg, scratch1, scratch2, miss_label); |
| 773 } | 773 } |
| 774 | 774 |
| 775 // Check that we are allowed to write this. | 775 // Check that we are allowed to write this. |
| 776 if (object->GetPrototype()->IsJSObject()) { | 776 if (object->GetPrototype()->IsJSObject()) { |
| 777 JSObject* holder; | 777 JSObject* holder; |
| 778 // holder == object indicates that no property was found. | 778 // holder == object indicates that no property was found. |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 Handle<JSObject> object, | 893 Handle<JSObject> object, |
| 894 LookupResult* lookup, | 894 LookupResult* lookup, |
| 895 Register receiver_reg, | 895 Register receiver_reg, |
| 896 Register name_reg, | 896 Register name_reg, |
| 897 Register value_reg, | 897 Register value_reg, |
| 898 Register scratch1, | 898 Register scratch1, |
| 899 Register scratch2, | 899 Register scratch2, |
| 900 Label* miss_label) { | 900 Label* miss_label) { |
| 901 // Check that the map of the object hasn't changed. | 901 // Check that the map of the object hasn't changed. |
| 902 __ CheckMap(receiver_reg, Handle<Map>(object->map()), | 902 __ CheckMap(receiver_reg, Handle<Map>(object->map()), |
| 903 miss_label, DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); | 903 miss_label, DO_SMI_CHECK); |
| 904 | 904 |
| 905 // Perform global security token check if needed. | 905 // Perform global security token check if needed. |
| 906 if (object->IsJSGlobalProxy()) { | 906 if (object->IsJSGlobalProxy()) { |
| 907 __ CheckAccessGlobalProxy(receiver_reg, scratch1, scratch2, miss_label); | 907 __ CheckAccessGlobalProxy(receiver_reg, scratch1, scratch2, miss_label); |
| 908 } | 908 } |
| 909 | 909 |
| 910 // Stub never generated for non-global objects that require access | 910 // Stub never generated for non-global objects that require access |
| 911 // checks. | 911 // checks. |
| 912 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); | 912 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); |
| 913 | 913 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, | 1034 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, |
| 1035 scratch1, scratch2); | 1035 scratch1, scratch2); |
| 1036 | 1036 |
| 1037 __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); | 1037 __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); |
| 1038 reg = holder_reg; // From now on the object will be in holder_reg. | 1038 reg = holder_reg; // From now on the object will be in holder_reg. |
| 1039 __ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset)); | 1039 __ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset)); |
| 1040 } else { | 1040 } else { |
| 1041 bool in_new_space = heap()->InNewSpace(*prototype); | 1041 bool in_new_space = heap()->InNewSpace(*prototype); |
| 1042 Handle<Map> current_map(current->map()); | 1042 Handle<Map> current_map(current->map()); |
| 1043 if (!current.is_identical_to(first) || check == CHECK_ALL_MAPS) { | 1043 if (!current.is_identical_to(first) || check == CHECK_ALL_MAPS) { |
| 1044 __ CheckMap(reg, current_map, miss, DONT_DO_SMI_CHECK, | 1044 __ CheckMap(reg, current_map, miss, DONT_DO_SMI_CHECK); |
| 1045 ALLOW_ELEMENT_TRANSITION_MAPS); | |
| 1046 } | 1045 } |
| 1047 | 1046 |
| 1048 // Check access rights to the global object. This has to happen after | 1047 // Check access rights to the global object. This has to happen after |
| 1049 // the map check so that we know that the object is actually a global | 1048 // the map check so that we know that the object is actually a global |
| 1050 // object. | 1049 // object. |
| 1051 if (current->IsJSGlobalProxy()) { | 1050 if (current->IsJSGlobalProxy()) { |
| 1052 __ CheckAccessGlobalProxy(reg, scratch1, scratch2, miss); | 1051 __ CheckAccessGlobalProxy(reg, scratch1, scratch2, miss); |
| 1053 } | 1052 } |
| 1054 | 1053 |
| 1055 if (in_new_space) { | 1054 if (in_new_space) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1076 // Go to the next object in the prototype chain. | 1075 // Go to the next object in the prototype chain. |
| 1077 current = prototype; | 1076 current = prototype; |
| 1078 } | 1077 } |
| 1079 ASSERT(current.is_identical_to(holder)); | 1078 ASSERT(current.is_identical_to(holder)); |
| 1080 | 1079 |
| 1081 // Log the check depth. | 1080 // Log the check depth. |
| 1082 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); | 1081 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); |
| 1083 | 1082 |
| 1084 if (!holder.is_identical_to(first) || check == CHECK_ALL_MAPS) { | 1083 if (!holder.is_identical_to(first) || check == CHECK_ALL_MAPS) { |
| 1085 // Check the holder map. | 1084 // Check the holder map. |
| 1086 __ CheckMap(reg, Handle<Map>(holder->map()), | 1085 __ CheckMap(reg, Handle<Map>(holder->map()), miss, DONT_DO_SMI_CHECK); |
| 1087 miss, DONT_DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); | |
| 1088 } | 1086 } |
| 1089 | 1087 |
| 1090 // Perform security check for access to the global object. | 1088 // Perform security check for access to the global object. |
| 1091 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded()); | 1089 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded()); |
| 1092 if (holder->IsJSGlobalProxy()) { | 1090 if (holder->IsJSGlobalProxy()) { |
| 1093 __ CheckAccessGlobalProxy(reg, scratch1, scratch2, miss); | 1091 __ CheckAccessGlobalProxy(reg, scratch1, scratch2, miss); |
| 1094 } | 1092 } |
| 1095 | 1093 |
| 1096 // If we've skipped any global objects, it's not enough to verify that | 1094 // If we've skipped any global objects, it's not enough to verify that |
| 1097 // their maps haven't changed. We also need to check that the property | 1095 // their maps haven't changed. We also need to check that the property |
| (...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2708 #undef __ | 2706 #undef __ |
| 2709 #define __ ACCESS_MASM(masm()) | 2707 #define __ ACCESS_MASM(masm()) |
| 2710 | 2708 |
| 2711 | 2709 |
| 2712 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( | 2710 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( |
| 2713 Handle<JSObject> object, | 2711 Handle<JSObject> object, |
| 2714 Handle<Name> name) { | 2712 Handle<Name> name) { |
| 2715 Label miss; | 2713 Label miss; |
| 2716 | 2714 |
| 2717 // Check that the map of the object hasn't changed. | 2715 // Check that the map of the object hasn't changed. |
| 2718 __ CheckMap(receiver(), Handle<Map>(object->map()), | 2716 __ CheckMap(receiver(), Handle<Map>(object->map()), &miss, DO_SMI_CHECK); |
| 2719 &miss, DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); | |
| 2720 | 2717 |
| 2721 // Perform global security token check if needed. | 2718 // Perform global security token check if needed. |
| 2722 if (object->IsJSGlobalProxy()) { | 2719 if (object->IsJSGlobalProxy()) { |
| 2723 __ CheckAccessGlobalProxy(receiver(), scratch1(), scratch2(), &miss); | 2720 __ CheckAccessGlobalProxy(receiver(), scratch1(), scratch2(), &miss); |
| 2724 } | 2721 } |
| 2725 | 2722 |
| 2726 // Stub never generated for non-global objects that require access | 2723 // Stub never generated for non-global objects that require access |
| 2727 // checks. | 2724 // checks. |
| 2728 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); | 2725 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); |
| 2729 | 2726 |
| (...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3690 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); | 3687 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); |
| 3691 } | 3688 } |
| 3692 } | 3689 } |
| 3693 | 3690 |
| 3694 | 3691 |
| 3695 #undef __ | 3692 #undef __ |
| 3696 | 3693 |
| 3697 } } // namespace v8::internal | 3694 } } // namespace v8::internal |
| 3698 | 3695 |
| 3699 #endif // V8_TARGET_ARCH_IA32 | 3696 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |