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

Side by Side Diff: src/deoptimizer.h

Issue 7310027: Add inspection of arguments for optimized frames (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Minor fixes Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/deoptimizer.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 Smi* GetState() const { return state_; } 393 Smi* GetState() const { return state_; }
394 void SetState(Smi* state) { state_ = state; } 394 void SetState(Smi* state) { state_ = state; }
395 395
396 void SetContinuation(intptr_t pc) { continuation_ = pc; } 396 void SetContinuation(intptr_t pc) { continuation_ = pc; }
397 397
398 #ifdef DEBUG 398 #ifdef DEBUG
399 Code::Kind GetKind() const { return kind_; } 399 Code::Kind GetKind() const { return kind_; }
400 void SetKind(Code::Kind kind) { kind_ = kind; } 400 void SetKind(Code::Kind kind) { kind_ = kind; }
401 #endif 401 #endif
402 402
403 // Get the incoming arguments count.
404 int ComputeParametersCount();
405
406 // Get a parameter value for an unoptimized frame.
407 Object* GetParameter(Deoptimizer* deoptimizer, int index);
408
403 // Get the expression stack height for a unoptimized frame. 409 // Get the expression stack height for a unoptimized frame.
404 unsigned GetExpressionCount(Deoptimizer* deoptimizer); 410 unsigned GetExpressionCount(Deoptimizer* deoptimizer);
405 411
406 // Get the expression stack value for an unoptimized frame. 412 // Get the expression stack value for an unoptimized frame.
407 Object* GetExpression(Deoptimizer* deoptimizer, int index); 413 Object* GetExpression(Deoptimizer* deoptimizer, int index);
408 414
409 static int registers_offset() { 415 static int registers_offset() {
410 return OFFSET_OF(FrameDescription, registers_); 416 return OFFSET_OF(FrameDescription, registers_);
411 } 417 }
412 418
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 // internally used FrameDescription objects are not GC safe so for use 661 // internally used FrameDescription objects are not GC safe so for use
656 // by the debugger frame information is copied to an object of this type. 662 // by the debugger frame information is copied to an object of this type.
657 class DeoptimizedFrameInfo : public Malloced { 663 class DeoptimizedFrameInfo : public Malloced {
658 public: 664 public:
659 DeoptimizedFrameInfo(Deoptimizer* deoptimizer, int frame_index); 665 DeoptimizedFrameInfo(Deoptimizer* deoptimizer, int frame_index);
660 virtual ~DeoptimizedFrameInfo(); 666 virtual ~DeoptimizedFrameInfo();
661 667
662 // GC support. 668 // GC support.
663 void Iterate(ObjectVisitor* v); 669 void Iterate(ObjectVisitor* v);
664 670
671 // Return the number of incoming arguments.
672 int parameters_count() { return parameters_count_; }
673
665 // Return the height of the expression stack. 674 // Return the height of the expression stack.
666 int expression_count() { return expression_count_; } 675 int expression_count() { return expression_count_; }
667 676
668 // Get the frame function. 677 // Get the frame function.
669 JSFunction* GetFunction() { 678 JSFunction* GetFunction() {
670 return function_; 679 return function_;
671 } 680 }
672 681
682 // Get an incoming argument.
683 Object* GetParameter(int index) {
684 ASSERT(0 <= index && index < parameters_count());
685 return parameters_[index];
686 }
687
673 // Get an expression from the expression stack. 688 // Get an expression from the expression stack.
674 Object* GetExpression(int index) { 689 Object* GetExpression(int index) {
675 ASSERT(0 <= index && index < expression_count()); 690 ASSERT(0 <= index && index < expression_count());
676 return expression_stack_[index]; 691 return expression_stack_[index];
677 } 692 }
678 693
679 private: 694 private:
680 // Set the frame function. 695 // Set the frame function.
681 void SetFunction(JSFunction* function) { 696 void SetFunction(JSFunction* function) {
682 function_ = function; 697 function_ = function;
683 } 698 }
684 699
700 // Set an incoming argument.
701 void SetParameter(int index, Object* obj) {
702 ASSERT(0 <= index && index < parameters_count());
703 parameters_[index] = obj;
704 }
705
685 // Set an expression on the expression stack. 706 // Set an expression on the expression stack.
686 void SetExpression(int index, Object* obj) { 707 void SetExpression(int index, Object* obj) {
687 ASSERT(0 <= index && index < expression_count()); 708 ASSERT(0 <= index && index < expression_count());
688 expression_stack_[index] = obj; 709 expression_stack_[index] = obj;
689 } 710 }
690 711
691 JSFunction* function_; 712 JSFunction* function_;
713 int parameters_count_;
692 int expression_count_; 714 int expression_count_;
715 Object** parameters_;
693 Object** expression_stack_; 716 Object** expression_stack_;
694 717
695 friend class Deoptimizer; 718 friend class Deoptimizer;
696 }; 719 };
697 #endif 720 #endif
698 721
699 } } // namespace v8::internal 722 } } // namespace v8::internal
700 723
701 #endif // V8_DEOPTIMIZER_H_ 724 #endif // V8_DEOPTIMIZER_H_
OLDNEW
« no previous file with comments | « no previous file | src/deoptimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698