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

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 2423843002: Add DoubleTestOp instruction (Closed)
Patch Set: Address comments Created 4 years, 2 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
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 M(DoubleToDouble) \ 490 M(DoubleToDouble) \
491 M(DoubleToFloat) \ 491 M(DoubleToFloat) \
492 M(FloatToDouble) \ 492 M(FloatToDouble) \
493 M(CheckClass) \ 493 M(CheckClass) \
494 M(CheckClassId) \ 494 M(CheckClassId) \
495 M(CheckSmi) \ 495 M(CheckSmi) \
496 M(Constant) \ 496 M(Constant) \
497 M(UnboxedConstant) \ 497 M(UnboxedConstant) \
498 M(CheckEitherNonSmi) \ 498 M(CheckEitherNonSmi) \
499 M(BinaryDoubleOp) \ 499 M(BinaryDoubleOp) \
500 M(DoubleTestOp) \
500 M(MathUnary) \ 501 M(MathUnary) \
501 M(MathMinMax) \ 502 M(MathMinMax) \
502 M(Box) \ 503 M(Box) \
503 M(Unbox) \ 504 M(Unbox) \
504 M(BoxInt64) \ 505 M(BoxInt64) \
505 M(UnboxInt64) \ 506 M(UnboxInt64) \
506 M(CaseInsensitiveCompareUC16) \ 507 M(CaseInsensitiveCompareUC16) \
507 M(BinaryMintOp) \ 508 M(BinaryMintOp) \
508 M(ShiftMintOp) \ 509 M(ShiftMintOp) \
509 M(UnaryMintOp) \ 510 M(UnaryMintOp) \
(...skipping 4826 matching lines...) Expand 10 before | Expand all | Expand 10 after
5336 } 5337 }
5337 5338
5338 private: 5339 private:
5339 const Token::Kind op_kind_; 5340 const Token::Kind op_kind_;
5340 const TokenPosition token_pos_; 5341 const TokenPosition token_pos_;
5341 5342
5342 DISALLOW_COPY_AND_ASSIGN(BinaryDoubleOpInstr); 5343 DISALLOW_COPY_AND_ASSIGN(BinaryDoubleOpInstr);
5343 }; 5344 };
5344 5345
5345 5346
5347 class DoubleTestOpInstr : public TemplateDefinition<1, NoThrow, Pure> {
5348 public:
5349 DoubleTestOpInstr(MethodRecognizer::Kind op_kind,
5350 Value* d,
5351 intptr_t deopt_id,
5352 TokenPosition token_pos)
5353 : TemplateDefinition(deopt_id),
5354 op_kind_(op_kind),
5355 token_pos_(token_pos) {
5356 SetInputAt(0, d);
5357 }
5358
5359 Value* value() const { return inputs_[0]; }
5360
5361 MethodRecognizer::Kind op_kind() const { return op_kind_; }
5362
5363 virtual TokenPosition token_pos() const { return token_pos_; }
5364
5365 virtual bool CanDeoptimize() const { return false; }
5366
5367 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
5368 ASSERT(idx == 0);
5369 return kUnboxedDouble;
5370 }
5371
5372 virtual intptr_t DeoptimizationTarget() const {
5373 // Direct access since this instruction cannot deoptimize, and the deopt-id
5374 // was inherited from another instruction that could deoptimize.
5375 return GetDeoptId();
5376 }
5377
5378 PRINT_OPERANDS_TO_SUPPORT
5379
5380 DECLARE_INSTRUCTION(DoubleTestOp)
5381 virtual CompileType ComputeType() const;
5382
5383 virtual Definition* Canonicalize(FlowGraph* flow_graph);
5384
5385 virtual bool AttributesEqual(Instruction* other) const { return true; }
5386
5387 private:
5388 const MethodRecognizer::Kind op_kind_;
5389 const TokenPosition token_pos_;
5390
5391 DISALLOW_COPY_AND_ASSIGN(DoubleTestOpInstr);
5392 };
5393
5394
5346 class BinaryFloat32x4OpInstr : public TemplateDefinition<2, NoThrow, Pure> { 5395 class BinaryFloat32x4OpInstr : public TemplateDefinition<2, NoThrow, Pure> {
5347 public: 5396 public:
5348 BinaryFloat32x4OpInstr(Token::Kind op_kind, 5397 BinaryFloat32x4OpInstr(Token::Kind op_kind,
5349 Value* left, 5398 Value* left,
5350 Value* right, 5399 Value* right,
5351 intptr_t deopt_id) 5400 intptr_t deopt_id)
5352 : TemplateDefinition(deopt_id), op_kind_(op_kind) { 5401 : TemplateDefinition(deopt_id), op_kind_(op_kind) {
5353 SetInputAt(0, left); 5402 SetInputAt(0, left);
5354 SetInputAt(1, right); 5403 SetInputAt(1, right);
5355 } 5404 }
(...skipping 2976 matching lines...) Expand 10 before | Expand all | Expand 10 after
8332 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ 8381 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \
8333 UNIMPLEMENTED(); \ 8382 UNIMPLEMENTED(); \
8334 return NULL; \ 8383 return NULL; \
8335 } \ 8384 } \
8336 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } 8385 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); }
8337 8386
8338 8387
8339 } // namespace dart 8388 } // namespace dart
8340 8389
8341 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 8390 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698