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

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

Issue 9425045: Support fast case for-in in Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: port to x64&arm, cleanup Created 8 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
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(SubI) \ 165 V(SubI) \
166 V(TaggedToI) \ 166 V(TaggedToI) \
167 V(ThisFunction) \ 167 V(ThisFunction) \
168 V(Throw) \ 168 V(Throw) \
169 V(ToFastProperties) \ 169 V(ToFastProperties) \
170 V(TransitionElementsKind) \ 170 V(TransitionElementsKind) \
171 V(Typeof) \ 171 V(Typeof) \
172 V(TypeofIsAndBranch) \ 172 V(TypeofIsAndBranch) \
173 V(UnaryMathOperation) \ 173 V(UnaryMathOperation) \
174 V(UnknownOSRValue) \ 174 V(UnknownOSRValue) \
175 V(ValueOf) 175 V(ValueOf) \
176 V(ForInPrepareMap) \
177 V(ForInCacheArray) \
178 V(CheckMapValue) \
179 V(LoadFieldByIndex)
176 180
177 181
178 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ 182 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
179 virtual Opcode opcode() const { return LInstruction::k##type; } \ 183 virtual Opcode opcode() const { return LInstruction::k##type; } \
180 virtual void CompileToNative(LCodeGen* generator); \ 184 virtual void CompileToNative(LCodeGen* generator); \
181 virtual const char* Mnemonic() const { return mnemonic; } \ 185 virtual const char* Mnemonic() const { return mnemonic; } \
182 static L##type* cast(LInstruction* instr) { \ 186 static L##type* cast(LInstruction* instr) { \
183 ASSERT(instr->Is##type()); \ 187 ASSERT(instr->Is##type()); \
184 return reinterpret_cast<L##type*>(instr); \ 188 return reinterpret_cast<L##type*>(instr); \
185 } 189 }
(...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after
2033 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") 2037 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
2034 DECLARE_HYDROGEN_ACCESSOR(StackCheck) 2038 DECLARE_HYDROGEN_ACCESSOR(StackCheck)
2035 2039
2036 Label* done_label() { return &done_label_; } 2040 Label* done_label() { return &done_label_; }
2037 2041
2038 private: 2042 private:
2039 Label done_label_; 2043 Label done_label_;
2040 }; 2044 };
2041 2045
2042 2046
2047 class LForInPrepareMap: public LTemplateInstruction<1, 1, 0> {
2048 public:
2049 LForInPrepareMap(LOperand* object) {
2050 inputs_[0] = object;
2051 }
2052
2053 LOperand* object() { return inputs_[0]; }
2054
2055 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map")
2056 };
2057
2058
2059 class LForInCacheArray: public LTemplateInstruction<1, 1, 0> {
2060 public:
2061 LForInCacheArray(LOperand* map) {
2062 inputs_[0] = map;
2063 }
2064
2065 LOperand* map() { return inputs_[0]; }
2066
2067 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
2068
2069 int idx() {
2070 return HForInCacheArray::cast(this->hydrogen_value())->idx();
2071 }
2072 };
2073
2074
2075 class LCheckMapValue: public LTemplateInstruction<1, 2, 0> {
fschneider 2012/02/22 10:16:45 Also here: <0, 2, 0>
2076 public:
2077 LCheckMapValue(LOperand* value, LOperand* map) {
2078 inputs_[0] = value;
2079 inputs_[1] = map;
2080 }
2081
2082 LOperand* value() { return inputs_[0]; }
2083 LOperand* map() { return inputs_[1]; }
2084
2085 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value")
2086 };
2087
2088
2089 class LLoadFieldByIndex: public LTemplateInstruction<1, 2, 0> {
2090 public:
2091 LLoadFieldByIndex(LOperand* object, LOperand* index) {
2092 inputs_[0] = object;
2093 inputs_[1] = index;
2094 }
2095
2096 LOperand* object() { return inputs_[0]; }
2097 LOperand* index() { return inputs_[1]; }
2098
2099 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index")
2100 };
2101
2102
2043 class LChunkBuilder; 2103 class LChunkBuilder;
2044 class LChunk: public ZoneObject { 2104 class LChunk: public ZoneObject {
2045 public: 2105 public:
2046 explicit LChunk(CompilationInfo* info, HGraph* graph) 2106 explicit LChunk(CompilationInfo* info, HGraph* graph)
2047 : spill_slot_count_(0), 2107 : spill_slot_count_(0),
2048 info_(info), 2108 info_(info),
2049 graph_(graph), 2109 graph_(graph),
2050 instructions_(32), 2110 instructions_(32),
2051 pointer_maps_(8), 2111 pointer_maps_(8),
2052 inlined_closures_(1) { } 2112 inlined_closures_(1) { }
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
2262 2322
2263 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2323 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2264 }; 2324 };
2265 2325
2266 #undef DECLARE_HYDROGEN_ACCESSOR 2326 #undef DECLARE_HYDROGEN_ACCESSOR
2267 #undef DECLARE_CONCRETE_INSTRUCTION 2327 #undef DECLARE_CONCRETE_INSTRUCTION
2268 2328
2269 } } // namespace v8::int 2329 } } // namespace v8::int
2270 2330
2271 #endif // V8_X64_LITHIUM_X64_H_ 2331 #endif // V8_X64_LITHIUM_X64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698