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

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: minor change Created 5 years, 10 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
« no previous file with comments | « src/mips64/lithium-codegen-mips64.cc ('k') | src/ppc/lithium-codegen-ppc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10989 matching lines...) Expand 10 before | Expand all | Expand 10 after
11000 } 11000 }
11001 default: 11001 default:
11002 UNREACHABLE(); 11002 UNREACHABLE();
11003 break; 11003 break;
11004 } 11004 }
11005 return NULL; 11005 return NULL;
11006 } 11006 }
11007 11007
11008 11008
11009 void Code::PrintDeoptLocation(FILE* out, int bailout_id) { 11009 void Code::PrintDeoptLocation(FILE* out, int bailout_id) {
11010 const char* last_comment = NULL; 11010 int last_position = 0;
11011 int mask = RelocInfo::ModeMask(RelocInfo::COMMENT) 11011 Deoptimizer::DeoptReason last_reason = Deoptimizer::kNoReason;
11012 | RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); 11012 int mask = RelocInfo::ModeMask(RelocInfo::DEOPT_REASON) |
11013 RelocInfo::ModeMask(RelocInfo::POSITION) |
11014 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
11013 for (RelocIterator it(this, mask); !it.done(); it.next()) { 11015 for (RelocIterator it(this, mask); !it.done(); it.next()) {
11014 RelocInfo* info = it.rinfo(); 11016 RelocInfo* info = it.rinfo();
11015 if (info->rmode() == RelocInfo::COMMENT) { 11017 if (info->rmode() == RelocInfo::POSITION) {
11016 last_comment = reinterpret_cast<const char*>(info->data()); 11018 last_position = static_cast<int>(info->data());
11017 } else if (last_comment != NULL) { 11019 } else if (info->rmode() == RelocInfo::DEOPT_REASON) {
11020 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data());
11021 } else if (last_reason != Deoptimizer::kNoReason) {
11018 if ((bailout_id == Deoptimizer::GetDeoptimizationId( 11022 if ((bailout_id == Deoptimizer::GetDeoptimizationId(
11019 GetIsolate(), info->target_address(), Deoptimizer::EAGER)) || 11023 GetIsolate(), info->target_address(), Deoptimizer::EAGER)) ||
11020 (bailout_id == Deoptimizer::GetDeoptimizationId( 11024 (bailout_id == Deoptimizer::GetDeoptimizationId(
11021 GetIsolate(), info->target_address(), Deoptimizer::SOFT)) || 11025 GetIsolate(), info->target_address(), Deoptimizer::SOFT)) ||
11022 (bailout_id == Deoptimizer::GetDeoptimizationId( 11026 (bailout_id == Deoptimizer::GetDeoptimizationId(
11023 GetIsolate(), info->target_address(), Deoptimizer::LAZY))) { 11027 GetIsolate(), info->target_address(), Deoptimizer::LAZY))) {
11024 CHECK(RelocInfo::IsRuntimeEntry(info->rmode())); 11028 CHECK(RelocInfo::IsRuntimeEntry(info->rmode()));
11025 PrintF(out, " %s\n", last_comment); 11029 PrintF(out, " ;;; deoptimize at %d: %s\n", last_position,
11030 Deoptimizer::GetDeoptReason(last_reason));
11026 return; 11031 return;
11027 } 11032 }
11028 } 11033 }
11029 } 11034 }
11030 } 11035 }
11031 11036
11032 11037
11033 bool Code::CanDeoptAt(Address pc) { 11038 bool Code::CanDeoptAt(Address pc) {
11034 DeoptimizationInputData* deopt_data = 11039 DeoptimizationInputData* deopt_data =
11035 DeoptimizationInputData::cast(deoptimization_data()); 11040 DeoptimizationInputData::cast(deoptimization_data());
(...skipping 5839 matching lines...) Expand 10 before | Expand all | Expand 10 after
16875 Handle<DependentCode> codes = 16880 Handle<DependentCode> codes =
16876 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), 16881 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()),
16877 DependentCode::kPropertyCellChangedGroup, 16882 DependentCode::kPropertyCellChangedGroup,
16878 info->object_wrapper()); 16883 info->object_wrapper());
16879 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); 16884 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
16880 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( 16885 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
16881 cell, info->zone()); 16886 cell, info->zone());
16882 } 16887 }
16883 16888
16884 } } // namespace v8::internal 16889 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips64/lithium-codegen-mips64.cc ('k') | src/ppc/lithium-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698