| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1549 | 1549 |
| 1550 if (minimum_mementos_created) { | 1550 if (minimum_mementos_created) { |
| 1551 PretenureDecision result = ratio >= kPretenureRatio | 1551 PretenureDecision result = ratio >= kPretenureRatio |
| 1552 ? kTenure | 1552 ? kTenure |
| 1553 : kDontTenure; | 1553 : kDontTenure; |
| 1554 set_pretenure_decision(result); | 1554 set_pretenure_decision(result); |
| 1555 if (current_mode != GetPretenureMode()) { | 1555 if (current_mode != GetPretenureMode()) { |
| 1556 decision_changed = true; | 1556 decision_changed = true; |
| 1557 dependent_code()->MarkCodeForDeoptimization( | 1557 dependent_code()->MarkCodeForDeoptimization( |
| 1558 GetIsolate(), | 1558 GetIsolate(), |
| 1559 DependentCode::kAllocationSiteTenuringChangedGroup); | 1559 DependentCode::kAllocationSiteTenuringChangedGroup, |
| 1560 true); |
| 1560 } | 1561 } |
| 1561 } | 1562 } |
| 1562 | 1563 |
| 1563 if (FLAG_trace_pretenuring_statistics) { | 1564 if (FLAG_trace_pretenuring_statistics) { |
| 1564 PrintF( | 1565 PrintF( |
| 1565 "AllocationSite(%p): (created, found, ratio) (%d, %d, %f) %s => %s\n", | 1566 "AllocationSite(%p): (created, found, ratio) (%d, %d, %f) %s => %s\n", |
| 1566 static_cast<void*>(this), create_count, found_count, ratio, | 1567 static_cast<void*>(this), create_count, found_count, ratio, |
| 1567 current_mode == TENURED ? "tenured" : "not tenured", | 1568 current_mode == TENURED ? "tenured" : "not tenured", |
| 1568 GetPretenureMode() == TENURED ? "tenured" : "not tenured"); | 1569 GetPretenureMode() == TENURED ? "tenured" : "not tenured"); |
| 1569 } | 1570 } |
| (...skipping 2878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4448 | 4449 |
| 4449 | 4450 |
| 4450 void Code::set_marked_for_deoptimization(bool flag) { | 4451 void Code::set_marked_for_deoptimization(bool flag) { |
| 4451 ASSERT(kind() == OPTIMIZED_FUNCTION); | 4452 ASSERT(kind() == OPTIMIZED_FUNCTION); |
| 4452 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | 4453 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); |
| 4453 int updated = MarkedForDeoptimizationField::update(previous, flag); | 4454 int updated = MarkedForDeoptimizationField::update(previous, flag); |
| 4454 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | 4455 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); |
| 4455 } | 4456 } |
| 4456 | 4457 |
| 4457 | 4458 |
| 4459 bool Code::marked_for_reoptimization() { |
| 4460 ASSERT(kind() == OPTIMIZED_FUNCTION); |
| 4461 return MarkedForReoptimizationField::decode( |
| 4462 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); |
| 4463 } |
| 4464 |
| 4465 |
| 4466 void Code::set_marked_for_reoptimization(bool flag) { |
| 4467 ASSERT(kind() == OPTIMIZED_FUNCTION); |
| 4468 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); |
| 4469 int updated = MarkedForReoptimizationField::update(previous, flag); |
| 4470 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); |
| 4471 } |
| 4472 |
| 4473 |
| 4458 bool Code::is_inline_cache_stub() { | 4474 bool Code::is_inline_cache_stub() { |
| 4459 Kind kind = this->kind(); | 4475 Kind kind = this->kind(); |
| 4460 switch (kind) { | 4476 switch (kind) { |
| 4461 #define CASE(name) case name: return true; | 4477 #define CASE(name) case name: return true; |
| 4462 IC_KIND_LIST(CASE) | 4478 IC_KIND_LIST(CASE) |
| 4463 #undef CASE | 4479 #undef CASE |
| 4464 default: return false; | 4480 default: return false; |
| 4465 } | 4481 } |
| 4466 } | 4482 } |
| 4467 | 4483 |
| (...skipping 2290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6758 #undef READ_UINT32_FIELD | 6774 #undef READ_UINT32_FIELD |
| 6759 #undef WRITE_UINT32_FIELD | 6775 #undef WRITE_UINT32_FIELD |
| 6760 #undef READ_SHORT_FIELD | 6776 #undef READ_SHORT_FIELD |
| 6761 #undef WRITE_SHORT_FIELD | 6777 #undef WRITE_SHORT_FIELD |
| 6762 #undef READ_BYTE_FIELD | 6778 #undef READ_BYTE_FIELD |
| 6763 #undef WRITE_BYTE_FIELD | 6779 #undef WRITE_BYTE_FIELD |
| 6764 | 6780 |
| 6765 } } // namespace v8::internal | 6781 } } // namespace v8::internal |
| 6766 | 6782 |
| 6767 #endif // V8_OBJECTS_INL_H_ | 6783 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |