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 10632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10643 | 10643 |
10644 | 10644 |
10645 void Code::ClearInlineCaches(Code::Kind kind) { | 10645 void Code::ClearInlineCaches(Code::Kind kind) { |
10646 ClearInlineCaches(&kind); | 10646 ClearInlineCaches(&kind); |
10647 } | 10647 } |
10648 | 10648 |
10649 | 10649 |
10650 void Code::ClearInlineCaches(Code::Kind* kind) { | 10650 void Code::ClearInlineCaches(Code::Kind* kind) { |
10651 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) | | 10651 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) | |
10652 RelocInfo::ModeMask(RelocInfo::CONSTRUCT_CALL) | | 10652 RelocInfo::ModeMask(RelocInfo::CONSTRUCT_CALL) | |
10653 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID) | | 10653 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID); |
10654 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_CONTEXT); | |
10655 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 10654 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
10656 RelocInfo* info = it.rinfo(); | 10655 RelocInfo* info = it.rinfo(); |
10657 Code* target(Code::GetCodeFromTargetAddress(info->target_address())); | 10656 Code* target(Code::GetCodeFromTargetAddress(info->target_address())); |
10658 if (target->is_inline_cache_stub()) { | 10657 if (target->is_inline_cache_stub()) { |
10659 if (kind == NULL || *kind == target->kind()) { | 10658 if (kind == NULL || *kind == target->kind()) { |
10660 IC::Clear(this->GetIsolate(), info->pc()); | 10659 IC::Clear(this->GetIsolate(), info->pc()); |
10661 } | 10660 } |
10662 } | 10661 } |
10663 } | 10662 } |
10664 } | 10663 } |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10857 Address code_start_address = instruction_start(); | 10856 Address code_start_address = instruction_start(); |
10858 for (int i = 0; i < deopt_data->DeoptCount(); i++) { | 10857 for (int i = 0; i < deopt_data->DeoptCount(); i++) { |
10859 if (deopt_data->Pc(i)->value() == -1) continue; | 10858 if (deopt_data->Pc(i)->value() == -1) continue; |
10860 Address address = code_start_address + deopt_data->Pc(i)->value(); | 10859 Address address = code_start_address + deopt_data->Pc(i)->value(); |
10861 if (address == pc) return true; | 10860 if (address == pc) return true; |
10862 } | 10861 } |
10863 return false; | 10862 return false; |
10864 } | 10863 } |
10865 | 10864 |
10866 | 10865 |
10866 bool Code::IsContextual() { | |
10867 ASSERT(is_inline_cache_stub()); | |
10868 if (!needs_extended_extra_ic_state(kind())) { | |
Toon Verwaest
2013/12/04 23:24:45
I still argue "needs_extended_extra_ic_state" has
mvstanton
2013/12/05 13:08:54
No problem, done.
| |
10869 ExtraICState extra_state = extra_ic_state(); | |
10870 return IC::GetContextualMode(extra_state) == CONTEXTUAL; | |
10871 } | |
10872 return false; | |
10873 } | |
10874 | |
10875 | |
10867 // Identify kind of code. | 10876 // Identify kind of code. |
10868 const char* Code::Kind2String(Kind kind) { | 10877 const char* Code::Kind2String(Kind kind) { |
10869 switch (kind) { | 10878 switch (kind) { |
10870 #define CASE(name) case name: return #name; | 10879 #define CASE(name) case name: return #name; |
10871 CODE_KIND_LIST(CASE) | 10880 CODE_KIND_LIST(CASE) |
10872 #undef CASE | 10881 #undef CASE |
10873 case NUMBER_OF_KINDS: break; | 10882 case NUMBER_OF_KINDS: break; |
10874 } | 10883 } |
10875 UNREACHABLE(); | 10884 UNREACHABLE(); |
10876 return NULL; | 10885 return NULL; |
(...skipping 5774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
16651 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16660 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16652 static const char* error_messages_[] = { | 16661 static const char* error_messages_[] = { |
16653 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16662 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16654 }; | 16663 }; |
16655 #undef ERROR_MESSAGES_TEXTS | 16664 #undef ERROR_MESSAGES_TEXTS |
16656 return error_messages_[reason]; | 16665 return error_messages_[reason]; |
16657 } | 16666 } |
16658 | 16667 |
16659 | 16668 |
16660 } } // namespace v8::internal | 16669 } } // namespace v8::internal |
OLD | NEW |