Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: src/objects.cc

Issue 874323003: Externalize deoptimization reasons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10513 matching lines...) Expand 10 before | Expand all | Expand 10 after
10524 static_cast<size_t>(desc.instr_size)); 10524 static_cast<size_t>(desc.instr_size));
10525 10525
10526 // copy reloc info 10526 // copy reloc info
10527 CopyBytes(relocation_start(), 10527 CopyBytes(relocation_start(),
10528 desc.buffer + desc.buffer_size - desc.reloc_size, 10528 desc.buffer + desc.buffer_size - desc.reloc_size,
10529 static_cast<size_t>(desc.reloc_size)); 10529 static_cast<size_t>(desc.reloc_size));
10530 10530
10531 // unbox handles and relocate 10531 // unbox handles and relocate
10532 intptr_t delta = instruction_start() - desc.buffer; 10532 intptr_t delta = instruction_start() - desc.buffer;
10533 int mode_mask = RelocInfo::kCodeTargetMask | 10533 int mode_mask = RelocInfo::kCodeTargetMask |
10534 RelocInfo::ModeMask(RelocInfo::DEOPT_REASON) |
10534 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | 10535 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
10535 RelocInfo::ModeMask(RelocInfo::CELL) | 10536 RelocInfo::ModeMask(RelocInfo::CELL) |
10536 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) | 10537 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) |
10537 RelocInfo::kApplyMask; 10538 RelocInfo::kApplyMask;
10538 // Needed to find target_object and runtime_entry on X64 10539 // Needed to find target_object and runtime_entry on X64
10539 Assembler* origin = desc.origin; 10540 Assembler* origin = desc.origin;
10540 AllowDeferredHandleDereference embedding_raw_address; 10541 AllowDeferredHandleDereference embedding_raw_address;
10541 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { 10542 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) {
10542 RelocInfo::Mode mode = it.rinfo()->rmode(); 10543 RelocInfo::Mode mode = it.rinfo()->rmode();
10543 if (mode == RelocInfo::EMBEDDED_OBJECT) { 10544 if (mode == RelocInfo::EMBEDDED_OBJECT) {
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
10977 } 10978 }
10978 default: 10979 default:
10979 UNREACHABLE(); 10980 UNREACHABLE();
10980 break; 10981 break;
10981 } 10982 }
10982 return NULL; 10983 return NULL;
10983 } 10984 }
10984 10985
10985 10986
10986 void Code::PrintDeoptLocation(FILE* out, int bailout_id) { 10987 void Code::PrintDeoptLocation(FILE* out, int bailout_id) {
10987 const char* last_comment = NULL; 10988 int last_position = 0;
10988 int mask = RelocInfo::ModeMask(RelocInfo::COMMENT) 10989 Deoptimizer::DeoptReason last_reason = Deoptimizer::kNoReason;
10989 | RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); 10990 int mask = RelocInfo::ModeMask(RelocInfo::DEOPT_REASON) |
10991 RelocInfo::ModeMask(RelocInfo::POSITION) |
10992 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
10990 for (RelocIterator it(this, mask); !it.done(); it.next()) { 10993 for (RelocIterator it(this, mask); !it.done(); it.next()) {
10991 RelocInfo* info = it.rinfo(); 10994 RelocInfo* info = it.rinfo();
10992 if (info->rmode() == RelocInfo::COMMENT) { 10995 if (info->rmode() == RelocInfo::POSITION) {
10993 last_comment = reinterpret_cast<const char*>(info->data()); 10996 last_position = reinterpret_cast<int>(info->data());
10994 } else if (last_comment != NULL) { 10997 } else if (info->rmode() == RelocInfo::DEOPT_REASON) {
10998 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data());
10999 } else if (last_reason != Deoptimizer::kNoReason) {
10995 if ((bailout_id == Deoptimizer::GetDeoptimizationId( 11000 if ((bailout_id == Deoptimizer::GetDeoptimizationId(
10996 GetIsolate(), info->target_address(), Deoptimizer::EAGER)) || 11001 GetIsolate(), info->target_address(), Deoptimizer::EAGER)) ||
10997 (bailout_id == Deoptimizer::GetDeoptimizationId( 11002 (bailout_id == Deoptimizer::GetDeoptimizationId(
10998 GetIsolate(), info->target_address(), Deoptimizer::SOFT)) || 11003 GetIsolate(), info->target_address(), Deoptimizer::SOFT)) ||
10999 (bailout_id == Deoptimizer::GetDeoptimizationId( 11004 (bailout_id == Deoptimizer::GetDeoptimizationId(
11000 GetIsolate(), info->target_address(), Deoptimizer::LAZY))) { 11005 GetIsolate(), info->target_address(), Deoptimizer::LAZY))) {
11001 CHECK(RelocInfo::IsRuntimeEntry(info->rmode())); 11006 CHECK(RelocInfo::IsRuntimeEntry(info->rmode()));
11002 PrintF(out, " %s\n", last_comment); 11007 PrintF(out, " ;;; deoptimize at %d: %s\n", last_position,
11008 Deoptimizer::GetDeoptReason(last_reason));
11003 return; 11009 return;
11004 } 11010 }
11005 } 11011 }
11006 } 11012 }
11007 } 11013 }
11008 11014
11009 11015
11010 bool Code::CanDeoptAt(Address pc) { 11016 bool Code::CanDeoptAt(Address pc) {
11011 DeoptimizationInputData* deopt_data = 11017 DeoptimizationInputData* deopt_data =
11012 DeoptimizationInputData::cast(deoptimization_data()); 11018 DeoptimizationInputData::cast(deoptimization_data());
(...skipping 5825 matching lines...) Expand 10 before | Expand all | Expand 10 after
16838 Handle<DependentCode> codes = 16844 Handle<DependentCode> codes =
16839 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), 16845 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()),
16840 DependentCode::kPropertyCellChangedGroup, 16846 DependentCode::kPropertyCellChangedGroup,
16841 info->object_wrapper()); 16847 info->object_wrapper());
16842 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); 16848 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
16843 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( 16849 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
16844 cell, info->zone()); 16850 cell, info->zone());
16845 } 16851 }
16846 16852
16847 } } // namespace v8::internal 16853 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698