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

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

Issue 2479373006: [ic] Support Api getters by data handlers. (Closed)
Patch Set: 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/ic/handler-configuration-inl.h ('k') | no next file » | 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 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 } 1358 }
1359 break; // Custom-compiled handler. 1359 break; // Custom-compiled handler.
1360 } else if (accessors->IsAccessorInfo()) { 1360 } else if (accessors->IsAccessorInfo()) {
1361 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors); 1361 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors);
1362 if (v8::ToCData<Address>(info->getter()) == nullptr) { 1362 if (v8::ToCData<Address>(info->getter()) == nullptr) {
1363 TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub); 1363 TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub);
1364 return slow_stub(); 1364 return slow_stub();
1365 } 1365 }
1366 // Ruled out by IsCompatibleReceiver() above. 1366 // Ruled out by IsCompatibleReceiver() above.
1367 DCHECK(AccessorInfo::IsCompatibleReceiverMap(isolate(), info, map)); 1367 DCHECK(AccessorInfo::IsCompatibleReceiverMap(isolate(), info, map));
1368 if (!holder->HasFastProperties()) return slow_stub(); 1368 if (!holder->HasFastProperties() ||
1369 if (receiver_is_holder) { 1369 (info->is_sloppy() && !receiver->IsJSReceiver())) {
1370 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadApiGetterStub); 1370 DCHECK(!holder->HasFastProperties() || !receiver_is_holder);
1371 int index = lookup->GetAccessorIndex();
1372 LoadApiGetterStub stub(isolate(), true, index);
1373 return stub.GetCode();
1374 }
1375 if (info->is_sloppy() && !receiver->IsJSReceiver()) {
1376 TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub); 1371 TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub);
1377 return slow_stub(); 1372 return slow_stub();
1378 } 1373 }
1374 if (FLAG_tf_load_ic_stub) {
1375 Handle<Object> smi_handler = LoadHandler::LoadApiGetter(
1376 isolate(), lookup->GetAccessorIndex());
1377 if (receiver_is_holder) {
1378 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadApiGetterDH);
1379 return smi_handler;
1380 }
1381 if (kind() != Code::LOAD_GLOBAL_IC) {
1382 TRACE_HANDLER_STATS(isolate(),
1383 LoadIC_LoadApiGetterFromPrototypeDH);
1384 return LoadFromPrototype(map, holder, lookup->name(),
1385 smi_handler);
1386 }
1387 } else {
1388 if (receiver_is_holder) {
1389 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadApiGetterStub);
1390 int index = lookup->GetAccessorIndex();
1391 LoadApiGetterStub stub(isolate(), true, index);
1392 return stub.GetCode();
1393 }
1394 }
1379 break; // Custom-compiled handler. 1395 break; // Custom-compiled handler.
1380 } 1396 }
1381 } 1397 }
1382 TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub); 1398 TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub);
1383 return slow_stub(); 1399 return slow_stub();
1384 } 1400 }
1385 1401
1386 case LookupIterator::DATA: { 1402 case LookupIterator::DATA: {
1387 if (lookup->is_dictionary_holder()) { 1403 if (lookup->is_dictionary_holder()) {
1388 if (kind() != Code::LOAD_IC && kind() != Code::LOAD_GLOBAL_IC) { 1404 if (kind() != Code::LOAD_IC && kind() != Code::LOAD_GLOBAL_IC) {
(...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after
3198 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); 3214 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state());
3199 it.Next(); 3215 it.Next();
3200 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 3216 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
3201 Object::GetProperty(&it)); 3217 Object::GetProperty(&it));
3202 } 3218 }
3203 3219
3204 return *result; 3220 return *result;
3205 } 3221 }
3206 } // namespace internal 3222 } // namespace internal
3207 } // namespace v8 3223 } // namespace v8
OLDNEW
« no previous file with comments | « src/ic/handler-configuration-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698