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

Side by Side Diff: src/arm/lithium-arm.h

Issue 6410120: Refactor lithium instructions for constants.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/lithium-arm.cc » ('j') | src/x64/lithium-x64.h » ('J')
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 23 matching lines...) Expand all
34 #include "safepoint-table.h" 34 #include "safepoint-table.h"
35 35
36 namespace v8 { 36 namespace v8 {
37 namespace internal { 37 namespace internal {
38 38
39 // Forward declarations. 39 // Forward declarations.
40 class LCodeGen; 40 class LCodeGen;
41 41
42 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ 42 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \
43 V(ControlInstruction) \ 43 V(ControlInstruction) \
44 V(Constant) \
45 V(Call) \ 44 V(Call) \
46 V(StoreKeyed) \ 45 V(StoreKeyed) \
47 V(StoreNamed) \ 46 V(StoreNamed) \
48 LITHIUM_CONCRETE_INSTRUCTION_LIST(V) 47 LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
49 48
50 49
51 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ 50 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \
52 V(AccessArgumentsAt) \ 51 V(AccessArgumentsAt) \
53 V(AddI) \ 52 V(AddI) \
54 V(ApplyArguments) \ 53 V(ApplyArguments) \
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 LSubI(LOperand* left, LOperand* right) { 895 LSubI(LOperand* left, LOperand* right) {
897 inputs_[0] = left; 896 inputs_[0] = left;
898 inputs_[1] = right; 897 inputs_[1] = right;
899 } 898 }
900 899
901 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") 900 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
902 DECLARE_HYDROGEN_ACCESSOR(Sub) 901 DECLARE_HYDROGEN_ACCESSOR(Sub)
903 }; 902 };
904 903
905 904
906 class LConstant: public LTemplateInstruction<1, 0, 0> { 905 class LConstantI: public LTemplateInstruction<1, 0, 0> {
907 DECLARE_INSTRUCTION(Constant) 906 public:
907 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
908 DECLARE_HYDROGEN_ACCESSOR(Constant)
909
910 int32_t value() const { return hydrogen()->Integer32Value(); }
908 }; 911 };
909 912
910 913
911 class LConstantI: public LConstant { 914 class LConstantD: public LTemplateInstruction<1, 0, 0> {
912 public: 915 public:
913 explicit LConstantI(int32_t value) : value_(value) { } 916 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
914 int32_t value() const { return value_; } 917 DECLARE_HYDROGEN_ACCESSOR(Constant)
915 918
916 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i") 919 double value() const { return hydrogen()->DoubleValue(); }
917
918 private:
919 int32_t value_;
920 }; 920 };
921 921
922 922
923 class LConstantD: public LConstant { 923 class LConstantT: public LTemplateInstruction<1, 0, 0> {
924 public: 924 public:
925 explicit LConstantD(double value) : value_(value) { } 925 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
926 double value() const { return value_; } 926 DECLARE_HYDROGEN_ACCESSOR(Constant)
927 927
928 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") 928 Handle<Object> value() const { return hydrogen()->handle(); }
929
930 private:
931 double value_;
932 }; 929 };
933 930
934 931
935 class LConstantT: public LConstant {
936 public:
937 explicit LConstantT(Handle<Object> value) : value_(value) { }
938 Handle<Object> value() const { return value_; }
939
940 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
941
942 private:
943 Handle<Object> value_;
944 };
945
946
947 class LBranch: public LControlInstruction<1, 0> { 932 class LBranch: public LControlInstruction<1, 0> {
948 public: 933 public:
949 explicit LBranch(LOperand* value) { 934 explicit LBranch(LOperand* value) {
950 inputs_[0] = value; 935 inputs_[0] = value;
951 } 936 }
952 937
953 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") 938 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
954 DECLARE_HYDROGEN_ACCESSOR(Value) 939 DECLARE_HYDROGEN_ACCESSOR(Value)
955 940
956 virtual void PrintDataTo(StringStream* stream); 941 virtual void PrintDataTo(StringStream* stream);
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after
1970 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 1955 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
1971 }; 1956 };
1972 1957
1973 #undef DECLARE_HYDROGEN_ACCESSOR 1958 #undef DECLARE_HYDROGEN_ACCESSOR
1974 #undef DECLARE_INSTRUCTION 1959 #undef DECLARE_INSTRUCTION
1975 #undef DECLARE_CONCRETE_INSTRUCTION 1960 #undef DECLARE_CONCRETE_INSTRUCTION
1976 1961
1977 } } // namespace v8::internal 1962 } } // namespace v8::internal
1978 1963
1979 #endif // V8_ARM_LITHIUM_ARM_H_ 1964 #endif // V8_ARM_LITHIUM_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-arm.cc » ('j') | src/x64/lithium-x64.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698