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

Side by Side Diff: src/ic.cc

Issue 10695197: Handle setters on the prototype chain efficiently by default. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« 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 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 } 1309 }
1310 return !lookup->IsReadOnly(); 1310 return !lookup->IsReadOnly();
1311 } 1311 }
1312 1312
1313 1313
1314 static bool LookupForWrite(Handle<JSObject> receiver, 1314 static bool LookupForWrite(Handle<JSObject> receiver,
1315 Handle<String> name, 1315 Handle<String> name,
1316 LookupResult* lookup) { 1316 LookupResult* lookup) {
1317 receiver->LocalLookup(*name, lookup); 1317 receiver->LocalLookup(*name, lookup);
1318 if (!StoreICableLookup(lookup)) { 1318 if (!StoreICableLookup(lookup)) {
1319 // 2nd chance: There can be accessors somewhere in the prototype chain, but 1319 // 2nd chance: There can be accessors somewhere in the prototype chain. Note
1320 // for compatibility reasons we have to hide this behind a flag. Note that 1320 // that we explicitly exclude native accessors for now, because the stubs
1321 // we explicitly exclude native accessors for now, because the stubs are not 1321 // are not yet prepared for this scenario.
1322 // yet prepared for this scenario.
1323 if (!FLAG_es5_readonly) return false;
1324 receiver->Lookup(*name, lookup); 1322 receiver->Lookup(*name, lookup);
1325 if (!lookup->IsCallbacks()) return false; 1323 if (!lookup->IsCallbacks()) return false;
1326 Handle<Object> callback(lookup->GetCallbackObject()); 1324 Handle<Object> callback(lookup->GetCallbackObject());
1327 return callback->IsAccessorPair() && StoreICableLookup(lookup); 1325 return callback->IsAccessorPair() && StoreICableLookup(lookup);
1328 } 1326 }
1329 1327
1330 if (lookup->IsInterceptor() && 1328 if (lookup->IsInterceptor() &&
1331 receiver->GetNamedInterceptor()->setter()->IsUndefined()) { 1329 receiver->GetNamedInterceptor()->setter()->IsUndefined()) {
1332 receiver->LocalLookupRealNamedProperty(*name, lookup); 1330 receiver->LocalLookupRealNamedProperty(*name, lookup);
1333 return StoreICableLookup(lookup); 1331 return StoreICableLookup(lookup);
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after
2703 #undef ADDR 2701 #undef ADDR
2704 }; 2702 };
2705 2703
2706 2704
2707 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2705 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2708 return IC_utilities[id]; 2706 return IC_utilities[id];
2709 } 2707 }
2710 2708
2711 2709
2712 } } // namespace v8::internal 2710 } } // 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