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

Side by Side Diff: src/ia32/lithium-ia32.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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 V(ToFastProperties) \ 165 V(ToFastProperties) \
166 V(TransitionElementsKind) \ 166 V(TransitionElementsKind) \
167 V(Typeof) \ 167 V(Typeof) \
168 V(TypeofIsAndBranch) \ 168 V(TypeofIsAndBranch) \
169 V(UnaryMathOperation) \ 169 V(UnaryMathOperation) \
170 V(UnknownOSRValue) \ 170 V(UnknownOSRValue) \
171 V(ValueOf) \ 171 V(ValueOf) \
172 V(ForInPrepareMap) \ 172 V(ForInPrepareMap) \
173 V(ForInCacheArray) \ 173 V(ForInCacheArray) \
174 V(CheckMapValue) \ 174 V(CheckMapValue) \
175 V(LoadFieldByIndex) 175 V(LoadFieldByIndex) \
176 V(DateField) \
177 V(SetDateField)
176 178
177 179
178 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ 180 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
179 virtual Opcode opcode() const { return LInstruction::k##type; } \ 181 virtual Opcode opcode() const { return LInstruction::k##type; } \
180 virtual void CompileToNative(LCodeGen* generator); \ 182 virtual void CompileToNative(LCodeGen* generator); \
181 virtual const char* Mnemonic() const { return mnemonic; } \ 183 virtual const char* Mnemonic() const { return mnemonic; } \
182 static L##type* cast(LInstruction* instr) { \ 184 static L##type* cast(LInstruction* instr) { \
183 ASSERT(instr->Is##type()); \ 185 ASSERT(instr->Is##type()); \
184 return reinterpret_cast<L##type*>(instr); \ 186 return reinterpret_cast<L##type*>(instr); \
185 } 187 }
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 LValueOf(LOperand* value, LOperand* temp) { 997 LValueOf(LOperand* value, LOperand* temp) {
996 inputs_[0] = value; 998 inputs_[0] = value;
997 temps_[0] = temp; 999 temps_[0] = temp;
998 } 1000 }
999 1001
1000 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") 1002 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
1001 DECLARE_HYDROGEN_ACCESSOR(ValueOf) 1003 DECLARE_HYDROGEN_ACCESSOR(ValueOf)
1002 }; 1004 };
1003 1005
1004 1006
1007 class LDateField: public LTemplateInstruction<1, 1, 1> {
1008 public:
1009 LDateField(LOperand* date, LOperand* temp, int index) : index_(index) {
1010 inputs_[0] = date;
1011 temps_[0] = temp;
1012 }
1013
1014 DECLARE_CONCRETE_INSTRUCTION(DateField, "date-field")
1015 DECLARE_HYDROGEN_ACCESSOR(DateField)
1016
1017 int index() const { return index_; }
1018
1019 private:
1020 int index_;
1021 };
1022
1023
1024 class LSetDateField: public LTemplateInstruction<1, 2, 1> {
1025 public:
1026 LSetDateField(LOperand* date, LOperand* value, LOperand* temp, int index)
1027 : index_(index) {
1028 inputs_[0] = date;
1029 inputs_[1] = value;
1030 temps_[0] = temp;
1031 }
1032
1033 DECLARE_CONCRETE_INSTRUCTION(DateField, "date-set-field")
1034 DECLARE_HYDROGEN_ACCESSOR(DateField)
1035
1036 int index() const { return index_; }
1037
1038 private:
1039 int index_;
1040 };
1041
1042
1005 class LThrow: public LTemplateInstruction<0, 2, 0> { 1043 class LThrow: public LTemplateInstruction<0, 2, 0> {
1006 public: 1044 public:
1007 LThrow(LOperand* context, LOperand* value) { 1045 LThrow(LOperand* context, LOperand* value) {
1008 inputs_[0] = context; 1046 inputs_[0] = context;
1009 inputs_[1] = value; 1047 inputs_[1] = value;
1010 } 1048 }
1011 1049
1012 LOperand* context() { return inputs_[0]; } 1050 LOperand* context() { return inputs_[0]; }
1013 LOperand* value() { return inputs_[1]; } 1051 LOperand* value() { return inputs_[1]; }
1014 1052
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after
2473 2511
2474 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2512 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2475 }; 2513 };
2476 2514
2477 #undef DECLARE_HYDROGEN_ACCESSOR 2515 #undef DECLARE_HYDROGEN_ACCESSOR
2478 #undef DECLARE_CONCRETE_INSTRUCTION 2516 #undef DECLARE_CONCRETE_INSTRUCTION
2479 2517
2480 } } // namespace v8::internal 2518 } } // namespace v8::internal
2481 2519
2482 #endif // V8_IA32_LITHIUM_IA32_H_ 2520 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698