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 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 break; | 1230 break; |
1231 } | 1231 } |
1232 CallOptimization call_optimization(function); | 1232 CallOptimization call_optimization(function); |
1233 NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder, | 1233 NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder, |
1234 cache_holder); | 1234 cache_holder); |
1235 if (call_optimization.is_simple_api_call() && | 1235 if (call_optimization.is_simple_api_call() && |
1236 call_optimization.IsCompatibleReceiver(receiver, holder)) { | 1236 call_optimization.IsCompatibleReceiver(receiver, holder)) { |
1237 return compiler.CompileLoadCallback(lookup->name(), call_optimization, | 1237 return compiler.CompileLoadCallback(lookup->name(), call_optimization, |
1238 lookup->GetAccessorIndex()); | 1238 lookup->GetAccessorIndex()); |
1239 } | 1239 } |
1240 int expected_arguments = | 1240 int expected_arguments = function->shared()->formal_parameter_count(); |
1241 function->shared()->internal_formal_parameter_count(); | |
1242 return compiler.CompileLoadViaGetter( | 1241 return compiler.CompileLoadViaGetter( |
1243 lookup->name(), lookup->GetAccessorIndex(), expected_arguments); | 1242 lookup->name(), lookup->GetAccessorIndex(), expected_arguments); |
1244 } | 1243 } |
1245 break; | 1244 break; |
1246 } | 1245 } |
1247 | 1246 |
1248 case LookupIterator::DATA: { | 1247 case LookupIterator::DATA: { |
1249 if (lookup->is_dictionary_holder()) { | 1248 if (lookup->is_dictionary_holder()) { |
1250 if (kind() != Code::LOAD_IC) break; | 1249 if (kind() != Code::LOAD_IC) break; |
1251 if (holder->IsGlobalObject()) { | 1250 if (holder->IsGlobalObject()) { |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1737 } | 1736 } |
1738 Handle<JSFunction> function = Handle<JSFunction>::cast(setter); | 1737 Handle<JSFunction> function = Handle<JSFunction>::cast(setter); |
1739 CallOptimization call_optimization(function); | 1738 CallOptimization call_optimization(function); |
1740 NamedStoreHandlerCompiler compiler(isolate(), receiver_type(), holder); | 1739 NamedStoreHandlerCompiler compiler(isolate(), receiver_type(), holder); |
1741 if (call_optimization.is_simple_api_call() && | 1740 if (call_optimization.is_simple_api_call() && |
1742 call_optimization.IsCompatibleReceiver(receiver, holder)) { | 1741 call_optimization.IsCompatibleReceiver(receiver, holder)) { |
1743 return compiler.CompileStoreCallback(receiver, lookup->name(), | 1742 return compiler.CompileStoreCallback(receiver, lookup->name(), |
1744 call_optimization, | 1743 call_optimization, |
1745 lookup->GetAccessorIndex()); | 1744 lookup->GetAccessorIndex()); |
1746 } | 1745 } |
1747 int expected_arguments = | 1746 int expected_arguments = function->shared()->formal_parameter_count(); |
1748 function->shared()->internal_formal_parameter_count(); | |
1749 return compiler.CompileStoreViaSetter(receiver, lookup->name(), | 1747 return compiler.CompileStoreViaSetter(receiver, lookup->name(), |
1750 lookup->GetAccessorIndex(), | 1748 lookup->GetAccessorIndex(), |
1751 expected_arguments); | 1749 expected_arguments); |
1752 } | 1750 } |
1753 break; | 1751 break; |
1754 } | 1752 } |
1755 | 1753 |
1756 case LookupIterator::DATA: { | 1754 case LookupIterator::DATA: { |
1757 if (lookup->is_dictionary_holder()) { | 1755 if (lookup->is_dictionary_holder()) { |
1758 if (holder->IsGlobalObject()) { | 1756 if (holder->IsGlobalObject()) { |
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2999 static const Address IC_utilities[] = { | 2997 static const Address IC_utilities[] = { |
3000 #define ADDR(name) FUNCTION_ADDR(name), | 2998 #define ADDR(name) FUNCTION_ADDR(name), |
3001 IC_UTIL_LIST(ADDR) NULL | 2999 IC_UTIL_LIST(ADDR) NULL |
3002 #undef ADDR | 3000 #undef ADDR |
3003 }; | 3001 }; |
3004 | 3002 |
3005 | 3003 |
3006 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } | 3004 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } |
3007 } | 3005 } |
3008 } // namespace v8::internal | 3006 } // namespace v8::internal |
OLD | NEW |