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 10340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10351 void Code::MakeCodeAgeSequenceYoung(byte* sequence) { | 10351 void Code::MakeCodeAgeSequenceYoung(byte* sequence) { |
10352 PatchPlatformCodeAge(sequence, kNoAge, NO_MARKING_PARITY); | 10352 PatchPlatformCodeAge(sequence, kNoAge, NO_MARKING_PARITY); |
10353 } | 10353 } |
10354 | 10354 |
10355 | 10355 |
10356 void Code::MakeOlder(MarkingParity current_parity) { | 10356 void Code::MakeOlder(MarkingParity current_parity) { |
10357 byte* sequence = FindCodeAgeSequence(); | 10357 byte* sequence = FindCodeAgeSequence(); |
10358 if (sequence != NULL) { | 10358 if (sequence != NULL) { |
10359 Age age; | 10359 Age age; |
10360 MarkingParity code_parity; | 10360 MarkingParity code_parity; |
10361 GetCodeAgeAndParity(sequence, &age, &code_parity); | 10361 GetCodeAgeAndParity(sequence, &age, &code_parity, is_thumb_mode()); |
10362 if (age != kLastCodeAge && code_parity != current_parity) { | 10362 if (age != kLastCodeAge && code_parity != current_parity) { |
10363 PatchPlatformCodeAge(sequence, static_cast<Age>(age + 1), | 10363 PatchPlatformCodeAge(sequence, static_cast<Age>(age + 1), |
10364 current_parity); | 10364 current_parity, is_thumb_mode()); |
10365 } | 10365 } |
10366 } | 10366 } |
10367 } | 10367 } |
10368 | 10368 |
10369 | 10369 |
10370 bool Code::IsOld() { | 10370 bool Code::IsOld() { |
10371 byte* sequence = FindCodeAgeSequence(); | 10371 byte* sequence = FindCodeAgeSequence(); |
10372 if (sequence == NULL) return false; | 10372 if (sequence == NULL) return false; |
10373 Age age; | 10373 Age age; |
10374 MarkingParity parity; | 10374 MarkingParity parity; |
10375 GetCodeAgeAndParity(sequence, &age, &parity); | 10375 GetCodeAgeAndParity(sequence, &age, &parity, is_thumb_mode()); |
10376 return age >= kSexagenarianCodeAge; | 10376 return age >= kSexagenarianCodeAge; |
10377 } | 10377 } |
10378 | 10378 |
10379 | 10379 |
10380 byte* Code::FindCodeAgeSequence() { | 10380 byte* Code::FindCodeAgeSequence() { |
10381 return FLAG_age_code && | 10381 return FLAG_age_code && |
10382 prologue_offset() != kPrologueOffsetNotSet && | 10382 prologue_offset() != kPrologueOffsetNotSet && |
10383 (kind() == OPTIMIZED_FUNCTION || | 10383 (kind() == OPTIMIZED_FUNCTION || |
10384 (kind() == FUNCTION && !has_debug_break_slots())) | 10384 (kind() == FUNCTION && !has_debug_break_slots())) |
10385 ? instruction_start() + prologue_offset() | 10385 ? instruction_start() + prologue_offset() |
(...skipping 5591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15977 #define ERROR_MESSAGES_TEXTS(C, T) T, | 15977 #define ERROR_MESSAGES_TEXTS(C, T) T, |
15978 static const char* error_messages_[] = { | 15978 static const char* error_messages_[] = { |
15979 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 15979 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
15980 }; | 15980 }; |
15981 #undef ERROR_MESSAGES_TEXTS | 15981 #undef ERROR_MESSAGES_TEXTS |
15982 return error_messages_[reason]; | 15982 return error_messages_[reason]; |
15983 } | 15983 } |
15984 | 15984 |
15985 | 15985 |
15986 } } // namespace v8::internal | 15986 } } // namespace v8::internal |
OLD | NEW |