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

Side by Side Diff: src/deoptimizer.h

Issue 25480003: Refactor translation opcode a little in the deoptimization (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 void Skip(int n) { 672 void Skip(int n) {
673 for (int i = 0; i < n; i++) Next(); 673 for (int i = 0; i < n; i++) Next();
674 } 674 }
675 675
676 private: 676 private:
677 ByteArray* buffer_; 677 ByteArray* buffer_;
678 int index_; 678 int index_;
679 }; 679 };
680 680
681 681
682 #define TRANSLATION_OPCODE_LIST(V) \
683 V(BEGIN) \
684 V(JS_FRAME) \
685 V(CONSTRUCT_STUB_FRAME) \
686 V(GETTER_STUB_FRAME) \
687 V(SETTER_STUB_FRAME) \
688 V(ARGUMENTS_ADAPTOR_FRAME) \
689 V(COMPILED_STUB_FRAME) \
690 V(DUPLICATED_OBJECT) \
691 V(ARGUMENTS_OBJECT) \
692 V(CAPTURED_OBJECT) \
693 V(REGISTER) \
694 V(INT32_REGISTER) \
695 V(UINT32_REGISTER) \
696 V(DOUBLE_REGISTER) \
697 V(STACK_SLOT) \
698 V(INT32_STACK_SLOT) \
699 V(UINT32_STACK_SLOT) \
700 V(DOUBLE_STACK_SLOT) \
701 V(LITERAL)
702
703
682 class Translation BASE_EMBEDDED { 704 class Translation BASE_EMBEDDED {
683 public: 705 public:
706 #define DECLARE_TRANSLATION_OPCODE_ENUM(item) item,
684 enum Opcode { 707 enum Opcode {
685 BEGIN, 708 TRANSLATION_OPCODE_LIST(DECLARE_TRANSLATION_OPCODE_ENUM)
686 JS_FRAME, 709 LAST = LITERAL
687 CONSTRUCT_STUB_FRAME,
688 GETTER_STUB_FRAME,
689 SETTER_STUB_FRAME,
690 ARGUMENTS_ADAPTOR_FRAME,
691 COMPILED_STUB_FRAME,
692 DUPLICATED_OBJECT,
693 ARGUMENTS_OBJECT,
694 CAPTURED_OBJECT,
695 REGISTER,
696 INT32_REGISTER,
697 UINT32_REGISTER,
698 DOUBLE_REGISTER,
699 STACK_SLOT,
700 INT32_STACK_SLOT,
701 UINT32_STACK_SLOT,
702 DOUBLE_STACK_SLOT,
703 LITERAL
704 }; 710 };
711 #undef DECLARE_TRANSLATION_OPCODE_ENUM
705 712
706 Translation(TranslationBuffer* buffer, int frame_count, int jsframe_count, 713 Translation(TranslationBuffer* buffer, int frame_count, int jsframe_count,
707 Zone* zone) 714 Zone* zone)
708 : buffer_(buffer), 715 : buffer_(buffer),
709 index_(buffer->CurrentIndex()), 716 index_(buffer->CurrentIndex()),
710 zone_(zone) { 717 zone_(zone) {
711 buffer_->Add(BEGIN, zone); 718 buffer_->Add(BEGIN, zone);
712 buffer_->Add(frame_count, zone); 719 buffer_->Add(frame_count, zone);
713 buffer_->Add(jsframe_count, zone); 720 buffer_->Add(jsframe_count, zone);
714 } 721 }
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 Object** expression_stack_; 922 Object** expression_stack_;
916 int source_position_; 923 int source_position_;
917 924
918 friend class Deoptimizer; 925 friend class Deoptimizer;
919 }; 926 };
920 #endif 927 #endif
921 928
922 } } // namespace v8::internal 929 } } // namespace v8::internal
923 930
924 #endif // V8_DEOPTIMIZER_H_ 931 #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