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

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

Issue 9572008: Implement date library functions in C++. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 V(ToFastProperties) \ 170 V(ToFastProperties) \
171 V(TransitionElementsKind) \ 171 V(TransitionElementsKind) \
172 V(Typeof) \ 172 V(Typeof) \
173 V(TypeofIsAndBranch) \ 173 V(TypeofIsAndBranch) \
174 V(UnaryMathOperation) \ 174 V(UnaryMathOperation) \
175 V(UnknownOSRValue) \ 175 V(UnknownOSRValue) \
176 V(ValueOf) \ 176 V(ValueOf) \
177 V(ForInPrepareMap) \ 177 V(ForInPrepareMap) \
178 V(ForInCacheArray) \ 178 V(ForInCacheArray) \
179 V(CheckMapValue) \ 179 V(CheckMapValue) \
180 V(LoadFieldByIndex) 180 V(LoadFieldByIndex) \
181 181 V(DateField) \
182 V(SetDateField)
182 183
183 184
184 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ 185 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
185 virtual Opcode opcode() const { return LInstruction::k##type; } \ 186 virtual Opcode opcode() const { return LInstruction::k##type; } \
186 virtual void CompileToNative(LCodeGen* generator); \ 187 virtual void CompileToNative(LCodeGen* generator); \
187 virtual const char* Mnemonic() const { return mnemonic; } \ 188 virtual const char* Mnemonic() const { return mnemonic; } \
188 static L##type* cast(LInstruction* instr) { \ 189 static L##type* cast(LInstruction* instr) { \
189 ASSERT(instr->Is##type()); \ 190 ASSERT(instr->Is##type()); \
190 return reinterpret_cast<L##type*>(instr); \ 191 return reinterpret_cast<L##type*>(instr); \
191 } 192 }
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 LValueOf(LOperand* value, LOperand* temp) { 984 LValueOf(LOperand* value, LOperand* temp) {
984 inputs_[0] = value; 985 inputs_[0] = value;
985 temps_[0] = temp; 986 temps_[0] = temp;
986 } 987 }
987 988
988 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") 989 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
989 DECLARE_HYDROGEN_ACCESSOR(ValueOf) 990 DECLARE_HYDROGEN_ACCESSOR(ValueOf)
990 }; 991 };
991 992
992 993
994 class LDateField: public LTemplateInstruction<1, 1, 1> {
995 public:
996 LDateField(LOperand* date, LOperand* temp, int index) : index_(index) {
997 inputs_[0] = date;
998 temps_[0] = temp;
999 }
1000
1001 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "date-field")
1002 DECLARE_HYDROGEN_ACCESSOR(ValueOf)
1003 int index() const { return index_; }
1004
1005 private:
1006 int index_;
1007 };
1008
1009
1010 class LSetDateField: public LTemplateInstruction<1, 2, 1> {
1011 public:
1012 LSetDateField(LOperand* date, LOperand* value, LOperand* temp, int index)
1013 : index_(index) {
1014 inputs_[0] = date;
1015 inputs_[1] = value;
1016 temps_[0] = temp;
1017 }
1018
1019 DECLARE_CONCRETE_INSTRUCTION(DateField, "date-set-field")
1020 DECLARE_HYDROGEN_ACCESSOR(DateField)
1021
1022 int index() const { return index_; }
1023
1024 private:
1025 int index_;
1026 };
1027
1028
993 class LThrow: public LTemplateInstruction<0, 1, 0> { 1029 class LThrow: public LTemplateInstruction<0, 1, 0> {
994 public: 1030 public:
995 explicit LThrow(LOperand* value) { 1031 explicit LThrow(LOperand* value) {
996 inputs_[0] = value; 1032 inputs_[0] = value;
997 } 1033 }
998 1034
999 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") 1035 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
1000 }; 1036 };
1001 1037
1002 1038
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after
2348 2384
2349 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2385 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2350 }; 2386 };
2351 2387
2352 #undef DECLARE_HYDROGEN_ACCESSOR 2388 #undef DECLARE_HYDROGEN_ACCESSOR
2353 #undef DECLARE_CONCRETE_INSTRUCTION 2389 #undef DECLARE_CONCRETE_INSTRUCTION
2354 2390
2355 } } // namespace v8::internal 2391 } } // namespace v8::internal
2356 2392
2357 #endif // V8_ARM_LITHIUM_ARM_H_ 2393 #endif // V8_ARM_LITHIUM_ARM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698