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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 | 1103 |
1104 // So far the most popular follow ups for interceptor loads are FIELD | 1104 // So far the most popular follow ups for interceptor loads are FIELD |
1105 // and CALLBACKS, so inline only them, other cases may be added | 1105 // and CALLBACKS, so inline only them, other cases may be added |
1106 // later. | 1106 // later. |
1107 bool compile_followup_inline = false; | 1107 bool compile_followup_inline = false; |
1108 if (lookup->IsFound() && lookup->IsCacheable()) { | 1108 if (lookup->IsFound() && lookup->IsCacheable()) { |
1109 if (lookup->type() == FIELD) { | 1109 if (lookup->type() == FIELD) { |
1110 compile_followup_inline = true; | 1110 compile_followup_inline = true; |
1111 } else if (lookup->type() == CALLBACKS && | 1111 } else if (lookup->type() == CALLBACKS && |
1112 lookup->GetCallbackObject()->IsAccessorInfo()) { | 1112 lookup->GetCallbackObject()->IsAccessorInfo()) { |
1113 compile_followup_inline = | 1113 AccessorInfo* callback = AccessorInfo::cast(lookup->GetCallbackObject()); |
1114 AccessorInfo::cast(lookup->GetCallbackObject())->getter() != NULL; | 1114 compile_followup_inline = callback->getter() != NULL && |
| 1115 callback->IsCompatibleReceiver(*object); |
1115 } | 1116 } |
1116 } | 1117 } |
1117 | 1118 |
1118 if (compile_followup_inline) { | 1119 if (compile_followup_inline) { |
1119 // Compile the interceptor call, followed by inline code to load the | 1120 // Compile the interceptor call, followed by inline code to load the |
1120 // property from further up the prototype chain if the call fails. | 1121 // property from further up the prototype chain if the call fails. |
1121 // Check that the maps haven't changed. | 1122 // Check that the maps haven't changed. |
1122 Register holder_reg = CheckPrototypes(object, receiver, interceptor_holder, | 1123 Register holder_reg = CheckPrototypes(object, receiver, interceptor_holder, |
1123 scratch1, scratch2, scratch3, | 1124 scratch1, scratch2, scratch3, |
1124 name, miss); | 1125 name, miss); |
(...skipping 2737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3862 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 3863 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
3863 } | 3864 } |
3864 } | 3865 } |
3865 | 3866 |
3866 | 3867 |
3867 #undef __ | 3868 #undef __ |
3868 | 3869 |
3869 } } // namespace v8::internal | 3870 } } // namespace v8::internal |
3870 | 3871 |
3871 #endif // V8_TARGET_ARCH_X64 | 3872 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |