OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 10531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10542 static_cast<size_t>(desc.instr_size)); | 10542 static_cast<size_t>(desc.instr_size)); |
10543 | 10543 |
10544 // copy reloc info | 10544 // copy reloc info |
10545 CopyBytes(relocation_start(), | 10545 CopyBytes(relocation_start(), |
10546 desc.buffer + desc.buffer_size - desc.reloc_size, | 10546 desc.buffer + desc.buffer_size - desc.reloc_size, |
10547 static_cast<size_t>(desc.reloc_size)); | 10547 static_cast<size_t>(desc.reloc_size)); |
10548 | 10548 |
10549 // unbox handles and relocate | 10549 // unbox handles and relocate |
10550 intptr_t delta = instruction_start() - desc.buffer; | 10550 intptr_t delta = instruction_start() - desc.buffer; |
10551 int mode_mask = RelocInfo::kCodeTargetMask | | 10551 int mode_mask = RelocInfo::kCodeTargetMask | |
10552 RelocInfo::ModeMask(RelocInfo::DEOPT_REASON) | | |
Michael Starzinger
2015/02/04 11:30:51
This mode doesn't seem to be handled below explici
loislo
2015/02/04 14:38:50
done
| |
10552 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | | 10553 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
10553 RelocInfo::ModeMask(RelocInfo::CELL) | | 10554 RelocInfo::ModeMask(RelocInfo::CELL) | |
10554 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) | | 10555 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) | |
10555 RelocInfo::kApplyMask; | 10556 RelocInfo::kApplyMask; |
10556 // Needed to find target_object and runtime_entry on X64 | 10557 // Needed to find target_object and runtime_entry on X64 |
10557 Assembler* origin = desc.origin; | 10558 Assembler* origin = desc.origin; |
10558 AllowDeferredHandleDereference embedding_raw_address; | 10559 AllowDeferredHandleDereference embedding_raw_address; |
10559 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { | 10560 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { |
10560 RelocInfo::Mode mode = it.rinfo()->rmode(); | 10561 RelocInfo::Mode mode = it.rinfo()->rmode(); |
10561 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 10562 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10995 } | 10996 } |
10996 default: | 10997 default: |
10997 UNREACHABLE(); | 10998 UNREACHABLE(); |
10998 break; | 10999 break; |
10999 } | 11000 } |
11000 return NULL; | 11001 return NULL; |
11001 } | 11002 } |
11002 | 11003 |
11003 | 11004 |
11004 void Code::PrintDeoptLocation(FILE* out, int bailout_id) { | 11005 void Code::PrintDeoptLocation(FILE* out, int bailout_id) { |
11005 const char* last_comment = NULL; | 11006 int last_position = 0; |
11006 int mask = RelocInfo::ModeMask(RelocInfo::COMMENT) | 11007 Deoptimizer::DeoptReason last_reason = Deoptimizer::kNoReason; |
11007 | RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); | 11008 int mask = RelocInfo::ModeMask(RelocInfo::DEOPT_REASON) | |
11009 RelocInfo::ModeMask(RelocInfo::POSITION) | | |
11010 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); | |
11008 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 11011 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
11009 RelocInfo* info = it.rinfo(); | 11012 RelocInfo* info = it.rinfo(); |
11010 if (info->rmode() == RelocInfo::COMMENT) { | 11013 if (info->rmode() == RelocInfo::POSITION) { |
11011 last_comment = reinterpret_cast<const char*>(info->data()); | 11014 last_position = static_cast<int>(info->data()); |
11012 } else if (last_comment != NULL) { | 11015 } else if (info->rmode() == RelocInfo::DEOPT_REASON) { |
11016 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data()); | |
11017 } else if (last_reason != Deoptimizer::kNoReason) { | |
11013 if ((bailout_id == Deoptimizer::GetDeoptimizationId( | 11018 if ((bailout_id == Deoptimizer::GetDeoptimizationId( |
11014 GetIsolate(), info->target_address(), Deoptimizer::EAGER)) || | 11019 GetIsolate(), info->target_address(), Deoptimizer::EAGER)) || |
11015 (bailout_id == Deoptimizer::GetDeoptimizationId( | 11020 (bailout_id == Deoptimizer::GetDeoptimizationId( |
11016 GetIsolate(), info->target_address(), Deoptimizer::SOFT)) || | 11021 GetIsolate(), info->target_address(), Deoptimizer::SOFT)) || |
11017 (bailout_id == Deoptimizer::GetDeoptimizationId( | 11022 (bailout_id == Deoptimizer::GetDeoptimizationId( |
11018 GetIsolate(), info->target_address(), Deoptimizer::LAZY))) { | 11023 GetIsolate(), info->target_address(), Deoptimizer::LAZY))) { |
11019 CHECK(RelocInfo::IsRuntimeEntry(info->rmode())); | 11024 CHECK(RelocInfo::IsRuntimeEntry(info->rmode())); |
11020 PrintF(out, " %s\n", last_comment); | 11025 PrintF(out, " ;;; deoptimize at %d: %s\n", last_position, |
11026 Deoptimizer::GetDeoptReason(last_reason)); | |
11021 return; | 11027 return; |
11022 } | 11028 } |
11023 } | 11029 } |
11024 } | 11030 } |
11025 } | 11031 } |
11026 | 11032 |
11027 | 11033 |
11028 bool Code::CanDeoptAt(Address pc) { | 11034 bool Code::CanDeoptAt(Address pc) { |
11029 DeoptimizationInputData* deopt_data = | 11035 DeoptimizationInputData* deopt_data = |
11030 DeoptimizationInputData::cast(deoptimization_data()); | 11036 DeoptimizationInputData::cast(deoptimization_data()); |
(...skipping 5848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
16879 Handle<DependentCode> codes = | 16885 Handle<DependentCode> codes = |
16880 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16886 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
16881 DependentCode::kPropertyCellChangedGroup, | 16887 DependentCode::kPropertyCellChangedGroup, |
16882 info->object_wrapper()); | 16888 info->object_wrapper()); |
16883 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16889 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
16884 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16890 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
16885 cell, info->zone()); | 16891 cell, info->zone()); |
16886 } | 16892 } |
16887 | 16893 |
16888 } } // namespace v8::internal | 16894 } } // namespace v8::internal |
OLD | NEW |