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

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

Issue 1984043002: Remove now-incorrect DataView accessor optimization (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/crankshaft/hydrogen.cc ('k') | test/mjsunit/regress/regress-5018.js » ('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 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 case LookupIterator::ACCESSOR: { 1032 case LookupIterator::ACCESSOR: {
1033 // Use simple field loads for some well-known callback properties. 1033 // Use simple field loads for some well-known callback properties.
1034 // The method will only return true for absolute truths based on the 1034 // The method will only return true for absolute truths based on the
1035 // receiver maps. 1035 // receiver maps.
1036 int object_offset; 1036 int object_offset;
1037 if (Accessors::IsJSObjectFieldAccessor(map, lookup->name(), 1037 if (Accessors::IsJSObjectFieldAccessor(map, lookup->name(),
1038 &object_offset)) { 1038 &object_offset)) {
1039 FieldIndex index = FieldIndex::ForInObjectOffset(object_offset, *map); 1039 FieldIndex index = FieldIndex::ForInObjectOffset(object_offset, *map);
1040 return SimpleFieldLoad(index); 1040 return SimpleFieldLoad(index);
1041 } 1041 }
1042 if (Accessors::IsJSArrayBufferViewFieldAccessor(map, lookup->name(),
1043 &object_offset)) {
1044 TRACE_HANDLER_STATS(isolate(), LoadIC_ArrayBufferViewLoadFieldStub);
1045 FieldIndex index = FieldIndex::ForInObjectOffset(object_offset, *map);
1046 ArrayBufferViewLoadFieldStub stub(isolate(), index);
1047 return stub.GetCode();
1048 }
1049 1042
1050 if (IsCompatibleReceiver(lookup, map)) { 1043 if (IsCompatibleReceiver(lookup, map)) {
1051 Handle<Object> accessors = lookup->GetAccessors(); 1044 Handle<Object> accessors = lookup->GetAccessors();
1052 if (accessors->IsAccessorPair()) { 1045 if (accessors->IsAccessorPair()) {
1053 if (!holder->HasFastProperties()) { 1046 if (!holder->HasFastProperties()) {
1054 TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub); 1047 TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub);
1055 return slow_stub(); 1048 return slow_stub();
1056 } 1049 }
1057 // When debugging we need to go the slow path to flood the accessor. 1050 // When debugging we need to go the slow path to flood the accessor.
1058 if (GetSharedFunctionInfo()->HasDebugInfo()) { 1051 if (GetSharedFunctionInfo()->HasDebugInfo()) {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 it.Next(); 1167 it.Next();
1175 LookupForRead(&it); 1168 LookupForRead(&it);
1176 return compiler.CompileLoadInterceptor(&it); 1169 return compiler.CompileLoadInterceptor(&it);
1177 } 1170 }
1178 1171
1179 case LookupIterator::ACCESSOR: { 1172 case LookupIterator::ACCESSOR: {
1180 #ifdef DEBUG 1173 #ifdef DEBUG
1181 int object_offset; 1174 int object_offset;
1182 DCHECK(!Accessors::IsJSObjectFieldAccessor(map, lookup->name(), 1175 DCHECK(!Accessors::IsJSObjectFieldAccessor(map, lookup->name(),
1183 &object_offset)); 1176 &object_offset));
1184 DCHECK(!Accessors::IsJSArrayBufferViewFieldAccessor(map, lookup->name(),
1185 &object_offset));
1186 #endif 1177 #endif
1187 1178
1188 DCHECK(IsCompatibleReceiver(lookup, map)); 1179 DCHECK(IsCompatibleReceiver(lookup, map));
1189 Handle<Object> accessors = lookup->GetAccessors(); 1180 Handle<Object> accessors = lookup->GetAccessors();
1190 if (accessors->IsAccessorPair()) { 1181 if (accessors->IsAccessorPair()) {
1191 DCHECK(holder->HasFastProperties()); 1182 DCHECK(holder->HasFastProperties());
1192 DCHECK(!GetSharedFunctionInfo()->HasDebugInfo()); 1183 DCHECK(!GetSharedFunctionInfo()->HasDebugInfo());
1193 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), 1184 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(),
1194 isolate()); 1185 isolate());
1195 CallOptimization call_optimization(getter); 1186 CallOptimization call_optimization(getter);
(...skipping 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after
2994 KeyedLoadICNexus nexus(vector, vector_slot); 2985 KeyedLoadICNexus nexus(vector, vector_slot);
2995 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); 2986 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus);
2996 ic.UpdateState(receiver, key); 2987 ic.UpdateState(receiver, key);
2997 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); 2988 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key));
2998 } 2989 }
2999 2990
3000 return *result; 2991 return *result;
3001 } 2992 }
3002 } // namespace internal 2993 } // namespace internal
3003 } // namespace v8 2994 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | test/mjsunit/regress/regress-5018.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698