Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/ic.cc

Issue 24272005: ic: perform interceptor query in LookupForWrite (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after
1600 Handle<String> name, 1600 Handle<String> name,
1601 Handle<Object> value, 1601 Handle<Object> value,
1602 LookupResult* lookup, 1602 LookupResult* lookup,
1603 IC::State* state) { 1603 IC::State* state) {
1604 Handle<JSObject> holder = receiver; 1604 Handle<JSObject> holder = receiver;
1605 receiver->Lookup(*name, lookup); 1605 receiver->Lookup(*name, lookup);
1606 if (lookup->IsFound()) { 1606 if (lookup->IsFound()) {
1607 if (lookup->IsReadOnly() || !lookup->IsCacheable()) return false; 1607 if (lookup->IsReadOnly() || !lookup->IsCacheable()) return false;
1608 1608
1609 if (lookup->holder() == *receiver) { 1609 if (lookup->holder() == *receiver) {
1610 if (lookup->IsInterceptor() && 1610 if (lookup->IsInterceptor()) {
1611 receiver->GetNamedInterceptor()->setter()->IsUndefined()) { 1611 bool found_and_writable;
1612 receiver->LocalLookupRealNamedProperty(*name, lookup); 1612 if (receiver->GetNamedInterceptor()->setter()->IsUndefined()) {
1613 return lookup->IsFound() && 1613 receiver->LocalLookupRealNamedProperty(*name, lookup);
1614 !lookup->IsReadOnly() && 1614 found_and_writable = lookup->IsFound() &&
1615 lookup->CanHoldValue(value) && 1615 !lookup->IsReadOnly() &&
1616 lookup->IsCacheable(); 1616 lookup->CanHoldValue(value);
1617 } else {
1618 ASSERT(lookup->representation()->IsNone());
Toon Verwaest 2013/09/23 13:09:59 Why would the representation be none? It's explici
1619 PropertyAttributes attrs =
1620 lookup->holder()->GetPropertyAttributeWithInterceptor(*receiver,
1621 *name,
1622 true);
1623 found_and_writable = attrs != ABSENT && (attrs & READ_ONLY) == 0;
1624 }
1625 return found_and_writable && lookup->IsCacheable();
1617 } 1626 }
1618 return lookup->CanHoldValue(value); 1627 return lookup->CanHoldValue(value);
1619 } 1628 }
1620 1629
1621 if (lookup->IsPropertyCallbacks()) return true; 1630 if (lookup->IsPropertyCallbacks()) return true;
1622 1631
1623 // Currently normal holders in the prototype chain are not supported. They 1632 // Currently normal holders in the prototype chain are not supported. They
1624 // would require a runtime positive lookup and verification that the details 1633 // would require a runtime positive lookup and verification that the details
1625 // have not changed. 1634 // have not changed.
1626 if (lookup->IsInterceptor() || lookup->IsNormal()) return false; 1635 if (lookup->IsInterceptor() || lookup->IsNormal()) return false;
(...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after
3156 #undef ADDR 3165 #undef ADDR
3157 }; 3166 };
3158 3167
3159 3168
3160 Address IC::AddressFromUtilityId(IC::UtilityId id) { 3169 Address IC::AddressFromUtilityId(IC::UtilityId id) {
3161 return IC_utilities[id]; 3170 return IC_utilities[id];
3162 } 3171 }
3163 3172
3164 3173
3165 } } // namespace v8::internal 3174 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698