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/ic.cc

Issue 1102543002: Reland: track global accesses to constant types (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/hydrogen.cc ('k') | src/objects.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after
1713 Handle<Code> code = use_ic ? ComputeHandler(lookup, value) : slow_stub(); 1713 Handle<Code> code = use_ic ? ComputeHandler(lookup, value) : slow_stub();
1714 1714
1715 PatchCache(lookup->name(), code); 1715 PatchCache(lookup->name(), code);
1716 TRACE_IC("StoreIC", lookup->name()); 1716 TRACE_IC("StoreIC", lookup->name());
1717 } 1717 }
1718 1718
1719 1719
1720 static Handle<Code> PropertyCellStoreHandler( 1720 static Handle<Code> PropertyCellStoreHandler(
1721 Isolate* isolate, Handle<JSObject> receiver, Handle<GlobalObject> holder, 1721 Isolate* isolate, Handle<JSObject> receiver, Handle<GlobalObject> holder,
1722 Handle<Name> name, Handle<PropertyCell> cell, PropertyCellType type) { 1722 Handle<Name> name, Handle<PropertyCell> cell, PropertyCellType type) {
1723 StoreGlobalStub stub(isolate, type == PropertyCellType::kConstant, 1723 auto constant_type = Nothing<PropertyCellConstantType>();
1724 if (type == PropertyCellType::kConstantType) {
1725 constant_type = Just(cell->GetConstantType());
1726 }
1727 StoreGlobalStub stub(isolate, type, constant_type,
1724 receiver->IsJSGlobalProxy()); 1728 receiver->IsJSGlobalProxy());
1725 auto code = stub.GetCodeCopyFromTemplate(holder, cell); 1729 auto code = stub.GetCodeCopyFromTemplate(holder, cell);
1726 // TODO(verwaest): Move caching of these NORMAL stubs outside as well. 1730 // TODO(verwaest): Move caching of these NORMAL stubs outside as well.
1727 HeapObject::UpdateMapCodeCache(receiver, name, code); 1731 HeapObject::UpdateMapCodeCache(receiver, name, code);
1728 return code; 1732 return code;
1729 } 1733 }
1730 1734
1731 1735
1732 Handle<Code> StoreIC::CompileHandler(LookupIterator* lookup, 1736 Handle<Code> StoreIC::CompileHandler(LookupIterator* lookup,
1733 Handle<Object> value, 1737 Handle<Object> value,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1814 } 1818 }
1815 break; 1819 break;
1816 } 1820 }
1817 1821
1818 case LookupIterator::DATA: { 1822 case LookupIterator::DATA: {
1819 if (lookup->is_dictionary_holder()) { 1823 if (lookup->is_dictionary_holder()) {
1820 if (holder->IsGlobalObject()) { 1824 if (holder->IsGlobalObject()) {
1821 DCHECK(holder.is_identical_to(receiver) || 1825 DCHECK(holder.is_identical_to(receiver) ||
1822 receiver->map()->prototype() == *holder); 1826 receiver->map()->prototype() == *holder);
1823 auto cell = lookup->GetPropertyCell(); 1827 auto cell = lookup->GetPropertyCell();
1824 auto union_type = PropertyCell::UpdatedType( 1828 auto updated_type = PropertyCell::UpdatedType(
1825 cell, value, lookup->property_details()); 1829 cell, value, lookup->property_details());
1826 return PropertyCellStoreHandler(isolate(), receiver, 1830 auto code = PropertyCellStoreHandler(
1827 Handle<GlobalObject>::cast(holder), 1831 isolate(), receiver, Handle<GlobalObject>::cast(holder),
1828 lookup->name(), cell, union_type); 1832 lookup->name(), cell, updated_type);
1833 return code;
1829 } 1834 }
1830 DCHECK(holder.is_identical_to(receiver)); 1835 DCHECK(holder.is_identical_to(receiver));
1831 return isolate()->builtins()->StoreIC_Normal(); 1836 return isolate()->builtins()->StoreIC_Normal();
1832 } 1837 }
1833 1838
1834 // -------------- Fields -------------- 1839 // -------------- Fields --------------
1835 if (lookup->property_details().type() == DATA) { 1840 if (lookup->property_details().type() == DATA) {
1836 bool use_stub = true; 1841 bool use_stub = true;
1837 if (lookup->representation().IsHeapObject()) { 1842 if (lookup->representation().IsHeapObject()) {
1838 // Only use a generic stub if no types need to be tracked. 1843 // Only use a generic stub if no types need to be tracked.
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after
3046 static const Address IC_utilities[] = { 3051 static const Address IC_utilities[] = {
3047 #define ADDR(name) FUNCTION_ADDR(name), 3052 #define ADDR(name) FUNCTION_ADDR(name),
3048 IC_UTIL_LIST(ADDR) NULL 3053 IC_UTIL_LIST(ADDR) NULL
3049 #undef ADDR 3054 #undef ADDR
3050 }; 3055 };
3051 3056
3052 3057
3053 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } 3058 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; }
3054 } 3059 }
3055 } // namespace v8::internal 3060 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698