OLD | NEW |
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/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 case Code::LOAD_IC: | 468 case Code::LOAD_IC: |
469 case Code::KEYED_LOAD_IC: | 469 case Code::KEYED_LOAD_IC: |
470 case Code::STORE_IC: | 470 case Code::STORE_IC: |
471 case Code::KEYED_STORE_IC: | 471 case Code::KEYED_STORE_IC: |
472 return; | 472 return; |
473 case Code::COMPARE_IC: | 473 case Code::COMPARE_IC: |
474 return CompareIC::Clear(isolate, address, target, constant_pool); | 474 return CompareIC::Clear(isolate, address, target, constant_pool); |
475 case Code::COMPARE_NIL_IC: | 475 case Code::COMPARE_NIL_IC: |
476 return CompareNilIC::Clear(address, target, constant_pool); | 476 return CompareNilIC::Clear(address, target, constant_pool); |
477 case Code::CALL_IC: // CallICs are vector-based and cleared differently. | 477 case Code::CALL_IC: // CallICs are vector-based and cleared differently. |
| 478 case Code::CONSTRUCT_IC: |
478 case Code::BINARY_OP_IC: | 479 case Code::BINARY_OP_IC: |
479 case Code::TO_BOOLEAN_IC: | 480 case Code::TO_BOOLEAN_IC: |
480 // Clearing these is tricky and does not | 481 // Clearing these is tricky and does not |
481 // make any performance difference. | 482 // make any performance difference. |
482 return; | 483 return; |
483 default: | 484 default: |
484 UNREACHABLE(); | 485 UNREACHABLE(); |
485 } | 486 } |
486 } | 487 } |
487 | 488 |
(...skipping 15 matching lines...) Expand all Loading... |
503 State state = nexus->StateFromFeedback(); | 504 State state = nexus->StateFromFeedback(); |
504 | 505 |
505 if (state != UNINITIALIZED && !feedback->IsAllocationSite()) { | 506 if (state != UNINITIALIZED && !feedback->IsAllocationSite()) { |
506 nexus->ConfigureUninitialized(); | 507 nexus->ConfigureUninitialized(); |
507 // The change in state must be processed. | 508 // The change in state must be processed. |
508 OnTypeFeedbackChanged(isolate, host, nexus->vector(), state, UNINITIALIZED); | 509 OnTypeFeedbackChanged(isolate, host, nexus->vector(), state, UNINITIALIZED); |
509 } | 510 } |
510 } | 511 } |
511 | 512 |
512 | 513 |
| 514 void ConstructIC::Clear(Isolate* isolate, Code* host, ConstructICNexus* nexus) { |
| 515 // Determine our state. |
| 516 Object* feedback = nexus->vector()->Get(nexus->slot()); |
| 517 State state = nexus->StateFromFeedback(); |
| 518 |
| 519 if (state != UNINITIALIZED && !feedback->IsAllocationSite()) { |
| 520 nexus->ConfigureUninitialized(); |
| 521 // The change in state must be processed. |
| 522 OnTypeFeedbackChanged(isolate, host, nexus->vector(), state, UNINITIALIZED); |
| 523 } |
| 524 } |
| 525 |
| 526 |
513 void LoadIC::Clear(Isolate* isolate, Code* host, LoadICNexus* nexus) { | 527 void LoadIC::Clear(Isolate* isolate, Code* host, LoadICNexus* nexus) { |
514 if (IsCleared(nexus)) return; | 528 if (IsCleared(nexus)) return; |
515 State state = nexus->StateFromFeedback(); | 529 State state = nexus->StateFromFeedback(); |
516 nexus->ConfigurePremonomorphic(); | 530 nexus->ConfigurePremonomorphic(); |
517 OnTypeFeedbackChanged(isolate, host, nexus->vector(), state, PREMONOMORPHIC); | 531 OnTypeFeedbackChanged(isolate, host, nexus->vector(), state, PREMONOMORPHIC); |
518 } | 532 } |
519 | 533 |
520 | 534 |
521 void StoreIC::Clear(Isolate* isolate, Address address, Code* target, | 535 void StoreIC::Clear(Isolate* isolate, Address address, Code* target, |
522 Address constant_pool) { | 536 Address constant_pool) { |
(...skipping 2455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2978 KeyedLoadICNexus nexus(vector, vector_slot); | 2992 KeyedLoadICNexus nexus(vector, vector_slot); |
2979 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2993 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2980 ic.UpdateState(receiver, key); | 2994 ic.UpdateState(receiver, key); |
2981 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2995 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
2982 } | 2996 } |
2983 | 2997 |
2984 return *result; | 2998 return *result; |
2985 } | 2999 } |
2986 } // namespace internal | 3000 } // namespace internal |
2987 } // namespace v8 | 3001 } // namespace v8 |
OLD | NEW |