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

Side by Side Diff: src/objects.cc

Issue 910773002: Propagate Deopt reason to cpu-profiler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: comments addressed 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 11066 matching lines...) Expand 10 before | Expand all | Expand 10 after
11077 } 11077 }
11078 default: 11078 default:
11079 UNREACHABLE(); 11079 UNREACHABLE();
11080 break; 11080 break;
11081 } 11081 }
11082 return NULL; 11082 return NULL;
11083 } 11083 }
11084 11084
11085 11085
11086 void Code::PrintDeoptLocation(FILE* out, int bailout_id) { 11086 void Code::PrintDeoptLocation(FILE* out, int bailout_id) {
11087 int last_position = 0; 11087 Deoptimizer::DeoptInfo info = Deoptimizer::GetDeoptInfo(this, bailout_id);
11088 Deoptimizer::DeoptReason last_reason = Deoptimizer::kNoReason; 11088 if (info.deopt_reason != Deoptimizer::kNoReason || info.raw_position != 0) {
11089 int mask = RelocInfo::ModeMask(RelocInfo::DEOPT_REASON) | 11089 PrintF(out, " ;;; deoptimize at %d: %s\n", info.raw_position,
11090 RelocInfo::ModeMask(RelocInfo::POSITION) | 11090 Deoptimizer::GetDeoptReason(info.deopt_reason));
11091 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
11092 for (RelocIterator it(this, mask); !it.done(); it.next()) {
11093 RelocInfo* info = it.rinfo();
11094 if (info->rmode() == RelocInfo::POSITION) {
11095 last_position = static_cast<int>(info->data());
11096 } else if (info->rmode() == RelocInfo::DEOPT_REASON) {
11097 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data());
11098 } else if (last_reason != Deoptimizer::kNoReason) {
11099 if ((bailout_id == Deoptimizer::GetDeoptimizationId(
11100 GetIsolate(), info->target_address(), Deoptimizer::EAGER)) ||
11101 (bailout_id == Deoptimizer::GetDeoptimizationId(
11102 GetIsolate(), info->target_address(), Deoptimizer::SOFT)) ||
11103 (bailout_id == Deoptimizer::GetDeoptimizationId(
11104 GetIsolate(), info->target_address(), Deoptimizer::LAZY))) {
11105 CHECK(RelocInfo::IsRuntimeEntry(info->rmode()));
11106 PrintF(out, " ;;; deoptimize at %d: %s\n", last_position,
11107 Deoptimizer::GetDeoptReason(last_reason));
11108 return;
11109 }
11110 }
11111 } 11091 }
11112 } 11092 }
11113 11093
11114 11094
11115 bool Code::CanDeoptAt(Address pc) { 11095 bool Code::CanDeoptAt(Address pc) {
11116 DeoptimizationInputData* deopt_data = 11096 DeoptimizationInputData* deopt_data =
11117 DeoptimizationInputData::cast(deoptimization_data()); 11097 DeoptimizationInputData::cast(deoptimization_data());
11118 Address code_start_address = instruction_start(); 11098 Address code_start_address = instruction_start();
11119 for (int i = 0; i < deopt_data->DeoptCount(); i++) { 11099 for (int i = 0; i < deopt_data->DeoptCount(); i++) {
11120 if (deopt_data->Pc(i)->value() == -1) continue; 11100 if (deopt_data->Pc(i)->value() == -1) continue;
(...skipping 5839 matching lines...) Expand 10 before | Expand all | Expand 10 after
16960 Handle<DependentCode> codes = 16940 Handle<DependentCode> codes =
16961 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), 16941 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()),
16962 DependentCode::kPropertyCellChangedGroup, 16942 DependentCode::kPropertyCellChangedGroup,
16963 info->object_wrapper()); 16943 info->object_wrapper());
16964 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); 16944 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
16965 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( 16945 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
16966 cell, info->zone()); 16946 cell, info->zone());
16967 } 16947 }
16968 16948
16969 } } // namespace v8::internal 16949 } } // 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