| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
| 6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 2216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2227 | 2227 |
| 2228 | 2228 |
| 2229 inline Representation BranchInstr::RequiredInputRepresentation( | 2229 inline Representation BranchInstr::RequiredInputRepresentation( |
| 2230 intptr_t i) const { | 2230 intptr_t i) const { |
| 2231 return comparison()->RequiredInputRepresentation(i); | 2231 return comparison()->RequiredInputRepresentation(i); |
| 2232 } | 2232 } |
| 2233 | 2233 |
| 2234 | 2234 |
| 2235 class StrictCompareInstr : public ComparisonInstr { | 2235 class StrictCompareInstr : public ComparisonInstr { |
| 2236 public: | 2236 public: |
| 2237 StrictCompareInstr(Token::Kind kind, Value* left, Value* right) | 2237 StrictCompareInstr(Token::Kind kind, Value* left, Value* right); |
| 2238 : ComparisonInstr(kind, left, right) { | |
| 2239 ASSERT((kind == Token::kEQ_STRICT) || (kind == Token::kNE_STRICT)); | |
| 2240 } | |
| 2241 | 2238 |
| 2242 DECLARE_INSTRUCTION(StrictCompare) | 2239 DECLARE_INSTRUCTION(StrictCompare) |
| 2243 virtual RawAbstractType* CompileType() const; | 2240 virtual RawAbstractType* CompileType() const; |
| 2244 | 2241 |
| 2245 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2242 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2246 | 2243 |
| 2247 virtual bool CanDeoptimize() const { return false; } | 2244 virtual bool CanDeoptimize() const { return false; } |
| 2248 | 2245 |
| 2249 virtual bool HasSideEffect() const { return false; } | 2246 virtual bool HasSideEffect() const { return false; } |
| 2250 | 2247 |
| 2251 virtual bool AttributesEqual(Instruction* other) const; | 2248 virtual bool AttributesEqual(Instruction* other) const; |
| 2252 virtual bool AffectedBySideEffect() const { return false; } | 2249 virtual bool AffectedBySideEffect() const { return false; } |
| 2253 | 2250 |
| 2254 virtual Definition* Canonicalize(); | 2251 virtual Definition* Canonicalize(); |
| 2255 | 2252 |
| 2256 virtual intptr_t ResultCid() const { return kBoolCid; } | 2253 virtual intptr_t ResultCid() const { return kBoolCid; } |
| 2257 | 2254 |
| 2258 virtual void EmitBranchCode(FlowGraphCompiler* compiler, | 2255 virtual void EmitBranchCode(FlowGraphCompiler* compiler, |
| 2259 BranchInstr* branch); | 2256 BranchInstr* branch); |
| 2260 | 2257 |
| 2258 bool needs_number_check() const { return needs_number_check_; } |
| 2259 void set_needs_number_check(bool value) { needs_number_check_ = value; } |
| 2260 |
| 2261 private: | 2261 private: |
| 2262 // True if the comparison must check for double, Mint or Bigint and |
| 2263 // use value comparison instead. |
| 2264 bool needs_number_check_; |
| 2265 |
| 2262 DISALLOW_COPY_AND_ASSIGN(StrictCompareInstr); | 2266 DISALLOW_COPY_AND_ASSIGN(StrictCompareInstr); |
| 2263 }; | 2267 }; |
| 2264 | 2268 |
| 2265 | 2269 |
| 2266 class EqualityCompareInstr : public ComparisonInstr { | 2270 class EqualityCompareInstr : public ComparisonInstr { |
| 2267 public: | 2271 public: |
| 2268 EqualityCompareInstr(intptr_t token_pos, | 2272 EqualityCompareInstr(intptr_t token_pos, |
| 2269 Token::Kind kind, | 2273 Token::Kind kind, |
| 2270 Value* left, | 2274 Value* left, |
| 2271 Value* right) | 2275 Value* right) |
| (...skipping 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4286 ForwardInstructionIterator* current_iterator_; | 4290 ForwardInstructionIterator* current_iterator_; |
| 4287 | 4291 |
| 4288 private: | 4292 private: |
| 4289 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 4293 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 4290 }; | 4294 }; |
| 4291 | 4295 |
| 4292 | 4296 |
| 4293 } // namespace dart | 4297 } // namespace dart |
| 4294 | 4298 |
| 4295 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 4299 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |