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

Side by Side Diff: src/hydrogen-instructions.h

Issue 6606002: Merge revision 6500-6600 from bleeding_edge to the isolates branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 years, 9 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
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 V(MaterializedLiteral) \ 57 V(MaterializedLiteral) \
58 V(Phi) \ 58 V(Phi) \
59 V(StoreKeyed) \ 59 V(StoreKeyed) \
60 V(StoreNamed) \ 60 V(StoreNamed) \
61 V(UnaryControlInstruction) \ 61 V(UnaryControlInstruction) \
62 V(UnaryOperation) \ 62 V(UnaryOperation) \
63 HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) 63 HYDROGEN_CONCRETE_INSTRUCTION_LIST(V)
64 64
65 65
66 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \ 66 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \
67 V(AbnormalExit) \
67 V(AccessArgumentsAt) \ 68 V(AccessArgumentsAt) \
68 V(Add) \ 69 V(Add) \
69 V(ApplyArguments) \ 70 V(ApplyArguments) \
70 V(ArgumentsElements) \ 71 V(ArgumentsElements) \
71 V(ArgumentsLength) \ 72 V(ArgumentsLength) \
72 V(ArgumentsObject) \ 73 V(ArgumentsObject) \
73 V(ArrayLiteral) \ 74 V(ArrayLiteral) \
74 V(BitAnd) \ 75 V(BitAnd) \
75 V(BitNot) \ 76 V(BitNot) \
76 V(BitOr) \ 77 V(BitOr) \
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 class HReturn: public HUnaryControlInstruction { 828 class HReturn: public HUnaryControlInstruction {
828 public: 829 public:
829 explicit HReturn(HValue* value) 830 explicit HReturn(HValue* value)
830 : HUnaryControlInstruction(value, NULL, NULL) { 831 : HUnaryControlInstruction(value, NULL, NULL) {
831 } 832 }
832 833
833 DECLARE_CONCRETE_INSTRUCTION(Return, "return") 834 DECLARE_CONCRETE_INSTRUCTION(Return, "return")
834 }; 835 };
835 836
836 837
837 class HThrow: public HUnaryControlInstruction { 838 class HAbnormalExit: public HControlInstruction {
838 public: 839 public:
839 explicit HThrow(HValue* value) 840 HAbnormalExit() : HControlInstruction(NULL, NULL) { }
840 : HUnaryControlInstruction(value, NULL, NULL) { }
841 841
842 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") 842 DECLARE_CONCRETE_INSTRUCTION(AbnormalExit, "abnormal_exit")
843 }; 843 };
844 844
845 845
846 class HUnaryOperation: public HInstruction { 846 class HUnaryOperation: public HInstruction {
847 public: 847 public:
848 explicit HUnaryOperation(HValue* value) { 848 explicit HUnaryOperation(HValue* value) {
849 SetOperandAt(0, value); 849 SetOperandAt(0, value);
850 } 850 }
851 851
852 HValue* value() const { return OperandAt(0); } 852 HValue* value() const { return OperandAt(0); }
853 virtual void PrintDataTo(StringStream* stream) const; 853 virtual void PrintDataTo(StringStream* stream) const;
854 virtual int OperandCount() const { return 1; } 854 virtual int OperandCount() const { return 1; }
855 virtual HValue* OperandAt(int index) const { return operands_[index]; } 855 virtual HValue* OperandAt(int index) const { return operands_[index]; }
856 856
857 DECLARE_INSTRUCTION(UnaryOperation) 857 DECLARE_INSTRUCTION(UnaryOperation)
858 858
859 protected: 859 protected:
860 virtual void InternalSetOperandAt(int index, HValue* value) { 860 virtual void InternalSetOperandAt(int index, HValue* value) {
861 operands_[index] = value; 861 operands_[index] = value;
862 } 862 }
863 863
864 private: 864 private:
865 HOperandVector<1> operands_; 865 HOperandVector<1> operands_;
866 }; 866 };
867 867
868 868
869 class HThrow: public HUnaryOperation {
870 public:
871 explicit HThrow(HValue* value) : HUnaryOperation(value) {
872 SetAllSideEffects();
873 }
874
875 virtual Representation RequiredInputRepresentation(int index) const {
876 return Representation::Tagged();
877 }
878
879 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
880 };
881
882
869 class HChange: public HUnaryOperation { 883 class HChange: public HUnaryOperation {
870 public: 884 public:
871 HChange(HValue* value, 885 HChange(HValue* value,
872 Representation from, 886 Representation from,
873 Representation to) 887 Representation to)
874 : HUnaryOperation(value), from_(from), to_(to) { 888 : HUnaryOperation(value), from_(from), to_(to) {
875 ASSERT(!from.IsNone() && !to.IsNone()); 889 ASSERT(!from.IsNone() && !to.IsNone());
876 ASSERT(!from.Equals(to)); 890 ASSERT(!from.Equals(to));
877 set_representation(to); 891 set_representation(to);
878 SetFlag(kUseGVN); 892 SetFlag(kUseGVN);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 int environment_length_; 996 int environment_length_;
983 ZoneList<HValue*> values_; 997 ZoneList<HValue*> values_;
984 ZoneList<int> assigned_indexes_; 998 ZoneList<int> assigned_indexes_;
985 }; 999 };
986 1000
987 1001
988 class HStackCheck: public HInstruction { 1002 class HStackCheck: public HInstruction {
989 public: 1003 public:
990 HStackCheck() { } 1004 HStackCheck() { }
991 1005
992 DECLARE_CONCRETE_INSTRUCTION(Throw, "stack_check") 1006 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack_check")
993 }; 1007 };
994 1008
995 1009
996 class HEnterInlined: public HInstruction { 1010 class HEnterInlined: public HInstruction {
997 public: 1011 public:
998 HEnterInlined(Handle<JSFunction> closure, FunctionLiteral* function) 1012 HEnterInlined(Handle<JSFunction> closure, FunctionLiteral* function)
999 : closure_(closure), function_(function) { 1013 : closure_(closure), function_(function) {
1000 } 1014 }
1001 1015
1002 virtual void PrintDataTo(StringStream* stream) const; 1016 virtual void PrintDataTo(StringStream* stream) const;
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
1825 public: 1839 public:
1826 HApplyArguments(HValue* function, 1840 HApplyArguments(HValue* function,
1827 HValue* receiver, 1841 HValue* receiver,
1828 HValue* length, 1842 HValue* length,
1829 HValue* elements) { 1843 HValue* elements) {
1830 set_representation(Representation::Tagged()); 1844 set_representation(Representation::Tagged());
1831 SetOperandAt(0, function); 1845 SetOperandAt(0, function);
1832 SetOperandAt(1, receiver); 1846 SetOperandAt(1, receiver);
1833 SetOperandAt(2, length); 1847 SetOperandAt(2, length);
1834 SetOperandAt(3, elements); 1848 SetOperandAt(3, elements);
1849 SetAllSideEffects();
1835 } 1850 }
1836 1851
1837 virtual Representation RequiredInputRepresentation(int index) const { 1852 virtual Representation RequiredInputRepresentation(int index) const {
1838 // The length is untagged, all other inputs are tagged. 1853 // The length is untagged, all other inputs are tagged.
1839 return (index == 2) 1854 return (index == 2)
1840 ? Representation::Integer32() 1855 ? Representation::Integer32()
1841 : Representation::Tagged(); 1856 : Representation::Tagged();
1842 } 1857 }
1843 1858
1844 HValue* function() const { return OperandAt(0); } 1859 HValue* function() const { return OperandAt(0); }
1845 HValue* receiver() const { return OperandAt(1); } 1860 HValue* receiver() const { return OperandAt(1); }
1846 HValue* length() const { return OperandAt(2); } 1861 HValue* length() const { return OperandAt(2); }
1847 HValue* elements() const { return OperandAt(3); } 1862 HValue* elements() const { return OperandAt(3); }
1848 1863
1849 virtual int OperandCount() const { return operands_.length(); } 1864 virtual int OperandCount() const { return operands_.length(); }
1850 virtual HValue* OperandAt(int index) const { return operands_[index]; } 1865 virtual HValue* OperandAt(int index) const { return operands_[index]; }
1851 1866
1852 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply_arguments") 1867 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply_arguments")
1853 1868
1854
1855
1856 protected: 1869 protected:
1857 virtual void InternalSetOperandAt(int index, HValue* value) { 1870 virtual void InternalSetOperandAt(int index, HValue* value) {
1858 operands_[index] = value; 1871 operands_[index] = value;
1859 } 1872 }
1860 1873
1861 private: 1874 private:
1862 HOperandVector<4> operands_; 1875 HOperandVector<4> operands_;
1863 }; 1876 };
1864 1877
1865 1878
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
2569 } 2582 }
2570 2583
2571 private: 2584 private:
2572 Handle<JSGlobalPropertyCell> cell_; 2585 Handle<JSGlobalPropertyCell> cell_;
2573 bool check_hole_value_; 2586 bool check_hole_value_;
2574 }; 2587 };
2575 2588
2576 2589
2577 class HStoreGlobal: public HUnaryOperation { 2590 class HStoreGlobal: public HUnaryOperation {
2578 public: 2591 public:
2579 HStoreGlobal(HValue* value, Handle<JSGlobalPropertyCell> cell) 2592 HStoreGlobal(HValue* value,
2580 : HUnaryOperation(value), cell_(cell) { 2593 Handle<JSGlobalPropertyCell> cell,
2594 bool check_hole_value)
2595 : HUnaryOperation(value),
2596 cell_(cell),
2597 check_hole_value_(check_hole_value) {
2581 SetFlag(kChangesGlobalVars); 2598 SetFlag(kChangesGlobalVars);
2582 } 2599 }
2583 2600
2584 Handle<JSGlobalPropertyCell> cell() const { return cell_; } 2601 Handle<JSGlobalPropertyCell> cell() const { return cell_; }
2602 bool check_hole_value() const { return check_hole_value_; }
2585 2603
2586 virtual Representation RequiredInputRepresentation(int index) const { 2604 virtual Representation RequiredInputRepresentation(int index) const {
2587 return Representation::Tagged(); 2605 return Representation::Tagged();
2588 } 2606 }
2589 virtual void PrintDataTo(StringStream* stream) const; 2607 virtual void PrintDataTo(StringStream* stream) const;
2590 2608
2591 DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store_global") 2609 DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store_global")
2592 2610
2593 private: 2611 private:
2594 Handle<JSGlobalPropertyCell> cell_; 2612 Handle<JSGlobalPropertyCell> cell_;
2613 bool check_hole_value_;
2595 }; 2614 };
2596 2615
2597 2616
2598 class HLoadContextSlot: public HInstruction { 2617 class HLoadContextSlot: public HInstruction {
2599 public: 2618 public:
2600 HLoadContextSlot(int context_chain_length , int slot_index) 2619 HLoadContextSlot(int context_chain_length , int slot_index)
2601 : context_chain_length_(context_chain_length), slot_index_(slot_index) { 2620 : context_chain_length_(context_chain_length), slot_index_(slot_index) {
2602 set_representation(Representation::Tagged()); 2621 set_representation(Representation::Tagged());
2603 SetFlag(kUseGVN); 2622 SetFlag(kUseGVN);
2604 SetFlag(kDependsOnCalls); 2623 SetFlag(kDependsOnCalls);
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
3061 bool pretenure_; 3080 bool pretenure_;
3062 }; 3081 };
3063 3082
3064 3083
3065 class HTypeof: public HUnaryOperation { 3084 class HTypeof: public HUnaryOperation {
3066 public: 3085 public:
3067 explicit HTypeof(HValue* value) : HUnaryOperation(value) { 3086 explicit HTypeof(HValue* value) : HUnaryOperation(value) {
3068 set_representation(Representation::Tagged()); 3087 set_representation(Representation::Tagged());
3069 } 3088 }
3070 3089
3090 virtual Representation RequiredInputRepresentation(int index) const {
3091 return Representation::Tagged();
3092 }
3093
3071 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") 3094 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
3072 }; 3095 };
3073 3096
3074 3097
3075 class HValueOf: public HUnaryOperation { 3098 class HValueOf: public HUnaryOperation {
3076 public: 3099 public:
3077 explicit HValueOf(HValue* value) : HUnaryOperation(value) { 3100 explicit HValueOf(HValue* value) : HUnaryOperation(value) {
3078 set_representation(Representation::Tagged()); 3101 set_representation(Representation::Tagged());
3079 } 3102 }
3080 3103
(...skipping 18 matching lines...) Expand all
3099 HValue* object() const { return left(); } 3122 HValue* object() const { return left(); }
3100 HValue* key() const { return right(); } 3123 HValue* key() const { return right(); }
3101 }; 3124 };
3102 3125
3103 #undef DECLARE_INSTRUCTION 3126 #undef DECLARE_INSTRUCTION
3104 #undef DECLARE_CONCRETE_INSTRUCTION 3127 #undef DECLARE_CONCRETE_INSTRUCTION
3105 3128
3106 } } // namespace v8::internal 3129 } } // namespace v8::internal
3107 3130
3108 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 3131 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« src/ast.cc ('K') | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698