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

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

Issue 1966853004: Don't compile code for LoadICs if the receiver is primitive (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates 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 | « no previous file | test/cctest/test-accessors.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 "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 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 // This case should be already handled in LoadIC::UpdateCaches. 1068 // This case should be already handled in LoadIC::UpdateCaches.
1069 UNREACHABLE(); 1069 UNREACHABLE();
1070 break; 1070 break;
1071 } 1071 }
1072 if (!holder->HasFastProperties()) break; 1072 if (!holder->HasFastProperties()) break;
1073 if (receiver_is_holder) { 1073 if (receiver_is_holder) {
1074 int index = lookup->GetAccessorIndex(); 1074 int index = lookup->GetAccessorIndex();
1075 LoadApiGetterStub stub(isolate(), true, index); 1075 LoadApiGetterStub stub(isolate(), true, index);
1076 return stub.GetCode(); 1076 return stub.GetCode();
1077 } 1077 }
1078 if (info->is_sloppy() && !receiver->IsJSReceiver()) break;
1078 NamedLoadHandlerCompiler compiler(isolate(), map, holder, 1079 NamedLoadHandlerCompiler compiler(isolate(), map, holder,
1079 cache_holder); 1080 cache_holder);
1080 return compiler.CompileLoadCallback(lookup->name(), info); 1081 return compiler.CompileLoadCallback(lookup->name(), info);
1081 } 1082 }
1082 } 1083 }
1083 break; 1084 break;
1084 } 1085 }
1085 1086
1086 case LookupIterator::DATA: { 1087 case LookupIterator::DATA: {
1087 if (lookup->is_dictionary_holder()) { 1088 if (lookup->is_dictionary_holder()) {
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 !lookup->HolderIsReceiverOrHiddenPrototype()) { 1545 !lookup->HolderIsReceiverOrHiddenPrototype()) {
1545 TRACE_GENERIC_IC(isolate(), "StoreIC", 1546 TRACE_GENERIC_IC(isolate(), "StoreIC",
1546 "special data property in prototype chain"); 1547 "special data property in prototype chain");
1547 break; 1548 break;
1548 } 1549 }
1549 if (!AccessorInfo::IsCompatibleReceiverMap(isolate(), info, 1550 if (!AccessorInfo::IsCompatibleReceiverMap(isolate(), info,
1550 receiver_map())) { 1551 receiver_map())) {
1551 TRACE_GENERIC_IC(isolate(), "StoreIC", "incompatible receiver type"); 1552 TRACE_GENERIC_IC(isolate(), "StoreIC", "incompatible receiver type");
1552 break; 1553 break;
1553 } 1554 }
1555 if (info->is_sloppy() && !receiver->IsJSReceiver()) break;
1554 NamedStoreHandlerCompiler compiler(isolate(), receiver_map(), holder); 1556 NamedStoreHandlerCompiler compiler(isolate(), receiver_map(), holder);
1555 return compiler.CompileStoreCallback(receiver, lookup->name(), info, 1557 return compiler.CompileStoreCallback(receiver, lookup->name(), info,
1556 language_mode()); 1558 language_mode());
1557 } else if (accessors->IsAccessorPair()) { 1559 } else if (accessors->IsAccessorPair()) {
1558 Handle<Object> setter(Handle<AccessorPair>::cast(accessors)->setter(), 1560 Handle<Object> setter(Handle<AccessorPair>::cast(accessors)->setter(),
1559 isolate()); 1561 isolate());
1560 if (!setter->IsJSFunction() && !setter->IsFunctionTemplateInfo()) { 1562 if (!setter->IsJSFunction() && !setter->IsFunctionTemplateInfo()) {
1561 TRACE_GENERIC_IC(isolate(), "StoreIC", "setter not a function"); 1563 TRACE_GENERIC_IC(isolate(), "StoreIC", "setter not a function");
1562 break; 1564 break;
1563 } 1565 }
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
2744 KeyedLoadICNexus nexus(vector, vector_slot); 2746 KeyedLoadICNexus nexus(vector, vector_slot);
2745 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); 2747 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus);
2746 ic.UpdateState(receiver, key); 2748 ic.UpdateState(receiver, key);
2747 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); 2749 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key));
2748 } 2750 }
2749 2751
2750 return *result; 2752 return *result;
2751 } 2753 }
2752 } // namespace internal 2754 } // namespace internal
2753 } // namespace v8 2755 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-accessors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698