| 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 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 if (!holder->HasFastProperties()) break; | 1193 if (!holder->HasFastProperties()) break; |
| 1194 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); | 1194 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); |
| 1195 return compiler.CompileLoadCallback(lookup->name(), info); | 1195 return compiler.CompileLoadCallback(lookup->name(), info); |
| 1196 } | 1196 } |
| 1197 if (accessors->IsAccessorPair()) { | 1197 if (accessors->IsAccessorPair()) { |
| 1198 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), | 1198 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), |
| 1199 isolate()); | 1199 isolate()); |
| 1200 if (!getter->IsJSFunction()) break; | 1200 if (!getter->IsJSFunction()) break; |
| 1201 if (!holder->HasFastProperties()) break; | 1201 if (!holder->HasFastProperties()) break; |
| 1202 // When debugging we need to go the slow path to flood the accessor. | 1202 // When debugging we need to go the slow path to flood the accessor. |
| 1203 if (!GetSharedFunctionInfo()->debug_info()->IsUndefined()) break; | 1203 if (GetSharedFunctionInfo()->HasDebugInfo()) break; |
| 1204 Handle<JSFunction> function = Handle<JSFunction>::cast(getter); | 1204 Handle<JSFunction> function = Handle<JSFunction>::cast(getter); |
| 1205 if (!receiver->IsJSObject() && !function->IsBuiltin() && | 1205 if (!receiver->IsJSObject() && !function->IsBuiltin() && |
| 1206 is_sloppy(function->shared()->language_mode())) { | 1206 is_sloppy(function->shared()->language_mode())) { |
| 1207 // Calling sloppy non-builtins with a value as the receiver | 1207 // Calling sloppy non-builtins with a value as the receiver |
| 1208 // requires boxing. | 1208 // requires boxing. |
| 1209 break; | 1209 break; |
| 1210 } | 1210 } |
| 1211 CallOptimization call_optimization(function); | 1211 CallOptimization call_optimization(function); |
| 1212 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); | 1212 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); |
| 1213 if (call_optimization.is_simple_api_call()) { | 1213 if (call_optimization.is_simple_api_call()) { |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1775 NamedStoreHandlerCompiler compiler(isolate(), receiver_map(), holder); | 1775 NamedStoreHandlerCompiler compiler(isolate(), receiver_map(), holder); |
| 1776 return compiler.CompileStoreCallback(receiver, lookup->name(), info); | 1776 return compiler.CompileStoreCallback(receiver, lookup->name(), info); |
| 1777 } else if (accessors->IsAccessorPair()) { | 1777 } else if (accessors->IsAccessorPair()) { |
| 1778 Handle<Object> setter(Handle<AccessorPair>::cast(accessors)->setter(), | 1778 Handle<Object> setter(Handle<AccessorPair>::cast(accessors)->setter(), |
| 1779 isolate()); | 1779 isolate()); |
| 1780 if (!setter->IsJSFunction()) { | 1780 if (!setter->IsJSFunction()) { |
| 1781 TRACE_GENERIC_IC(isolate(), "StoreIC", "setter not a function"); | 1781 TRACE_GENERIC_IC(isolate(), "StoreIC", "setter not a function"); |
| 1782 break; | 1782 break; |
| 1783 } | 1783 } |
| 1784 // When debugging we need to go the slow path to flood the accessor. | 1784 // When debugging we need to go the slow path to flood the accessor. |
| 1785 if (!GetSharedFunctionInfo()->debug_info()->IsUndefined()) break; | 1785 if (GetSharedFunctionInfo()->HasDebugInfo()) break; |
| 1786 Handle<JSFunction> function = Handle<JSFunction>::cast(setter); | 1786 Handle<JSFunction> function = Handle<JSFunction>::cast(setter); |
| 1787 CallOptimization call_optimization(function); | 1787 CallOptimization call_optimization(function); |
| 1788 NamedStoreHandlerCompiler compiler(isolate(), receiver_map(), holder); | 1788 NamedStoreHandlerCompiler compiler(isolate(), receiver_map(), holder); |
| 1789 if (call_optimization.is_simple_api_call() && | 1789 if (call_optimization.is_simple_api_call() && |
| 1790 call_optimization.IsCompatibleReceiver(receiver, holder)) { | 1790 call_optimization.IsCompatibleReceiver(receiver, holder)) { |
| 1791 return compiler.CompileStoreCallback(receiver, lookup->name(), | 1791 return compiler.CompileStoreCallback(receiver, lookup->name(), |
| 1792 call_optimization, | 1792 call_optimization, |
| 1793 lookup->GetAccessorIndex()); | 1793 lookup->GetAccessorIndex()); |
| 1794 } | 1794 } |
| 1795 int expected_arguments = | 1795 int expected_arguments = |
| (...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3092 static const Address IC_utilities[] = { | 3092 static const Address IC_utilities[] = { |
| 3093 #define ADDR(name) FUNCTION_ADDR(name), | 3093 #define ADDR(name) FUNCTION_ADDR(name), |
| 3094 IC_UTIL_LIST(ADDR) NULL | 3094 IC_UTIL_LIST(ADDR) NULL |
| 3095 #undef ADDR | 3095 #undef ADDR |
| 3096 }; | 3096 }; |
| 3097 | 3097 |
| 3098 | 3098 |
| 3099 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } | 3099 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } |
| 3100 } // namespace internal | 3100 } // namespace internal |
| 3101 } // namespace v8 | 3101 } // namespace v8 |
| OLD | NEW |