OLD | NEW |
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 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 CallOptimization call_optimization(function); | 1216 CallOptimization call_optimization(function); |
1217 NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder, | 1217 NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder, |
1218 cache_holder); | 1218 cache_holder); |
1219 if (call_optimization.is_simple_api_call() && | 1219 if (call_optimization.is_simple_api_call() && |
1220 call_optimization.IsCompatibleReceiver(receiver, holder)) { | 1220 call_optimization.IsCompatibleReceiver(receiver, holder)) { |
1221 return compiler.CompileLoadCallback(lookup->name(), | 1221 return compiler.CompileLoadCallback(lookup->name(), |
1222 call_optimization); | 1222 call_optimization); |
1223 } | 1223 } |
1224 return compiler.CompileLoadViaGetter(lookup->name(), function); | 1224 return compiler.CompileLoadViaGetter(lookup->name(), function); |
1225 } | 1225 } |
1226 // TODO(dcarney): Handle correctly. | |
1227 DCHECK(accessors->IsDeclaredAccessorInfo()); | |
1228 break; | 1226 break; |
1229 } | 1227 } |
1230 | 1228 |
1231 case LookupIterator::DATA: { | 1229 case LookupIterator::DATA: { |
1232 if (lookup->is_dictionary_holder()) { | 1230 if (lookup->is_dictionary_holder()) { |
1233 if (kind() != Code::LOAD_IC) break; | 1231 if (kind() != Code::LOAD_IC) break; |
1234 if (holder->IsGlobalObject()) { | 1232 if (holder->IsGlobalObject()) { |
1235 NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder, | 1233 NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder, |
1236 cache_holder); | 1234 cache_holder); |
1237 Handle<PropertyCell> cell = lookup->GetPropertyCell(); | 1235 Handle<PropertyCell> cell = lookup->GetPropertyCell(); |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 CallOptimization call_optimization(function); | 1723 CallOptimization call_optimization(function); |
1726 NamedStoreHandlerCompiler compiler(isolate(), receiver_type(), holder); | 1724 NamedStoreHandlerCompiler compiler(isolate(), receiver_type(), holder); |
1727 if (call_optimization.is_simple_api_call() && | 1725 if (call_optimization.is_simple_api_call() && |
1728 call_optimization.IsCompatibleReceiver(receiver, holder)) { | 1726 call_optimization.IsCompatibleReceiver(receiver, holder)) { |
1729 return compiler.CompileStoreCallback(receiver, lookup->name(), | 1727 return compiler.CompileStoreCallback(receiver, lookup->name(), |
1730 call_optimization); | 1728 call_optimization); |
1731 } | 1729 } |
1732 return compiler.CompileStoreViaSetter(receiver, lookup->name(), | 1730 return compiler.CompileStoreViaSetter(receiver, lookup->name(), |
1733 Handle<JSFunction>::cast(setter)); | 1731 Handle<JSFunction>::cast(setter)); |
1734 } | 1732 } |
1735 // TODO(dcarney): Handle correctly. | |
1736 DCHECK(accessors->IsDeclaredAccessorInfo()); | |
1737 TRACE_GENERIC_IC(isolate(), "StoreIC", "declared accessor info"); | |
1738 break; | 1733 break; |
1739 } | 1734 } |
1740 | 1735 |
1741 case LookupIterator::DATA: { | 1736 case LookupIterator::DATA: { |
1742 if (lookup->is_dictionary_holder()) { | 1737 if (lookup->is_dictionary_holder()) { |
1743 if (holder->IsGlobalObject()) { | 1738 if (holder->IsGlobalObject()) { |
1744 Handle<PropertyCell> cell = lookup->GetPropertyCell(); | 1739 Handle<PropertyCell> cell = lookup->GetPropertyCell(); |
1745 Handle<HeapType> union_type = PropertyCell::UpdatedType(cell, value); | 1740 Handle<HeapType> union_type = PropertyCell::UpdatedType(cell, value); |
1746 StoreGlobalStub stub(isolate(), union_type->IsConstant(), | 1741 StoreGlobalStub stub(isolate(), union_type->IsConstant(), |
1747 receiver->IsJSGlobalProxy()); | 1742 receiver->IsJSGlobalProxy()); |
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2972 static const Address IC_utilities[] = { | 2967 static const Address IC_utilities[] = { |
2973 #define ADDR(name) FUNCTION_ADDR(name), | 2968 #define ADDR(name) FUNCTION_ADDR(name), |
2974 IC_UTIL_LIST(ADDR) NULL | 2969 IC_UTIL_LIST(ADDR) NULL |
2975 #undef ADDR | 2970 #undef ADDR |
2976 }; | 2971 }; |
2977 | 2972 |
2978 | 2973 |
2979 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } | 2974 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } |
2980 } | 2975 } |
2981 } // namespace v8::internal | 2976 } // namespace v8::internal |
OLD | NEW |