Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: src/ic/ic.cc

Issue 2505853003: Refactor SharedFunctionInfo::IsBuiltin. (Closed)
Patch Set: rebase Created 4 years, 1 month 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/heap/objects-visiting-inl.h ('k') | src/isolate.cc » ('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/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
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()->IsBuiltin() && 1036 if (!receiver->IsJSObject() && function->shared()->IsUserJavaScript() &&
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 2188 matching lines...) Expand 10 before | Expand all | Expand 10 after
3235 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); 3235 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state());
3236 it.Next(); 3236 it.Next();
3237 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 3237 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
3238 Object::GetProperty(&it)); 3238 Object::GetProperty(&it));
3239 } 3239 }
3240 3240
3241 return *result; 3241 return *result;
3242 } 3242 }
3243 } // namespace internal 3243 } // namespace internal
3244 } // namespace v8 3244 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/objects-visiting-inl.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698