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

Side by Side Diff: src/ic.cc

Issue 14063006: Disentangle field from transition stores. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 8 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 | « src/ia32/stub-cache-ia32.cc ('k') | src/stub-cache.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 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 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 1579
1580 1580
1581 Handle<Code> StoreIC::ComputeStoreMonomorphic(LookupResult* lookup, 1581 Handle<Code> StoreIC::ComputeStoreMonomorphic(LookupResult* lookup,
1582 StrictModeFlag strict_mode, 1582 StrictModeFlag strict_mode,
1583 Handle<JSObject> receiver, 1583 Handle<JSObject> receiver,
1584 Handle<String> name) { 1584 Handle<String> name) {
1585 Handle<JSObject> holder(lookup->holder()); 1585 Handle<JSObject> holder(lookup->holder());
1586 switch (lookup->type()) { 1586 switch (lookup->type()) {
1587 case FIELD: 1587 case FIELD:
1588 return isolate()->stub_cache()->ComputeStoreField( 1588 return isolate()->stub_cache()->ComputeStoreField(
1589 name, receiver, lookup, Handle<Map>::null(), strict_mode); 1589 name, receiver, lookup, strict_mode);
1590 case NORMAL: 1590 case NORMAL:
1591 if (receiver->IsGlobalObject()) { 1591 if (receiver->IsGlobalObject()) {
1592 // The stub generated for the global object picks the value directly 1592 // The stub generated for the global object picks the value directly
1593 // from the property cell. So the property must be directly on the 1593 // from the property cell. So the property must be directly on the
1594 // global object. 1594 // global object.
1595 Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver); 1595 Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver);
1596 Handle<JSGlobalPropertyCell> cell( 1596 Handle<JSGlobalPropertyCell> cell(
1597 global->GetPropertyCell(lookup), isolate()); 1597 global->GetPropertyCell(lookup), isolate());
1598 return isolate()->stub_cache()->ComputeStoreGlobal( 1598 return isolate()->stub_cache()->ComputeStoreGlobal(
1599 name, global, cell, strict_mode); 1599 name, global, cell, strict_mode);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 // stored something else than the receiver in the holder. 1637 // stored something else than the receiver in the holder.
1638 Handle<Map> transition( 1638 Handle<Map> transition(
1639 lookup->GetTransitionTarget(receiver->map()), isolate()); 1639 lookup->GetTransitionTarget(receiver->map()), isolate());
1640 int descriptor = transition->LastAdded(); 1640 int descriptor = transition->LastAdded();
1641 1641
1642 DescriptorArray* target_descriptors = transition->instance_descriptors(); 1642 DescriptorArray* target_descriptors = transition->instance_descriptors();
1643 PropertyDetails details = target_descriptors->GetDetails(descriptor); 1643 PropertyDetails details = target_descriptors->GetDetails(descriptor);
1644 1644
1645 if (details.type() != FIELD || details.attributes() != NONE) break; 1645 if (details.type() != FIELD || details.attributes() != NONE) break;
1646 1646
1647 return isolate()->stub_cache()->ComputeStoreField( 1647 return isolate()->stub_cache()->ComputeStoreTransition(
1648 name, receiver, lookup, transition, strict_mode); 1648 name, receiver, lookup, transition, strict_mode);
1649 } 1649 }
1650 case NONEXISTENT: 1650 case NONEXISTENT:
1651 case HANDLER: 1651 case HANDLER:
1652 UNREACHABLE(); 1652 UNREACHABLE();
1653 break; 1653 break;
1654 } 1654 }
1655 return Handle<Code>::null(); 1655 return Handle<Code>::null();
1656 } 1656 }
1657 1657
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1980 Handle<Code> KeyedStoreIC::ComputeStoreMonomorphic(LookupResult* lookup, 1980 Handle<Code> KeyedStoreIC::ComputeStoreMonomorphic(LookupResult* lookup,
1981 StrictModeFlag strict_mode, 1981 StrictModeFlag strict_mode,
1982 Handle<JSObject> receiver, 1982 Handle<JSObject> receiver,
1983 Handle<String> name) { 1983 Handle<String> name) {
1984 // If the property has a non-field type allowing map transitions 1984 // If the property has a non-field type allowing map transitions
1985 // where there is extra room in the object, we leave the IC in its 1985 // where there is extra room in the object, we leave the IC in its
1986 // current state. 1986 // current state.
1987 switch (lookup->type()) { 1987 switch (lookup->type()) {
1988 case FIELD: 1988 case FIELD:
1989 return isolate()->stub_cache()->ComputeKeyedStoreField( 1989 return isolate()->stub_cache()->ComputeKeyedStoreField(
1990 name, receiver, lookup, Handle<Map>::null(), strict_mode); 1990 name, receiver, lookup, strict_mode);
1991 case TRANSITION: { 1991 case TRANSITION: {
1992 // Explicitly pass in the receiver map since LookupForWrite may have 1992 // Explicitly pass in the receiver map since LookupForWrite may have
1993 // stored something else than the receiver in the holder. 1993 // stored something else than the receiver in the holder.
1994 Handle<Map> transition( 1994 Handle<Map> transition(
1995 lookup->GetTransitionTarget(receiver->map()), isolate()); 1995 lookup->GetTransitionTarget(receiver->map()), isolate());
1996 int descriptor = transition->LastAdded(); 1996 int descriptor = transition->LastAdded();
1997 1997
1998 DescriptorArray* target_descriptors = transition->instance_descriptors(); 1998 DescriptorArray* target_descriptors = transition->instance_descriptors();
1999 PropertyDetails details = target_descriptors->GetDetails(descriptor); 1999 PropertyDetails details = target_descriptors->GetDetails(descriptor);
2000 2000
2001 if (details.type() == FIELD && details.attributes() == NONE) { 2001 if (details.type() == FIELD && details.attributes() == NONE) {
2002 return isolate()->stub_cache()->ComputeKeyedStoreField( 2002 return isolate()->stub_cache()->ComputeKeyedStoreTransition(
2003 name, receiver, lookup, transition, strict_mode); 2003 name, receiver, lookup, transition, strict_mode);
2004 } 2004 }
2005 // fall through. 2005 // fall through.
2006 } 2006 }
2007 case NORMAL: 2007 case NORMAL:
2008 case CONSTANT_FUNCTION: 2008 case CONSTANT_FUNCTION:
2009 case CALLBACKS: 2009 case CALLBACKS:
2010 case INTERCEPTOR: 2010 case INTERCEPTOR:
2011 // Always rewrite to the generic case so that we do not 2011 // Always rewrite to the generic case so that we do not
2012 // repeatedly try to rewrite. 2012 // repeatedly try to rewrite.
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
2798 #undef ADDR 2798 #undef ADDR
2799 }; 2799 };
2800 2800
2801 2801
2802 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2802 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2803 return IC_utilities[id]; 2803 return IC_utilities[id];
2804 } 2804 }
2805 2805
2806 2806
2807 } } // namespace v8::internal 2807 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698