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

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

Issue 1895093002: Create per-descriptor-index LoadApiGetterStub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 8 months 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/compiler/code-assembler.cc ('k') | src/objects.h » ('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 "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/api-arguments.h" 9 #include "src/api-arguments.h"
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 if (accessors->IsAccessorPair()) { 1037 if (accessors->IsAccessorPair()) {
1038 if (!holder->HasFastProperties()) break; 1038 if (!holder->HasFastProperties()) break;
1039 // When debugging we need to go the slow path to flood the accessor. 1039 // When debugging we need to go the slow path to flood the accessor.
1040 if (GetSharedFunctionInfo()->HasDebugInfo()) break; 1040 if (GetSharedFunctionInfo()->HasDebugInfo()) break;
1041 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), 1041 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(),
1042 isolate()); 1042 isolate());
1043 CallOptimization call_optimization(getter); 1043 CallOptimization call_optimization(getter);
1044 NamedLoadHandlerCompiler compiler(isolate(), map, holder, 1044 NamedLoadHandlerCompiler compiler(isolate(), map, holder,
1045 cache_holder); 1045 cache_holder);
1046 if (call_optimization.is_simple_api_call()) { 1046 if (call_optimization.is_simple_api_call()) {
1047 return compiler.CompileLoadCallback( 1047 int index = lookup->GetAccessorIndex();
1048 lookup->name(), call_optimization, lookup->GetAccessorIndex()); 1048 return compiler.CompileLoadCallback(lookup->name(),
1049 call_optimization, index);
1049 } 1050 }
1050 int expected_arguments = Handle<JSFunction>::cast(getter) 1051 int expected_arguments = Handle<JSFunction>::cast(getter)
1051 ->shared() 1052 ->shared()
1052 ->internal_formal_parameter_count(); 1053 ->internal_formal_parameter_count();
1053 return compiler.CompileLoadViaGetter( 1054 return compiler.CompileLoadViaGetter(
1054 lookup->name(), lookup->GetAccessorIndex(), expected_arguments); 1055 lookup->name(), lookup->GetAccessorIndex(), expected_arguments);
1055 } else if (accessors->IsAccessorInfo()) { 1056 } else if (accessors->IsAccessorInfo()) {
1056 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors); 1057 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors);
1057 if (v8::ToCData<Address>(info->getter()) == 0) break; 1058 if (v8::ToCData<Address>(info->getter()) == nullptr) break;
1058 if (!AccessorInfo::IsCompatibleReceiverMap(isolate(), info, map)) { 1059 if (!AccessorInfo::IsCompatibleReceiverMap(isolate(), info, map)) {
1059 // This case should be already handled in LoadIC::UpdateCaches. 1060 // This case should be already handled in LoadIC::UpdateCaches.
1060 UNREACHABLE(); 1061 UNREACHABLE();
1061 break; 1062 break;
1062 } 1063 }
1063 if (!holder->HasFastProperties()) break; 1064 if (!holder->HasFastProperties()) break;
1065 if (receiver_is_holder) {
1066 int index = lookup->GetAccessorIndex();
1067 LoadApiGetterStub stub(isolate(), true, index);
1068 return stub.GetCode();
1069 }
1064 NamedLoadHandlerCompiler compiler(isolate(), map, holder, 1070 NamedLoadHandlerCompiler compiler(isolate(), map, holder,
1065 cache_holder); 1071 cache_holder);
1066 return compiler.CompileLoadCallback(lookup->name(), info); 1072 return compiler.CompileLoadCallback(lookup->name(), info);
1067 } 1073 }
1068 } 1074 }
1069 break; 1075 break;
1070 } 1076 }
1071 1077
1072 case LookupIterator::DATA: { 1078 case LookupIterator::DATA: {
1073 if (lookup->is_dictionary_holder()) { 1079 if (lookup->is_dictionary_holder()) {
(...skipping 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after
2743 KeyedLoadICNexus nexus(vector, vector_slot); 2749 KeyedLoadICNexus nexus(vector, vector_slot);
2744 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); 2750 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus);
2745 ic.UpdateState(receiver, key); 2751 ic.UpdateState(receiver, key);
2746 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); 2752 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key));
2747 } 2753 }
2748 2754
2749 return *result; 2755 return *result;
2750 } 2756 }
2751 } // namespace internal 2757 } // namespace internal
2752 } // namespace v8 2758 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/code-assembler.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698