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

Side by Side Diff: src/x87/lithium-codegen-x87.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/x64/lithium-codegen-x64.cc ('k') | test/cctest/test-cpu-profiler.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X87 7 #if V8_TARGET_ARCH_X87
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 374
375 bool LCodeGen::GenerateJumpTable() { 375 bool LCodeGen::GenerateJumpTable() {
376 Label needs_frame; 376 Label needs_frame;
377 if (jump_table_.length() > 0) { 377 if (jump_table_.length() > 0) {
378 Comment(";;; -------------------- Jump table --------------------"); 378 Comment(";;; -------------------- Jump table --------------------");
379 } 379 }
380 for (int i = 0; i < jump_table_.length(); i++) { 380 for (int i = 0; i < jump_table_.length(); i++) {
381 Deoptimizer::JumpTableEntry* table_entry = &jump_table_[i]; 381 Deoptimizer::JumpTableEntry* table_entry = &jump_table_[i];
382 __ bind(&table_entry->label); 382 __ bind(&table_entry->label);
383 Address entry = table_entry->address; 383 Address entry = table_entry->address;
384 DeoptComment(table_entry->reason); 384 DeoptComment(table_entry->deopt_info);
385 if (table_entry->needs_frame) { 385 if (table_entry->needs_frame) {
386 DCHECK(!info()->saves_caller_doubles()); 386 DCHECK(!info()->saves_caller_doubles());
387 __ push(Immediate(ExternalReference::ForDeoptEntry(entry))); 387 __ push(Immediate(ExternalReference::ForDeoptEntry(entry)));
388 if (needs_frame.is_bound()) { 388 if (needs_frame.is_bound()) {
389 __ jmp(&needs_frame); 389 __ jmp(&needs_frame);
390 } else { 390 } else {
391 __ bind(&needs_frame); 391 __ bind(&needs_frame);
392 __ push(MemOperand(ebp, StandardFrameConstants::kContextOffset)); 392 __ push(MemOperand(ebp, StandardFrameConstants::kContextOffset));
393 // This variant of deopt can only be used with stubs. Since we don't 393 // This variant of deopt can only be used with stubs. Since we don't
394 // have a function pointer to install in the stack frame that we're 394 // have a function pointer to install in the stack frame that we're
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 __ bind(&done); 1136 __ bind(&done);
1137 } 1137 }
1138 1138
1139 if (info()->ShouldTrapOnDeopt()) { 1139 if (info()->ShouldTrapOnDeopt()) {
1140 Label done; 1140 Label done;
1141 if (cc != no_condition) __ j(NegateCondition(cc), &done, Label::kNear); 1141 if (cc != no_condition) __ j(NegateCondition(cc), &done, Label::kNear);
1142 __ int3(); 1142 __ int3();
1143 __ bind(&done); 1143 __ bind(&done);
1144 } 1144 }
1145 1145
1146 Deoptimizer::Reason reason(instr->hydrogen_value()->position().raw(), 1146 Deoptimizer::DeoptInfo deopt_info(instr->hydrogen_value()->position().raw(),
1147 instr->Mnemonic(), deopt_reason); 1147 instr->Mnemonic(), deopt_reason);
1148 DCHECK(info()->IsStub() || frame_is_built_); 1148 DCHECK(info()->IsStub() || frame_is_built_);
1149 if (cc == no_condition && frame_is_built_) { 1149 if (cc == no_condition && frame_is_built_) {
1150 DeoptComment(reason); 1150 DeoptComment(deopt_info);
1151 __ call(entry, RelocInfo::RUNTIME_ENTRY); 1151 __ call(entry, RelocInfo::RUNTIME_ENTRY);
1152 } else { 1152 } else {
1153 Deoptimizer::JumpTableEntry table_entry(entry, reason, bailout_type, 1153 Deoptimizer::JumpTableEntry table_entry(entry, deopt_info, bailout_type,
1154 !frame_is_built_); 1154 !frame_is_built_);
1155 // We often have several deopts to the same entry, reuse the last 1155 // We often have several deopts to the same entry, reuse the last
1156 // jump entry if this is the case. 1156 // jump entry if this is the case.
1157 if (jump_table_.is_empty() || 1157 if (jump_table_.is_empty() ||
1158 !table_entry.IsEquivalentTo(jump_table_.last())) { 1158 !table_entry.IsEquivalentTo(jump_table_.last())) {
1159 jump_table_.Add(table_entry, zone()); 1159 jump_table_.Add(table_entry, zone());
1160 } 1160 }
1161 if (cc == no_condition) { 1161 if (cc == no_condition) {
1162 __ jmp(&jump_table_.last().label); 1162 __ jmp(&jump_table_.last().label);
1163 } else { 1163 } else {
(...skipping 5214 matching lines...) Expand 10 before | Expand all | Expand 10 after
6378 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6378 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6379 RecordSafepoint(Safepoint::kNoLazyDeopt); 6379 RecordSafepoint(Safepoint::kNoLazyDeopt);
6380 } 6380 }
6381 6381
6382 6382
6383 #undef __ 6383 #undef __
6384 6384
6385 } } // namespace v8::internal 6385 } } // namespace v8::internal
6386 6386
6387 #endif // V8_TARGET_ARCH_X87 6387 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698