OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 8734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8745 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 8745 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
8746 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 8746 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
8747 RelocInfo* info = it.rinfo(); | 8747 RelocInfo* info = it.rinfo(); |
8748 Object* object = info->target_object(); | 8748 Object* object = info->target_object(); |
8749 if (object->IsMap()) return Map::cast(object); | 8749 if (object->IsMap()) return Map::cast(object); |
8750 } | 8750 } |
8751 return NULL; | 8751 return NULL; |
8752 } | 8752 } |
8753 | 8753 |
8754 | 8754 |
| 8755 void Code::FindAllMaps(MapHandleList* maps) { |
| 8756 ASSERT(is_inline_cache_stub()); |
| 8757 AssertNoAllocation no_allocation; |
| 8758 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| 8759 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 8760 RelocInfo* info = it.rinfo(); |
| 8761 Object* object = info->target_object(); |
| 8762 if (object->IsMap()) maps->Add(Handle<Map>(Map::cast(object))); |
| 8763 } |
| 8764 } |
| 8765 |
| 8766 |
| 8767 Code* Code::FindFirstCode() { |
| 8768 ASSERT(is_inline_cache_stub()); |
| 8769 AssertNoAllocation no_allocation; |
| 8770 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET); |
| 8771 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 8772 RelocInfo* info = it.rinfo(); |
| 8773 return Code::GetCodeFromTargetAddress(info->target_address()); |
| 8774 } |
| 8775 return NULL; |
| 8776 } |
| 8777 |
| 8778 |
| 8779 void Code::FindAllCode(CodeHandleList* code_list, int length) { |
| 8780 ASSERT(is_inline_cache_stub()); |
| 8781 AssertNoAllocation no_allocation; |
| 8782 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET); |
| 8783 int i = 0; |
| 8784 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 8785 if (i++ == length) return; |
| 8786 RelocInfo* info = it.rinfo(); |
| 8787 Code* code = Code::GetCodeFromTargetAddress(info->target_address()); |
| 8788 ASSERT(code->is_load_stub()); |
| 8789 code_list->Add(Handle<Code>(code)); |
| 8790 } |
| 8791 UNREACHABLE(); |
| 8792 } |
| 8793 |
| 8794 |
8755 void Code::ClearInlineCaches() { | 8795 void Code::ClearInlineCaches() { |
8756 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) | | 8796 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) | |
8757 RelocInfo::ModeMask(RelocInfo::CONSTRUCT_CALL) | | 8797 RelocInfo::ModeMask(RelocInfo::CONSTRUCT_CALL) | |
8758 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID) | | 8798 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID) | |
8759 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_CONTEXT); | 8799 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_CONTEXT); |
8760 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 8800 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
8761 RelocInfo* info = it.rinfo(); | 8801 RelocInfo* info = it.rinfo(); |
8762 Code* target(Code::GetCodeFromTargetAddress(info->target_address())); | 8802 Code* target(Code::GetCodeFromTargetAddress(info->target_address())); |
8763 if (target->is_inline_cache_stub()) { | 8803 if (target->is_inline_cache_stub()) { |
8764 IC::Clear(info->pc()); | 8804 IC::Clear(info->pc()); |
(...skipping 5267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14032 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 14072 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
14033 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 14073 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
14034 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 14074 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
14035 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 14075 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
14036 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 14076 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
14037 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 14077 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
14038 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 14078 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
14039 } | 14079 } |
14040 | 14080 |
14041 } } // namespace v8::internal | 14081 } } // namespace v8::internal |
OLD | NEW |