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

Side by Side Diff: src/x87/full-codegen-x87.cc

Issue 1236023007: X87: Debugger: use debug break slots to break at function exit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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/x87/debug-x87.cc ('k') | src/x87/macro-assembler-x87.h » ('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/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 } 454 }
455 EmitProfilingCounterDecrement(weight); 455 EmitProfilingCounterDecrement(weight);
456 Label ok; 456 Label ok;
457 __ j(positive, &ok, Label::kNear); 457 __ j(positive, &ok, Label::kNear);
458 __ push(eax); 458 __ push(eax);
459 __ call(isolate()->builtins()->InterruptCheck(), 459 __ call(isolate()->builtins()->InterruptCheck(),
460 RelocInfo::CODE_TARGET); 460 RelocInfo::CODE_TARGET);
461 __ pop(eax); 461 __ pop(eax);
462 EmitProfilingCounterReset(); 462 EmitProfilingCounterReset();
463 __ bind(&ok); 463 __ bind(&ok);
464 #ifdef DEBUG 464
465 // Add a label for checking the size of the code used for returning.
466 Label check_exit_codesize;
467 masm_->bind(&check_exit_codesize);
468 #endif
469 SetReturnPosition(function()); 465 SetReturnPosition(function());
470 __ RecordJSReturn();
471 // Do not use the leave instruction here because it is too short to
472 // patch with the code required by the debugger.
473 __ mov(esp, ebp);
474 int no_frame_start = masm_->pc_offset(); 466 int no_frame_start = masm_->pc_offset();
475 __ pop(ebp); 467 __ leave();
476 468
477 int arg_count = info_->scope()->num_parameters() + 1; 469 int arg_count = info_->scope()->num_parameters() + 1;
478 int arguments_bytes = arg_count * kPointerSize; 470 int arguments_bytes = arg_count * kPointerSize;
479 __ Ret(arguments_bytes, ecx); 471 __ Ret(arguments_bytes, ecx);
480 // Check that the size of the code used for returning is large enough
481 // for the debugger's requirements.
482 DCHECK(Assembler::kJSReturnSequenceLength <=
483 masm_->SizeOfCodeGeneratedSince(&check_exit_codesize));
484 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); 472 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset());
485 } 473 }
486 } 474 }
487 475
488 476
489 void FullCodeGenerator::EffectContext::Plug(Variable* var) const { 477 void FullCodeGenerator::EffectContext::Plug(Variable* var) const {
490 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); 478 DCHECK(var->IsStackAllocated() || var->IsContextSlot());
491 } 479 }
492 480
493 481
(...skipping 5007 matching lines...) Expand 10 before | Expand all | Expand 10 after
5501 Assembler::target_address_at(call_target_address, 5489 Assembler::target_address_at(call_target_address,
5502 unoptimized_code)); 5490 unoptimized_code));
5503 return OSR_AFTER_STACK_CHECK; 5491 return OSR_AFTER_STACK_CHECK;
5504 } 5492 }
5505 5493
5506 5494
5507 } // namespace internal 5495 } // namespace internal
5508 } // namespace v8 5496 } // namespace v8
5509 5497
5510 #endif // V8_TARGET_ARCH_X87 5498 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x87/debug-x87.cc ('k') | src/x87/macro-assembler-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698