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/ic/ic.h" | 5 #include "src/ic/ic.h" |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/api-arguments-inl.h" | 10 #include "src/api-arguments-inl.h" |
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), | 1026 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), |
1027 isolate); | 1027 isolate); |
1028 if (!getter->IsJSFunction() && !getter->IsFunctionTemplateInfo()) { | 1028 if (!getter->IsJSFunction() && !getter->IsFunctionTemplateInfo()) { |
1029 return false; | 1029 return false; |
1030 } | 1030 } |
1031 Handle<JSObject> holder = lookup->GetHolder<JSObject>(); | 1031 Handle<JSObject> holder = lookup->GetHolder<JSObject>(); |
1032 Handle<Object> receiver = lookup->GetReceiver(); | 1032 Handle<Object> receiver = lookup->GetReceiver(); |
1033 if (holder->HasFastProperties()) { | 1033 if (holder->HasFastProperties()) { |
1034 if (getter->IsJSFunction()) { | 1034 if (getter->IsJSFunction()) { |
1035 Handle<JSFunction> function = Handle<JSFunction>::cast(getter); | 1035 Handle<JSFunction> function = Handle<JSFunction>::cast(getter); |
1036 if (!receiver->IsJSObject() && function->shared()->IsUserJavaScript() && | 1036 if (!receiver->IsJSObject() && !function->shared()->IsBuiltin() && |
1037 is_sloppy(function->shared()->language_mode())) { | 1037 is_sloppy(function->shared()->language_mode())) { |
1038 // Calling sloppy non-builtins with a value as the receiver | 1038 // Calling sloppy non-builtins with a value as the receiver |
1039 // requires boxing. | 1039 // requires boxing. |
1040 return false; | 1040 return false; |
1041 } | 1041 } |
1042 } | 1042 } |
1043 CallOptimization call_optimization(getter); | 1043 CallOptimization call_optimization(getter); |
1044 if (call_optimization.is_simple_api_call() && | 1044 if (call_optimization.is_simple_api_call() && |
1045 !call_optimization.IsCompatibleReceiverMap(receiver_map, holder)) { | 1045 !call_optimization.IsCompatibleReceiverMap(receiver_map, holder)) { |
1046 return false; | 1046 return false; |
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3240 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); | 3240 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); |
3241 it.Next(); | 3241 it.Next(); |
3242 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 3242 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
3243 Object::GetProperty(&it)); | 3243 Object::GetProperty(&it)); |
3244 } | 3244 } |
3245 | 3245 |
3246 return *result; | 3246 return *result; |
3247 } | 3247 } |
3248 } // namespace internal | 3248 } // namespace internal |
3249 } // namespace v8 | 3249 } // namespace v8 |
OLD | NEW |