| 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 10281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10292 byte* Code::FindCodeAgeSequence() { | 10292 byte* Code::FindCodeAgeSequence() { |
| 10293 return FLAG_age_code && | 10293 return FLAG_age_code && |
| 10294 prologue_offset() != kPrologueOffsetNotSet && | 10294 prologue_offset() != kPrologueOffsetNotSet && |
| 10295 (kind() == OPTIMIZED_FUNCTION || | 10295 (kind() == OPTIMIZED_FUNCTION || |
| 10296 (kind() == FUNCTION && !has_debug_break_slots())) | 10296 (kind() == FUNCTION && !has_debug_break_slots())) |
| 10297 ? instruction_start() + prologue_offset() | 10297 ? instruction_start() + prologue_offset() |
| 10298 : NULL; | 10298 : NULL; |
| 10299 } | 10299 } |
| 10300 | 10300 |
| 10301 | 10301 |
| 10302 int Code::GetAge() { |
| 10303 byte* sequence = FindCodeAgeSequence(); |
| 10304 if (sequence == NULL) { |
| 10305 return Code::kNoAge; |
| 10306 } |
| 10307 Age age; |
| 10308 MarkingParity parity; |
| 10309 GetCodeAgeAndParity(sequence, &age, &parity); |
| 10310 return age; |
| 10311 } |
| 10312 |
| 10313 |
| 10302 void Code::GetCodeAgeAndParity(Code* code, Age* age, | 10314 void Code::GetCodeAgeAndParity(Code* code, Age* age, |
| 10303 MarkingParity* parity) { | 10315 MarkingParity* parity) { |
| 10304 Isolate* isolate = Isolate::Current(); | 10316 Isolate* isolate = Isolate::Current(); |
| 10305 Builtins* builtins = isolate->builtins(); | 10317 Builtins* builtins = isolate->builtins(); |
| 10306 Code* stub = NULL; | 10318 Code* stub = NULL; |
| 10307 #define HANDLE_CODE_AGE(AGE) \ | 10319 #define HANDLE_CODE_AGE(AGE) \ |
| 10308 stub = *builtins->Make##AGE##CodeYoungAgainEvenMarking(); \ | 10320 stub = *builtins->Make##AGE##CodeYoungAgainEvenMarking(); \ |
| 10309 if (code == stub) { \ | 10321 if (code == stub) { \ |
| 10310 *age = k##AGE##CodeAge; \ | 10322 *age = k##AGE##CodeAge; \ |
| 10311 *parity = EVEN_MARKING_PARITY; \ | 10323 *parity = EVEN_MARKING_PARITY; \ |
| (...skipping 5392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15704 | 15716 |
| 15705 | 15717 |
| 15706 void JSTypedArray::Neuter() { | 15718 void JSTypedArray::Neuter() { |
| 15707 set_byte_offset(Smi::FromInt(0)); | 15719 set_byte_offset(Smi::FromInt(0)); |
| 15708 set_byte_length(Smi::FromInt(0)); | 15720 set_byte_length(Smi::FromInt(0)); |
| 15709 set_length(Smi::FromInt(0)); | 15721 set_length(Smi::FromInt(0)); |
| 15710 set_elements(GetHeap()->EmptyExternalArrayForMap(map())); | 15722 set_elements(GetHeap()->EmptyExternalArrayForMap(map())); |
| 15711 } | 15723 } |
| 15712 | 15724 |
| 15713 } } // namespace v8::internal | 15725 } } // namespace v8::internal |
| OLD | NEW |