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 8694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8705 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 8705 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
8706 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 8706 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
8707 RelocInfo* info = it.rinfo(); | 8707 RelocInfo* info = it.rinfo(); |
8708 Object* object = info->target_object(); | 8708 Object* object = info->target_object(); |
8709 if (object->IsMap()) return Map::cast(object); | 8709 if (object->IsMap()) return Map::cast(object); |
8710 } | 8710 } |
8711 return NULL; | 8711 return NULL; |
8712 } | 8712 } |
8713 | 8713 |
8714 | 8714 |
| 8715 void Code::FindAllMaps(MapHandleList* maps) { |
| 8716 ASSERT(is_inline_cache_stub()); |
| 8717 AssertNoAllocation no_allocation; |
| 8718 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| 8719 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 8720 RelocInfo* info = it.rinfo(); |
| 8721 Object* object = info->target_object(); |
| 8722 if (object->IsMap()) maps->Add(Handle<Map>(Map::cast(object))); |
| 8723 } |
| 8724 } |
| 8725 |
| 8726 |
| 8727 Code* Code::FindFirstCode() { |
| 8728 ASSERT(is_inline_cache_stub()); |
| 8729 AssertNoAllocation no_allocation; |
| 8730 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET); |
| 8731 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 8732 RelocInfo* info = it.rinfo(); |
| 8733 return Code::GetCodeFromTargetAddress(info->target_address()); |
| 8734 } |
| 8735 return NULL; |
| 8736 } |
| 8737 |
| 8738 |
| 8739 void Code::FindAllCode(CodeHandleList* code_list, int length) { |
| 8740 ASSERT(is_inline_cache_stub()); |
| 8741 AssertNoAllocation no_allocation; |
| 8742 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET); |
| 8743 int i = 0; |
| 8744 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 8745 if (i++ == length) return; |
| 8746 RelocInfo* info = it.rinfo(); |
| 8747 Code* code = Code::GetCodeFromTargetAddress(info->target_address()); |
| 8748 ASSERT(code->is_load_stub()); |
| 8749 code_list->Add(Handle<Code>(code)); |
| 8750 } |
| 8751 UNREACHABLE(); |
| 8752 } |
| 8753 |
| 8754 |
8715 void Code::ClearInlineCaches() { | 8755 void Code::ClearInlineCaches() { |
8716 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) | | 8756 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) | |
8717 RelocInfo::ModeMask(RelocInfo::CONSTRUCT_CALL) | | 8757 RelocInfo::ModeMask(RelocInfo::CONSTRUCT_CALL) | |
8718 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID) | | 8758 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID) | |
8719 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_CONTEXT); | 8759 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_CONTEXT); |
8720 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 8760 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
8721 RelocInfo* info = it.rinfo(); | 8761 RelocInfo* info = it.rinfo(); |
8722 Code* target(Code::GetCodeFromTargetAddress(info->target_address())); | 8762 Code* target(Code::GetCodeFromTargetAddress(info->target_address())); |
8723 if (target->is_inline_cache_stub()) { | 8763 if (target->is_inline_cache_stub()) { |
8724 IC::Clear(info->pc()); | 8764 IC::Clear(info->pc()); |
(...skipping 5263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13988 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 14028 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
13989 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 14029 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
13990 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 14030 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
13991 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 14031 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
13992 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 14032 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
13993 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 14033 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
13994 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 14034 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
13995 } | 14035 } |
13996 | 14036 |
13997 } } // namespace v8::internal | 14037 } } // namespace v8::internal |
OLD | NEW |