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

Side by Side Diff: src/ic.cc

Issue 3537003: Use existing global cell status as a hint when generating loads. (Closed)
Patch Set: added GC test Created 10 years, 2 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 | « src/ic.h ('k') | src/v8-counters.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 ClearInlinedVersion(address); 292 ClearInlinedVersion(address);
293 SetTargetAtAddress(address, initialize_stub()); 293 SetTargetAtAddress(address, initialize_stub());
294 } 294 }
295 295
296 296
297 void LoadIC::ClearInlinedVersion(Address address) { 297 void LoadIC::ClearInlinedVersion(Address address) {
298 // Reset the map check of the inlined inobject property load (if 298 // Reset the map check of the inlined inobject property load (if
299 // present) to guarantee failure by holding an invalid map (the null 299 // present) to guarantee failure by holding an invalid map (the null
300 // value). The offset can be patched to anything. 300 // value). The offset can be patched to anything.
301 PatchInlinedLoad(address, Heap::null_value(), 0); 301 PatchInlinedLoad(address, Heap::null_value(), 0);
302 PatchInlinedContextualLoad(address, Heap::null_value(), Heap::null_value()); 302 PatchInlinedContextualLoad(address,
303 Heap::null_value(),
304 Heap::null_value(),
305 true);
303 } 306 }
304 307
305 308
306 void LoadIC::Clear(Address address, Code* target) { 309 void LoadIC::Clear(Address address, Code* target) {
307 if (target->ic_state() == UNINITIALIZED) return; 310 if (target->ic_state() == UNINITIALIZED) return;
308 ClearInlinedVersion(address); 311 ClearInlinedVersion(address);
309 SetTargetAtAddress(address, initialize_stub()); 312 SetTargetAtAddress(address, initialize_stub());
310 } 313 }
311 314
312 315
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 name); 844 name);
842 } 845 }
843 } else { 846 } else {
844 TRACE_IC_NAMED("[LoadIC : no inline patch %s (not inobject)]\n", name); 847 TRACE_IC_NAMED("[LoadIC : no inline patch %s (not inobject)]\n", name);
845 } 848 }
846 } else if (can_be_inlined_contextual) { 849 } else if (can_be_inlined_contextual) {
847 Map* map = lookup.holder()->map(); 850 Map* map = lookup.holder()->map();
848 JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast( 851 JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(
849 lookup.holder()->property_dictionary()->ValueAt( 852 lookup.holder()->property_dictionary()->ValueAt(
850 lookup.GetDictionaryEntry())); 853 lookup.GetDictionaryEntry()));
851 if (PatchInlinedContextualLoad(address(), map, cell)) { 854 if (PatchInlinedContextualLoad(address(),
855 map,
856 cell,
857 lookup.IsDontDelete())) {
852 set_target(megamorphic_stub()); 858 set_target(megamorphic_stub());
853 TRACE_IC_NAMED("[LoadIC : inline contextual patch %s]\n", name); 859 TRACE_IC_NAMED("[LoadIC : inline contextual patch %s]\n", name);
854 ASSERT(cell->value() != Heap::the_hole_value()); 860 ASSERT(cell->value() != Heap::the_hole_value());
855 return cell->value(); 861 return cell->value();
856 } 862 }
857 } else { 863 } else {
858 if (FLAG_use_ic && state == PREMONOMORPHIC) { 864 if (FLAG_use_ic && state == PREMONOMORPHIC) {
859 TRACE_IC_NAMED("[LoadIC : no inline patch %s (not inlinable)]\n", name); 865 TRACE_IC_NAMED("[LoadIC : no inline patch %s (not inlinable)]\n", name);
860 } 866 }
861 } 867 }
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
1833 #undef ADDR 1839 #undef ADDR
1834 }; 1840 };
1835 1841
1836 1842
1837 Address IC::AddressFromUtilityId(IC::UtilityId id) { 1843 Address IC::AddressFromUtilityId(IC::UtilityId id) {
1838 return IC_utilities[id]; 1844 return IC_utilities[id];
1839 } 1845 }
1840 1846
1841 1847
1842 } } // namespace v8::internal 1848 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic.h ('k') | src/v8-counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698