Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ |
| 6 #define RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define RUNTIME_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 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 903 // Fetch deopt id without checking if this computation can deoptimize. | 903 // Fetch deopt id without checking if this computation can deoptimize. |
| 904 intptr_t GetDeoptId() const { | 904 intptr_t GetDeoptId() const { |
| 905 return deopt_id_; | 905 return deopt_id_; |
| 906 } | 906 } |
| 907 | 907 |
| 908 void CopyDeoptIdFrom(const Instruction& instr) { | 908 void CopyDeoptIdFrom(const Instruction& instr) { |
| 909 deopt_id_ = instr.deopt_id_; | 909 deopt_id_ = instr.deopt_id_; |
| 910 } | 910 } |
| 911 | 911 |
| 912 private: | 912 private: |
| 913 friend class BranchInstr; // For RawSetInputAt. | |
| 914 friend class IfThenElseInstr; // For RawSetInputAt. | |
| 915 | |
| 913 virtual void RawSetInputAt(intptr_t i, Value* value) = 0; | 916 virtual void RawSetInputAt(intptr_t i, Value* value) = 0; |
| 914 | 917 |
| 915 enum { | 918 enum { |
| 916 kNoPlaceId = -1 | 919 kNoPlaceId = -1 |
| 917 }; | 920 }; |
| 918 | 921 |
| 919 intptr_t deopt_id_; | 922 intptr_t deopt_id_; |
| 920 union { | 923 union { |
| 921 intptr_t lifetime_position_; // Position used by register allocator. | 924 intptr_t lifetime_position_; // Position used by register allocator. |
| 922 intptr_t place_id_; | 925 intptr_t place_id_; |
| (...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2348 void ComputeOffsetTable(); | 2351 void ComputeOffsetTable(); |
| 2349 | 2352 |
| 2350 PRINT_TO_SUPPORT | 2353 PRINT_TO_SUPPORT |
| 2351 | 2354 |
| 2352 private: | 2355 private: |
| 2353 GrowableArray<TargetEntryInstr*> successors_; | 2356 GrowableArray<TargetEntryInstr*> successors_; |
| 2354 TypedData& offsets_; | 2357 TypedData& offsets_; |
| 2355 }; | 2358 }; |
| 2356 | 2359 |
| 2357 | 2360 |
| 2358 class ComparisonInstr : public TemplateDefinition<2, NoThrow, Pure> { | 2361 class ComparisonInstr : public Definition { |
| 2359 public: | 2362 public: |
| 2360 Value* left() const { return inputs_[0]; } | 2363 Value* left() const { return InputAt(0); } |
| 2361 Value* right() const { return inputs_[1]; } | 2364 Value* right() const { return InputAt(1); } |
| 2362 | 2365 |
| 2363 virtual TokenPosition token_pos() const { return token_pos_; } | 2366 virtual TokenPosition token_pos() const { return token_pos_; } |
| 2364 Token::Kind kind() const { return kind_; } | 2367 Token::Kind kind() const { return kind_; } |
| 2365 | 2368 |
| 2366 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right) = 0; | 2369 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right) = 0; |
| 2367 | 2370 |
| 2368 virtual void EmitBranchCode(FlowGraphCompiler* compiler, | 2371 virtual void EmitBranchCode(FlowGraphCompiler* compiler, |
| 2369 BranchInstr* branch) = 0; | 2372 BranchInstr* branch) = 0; |
| 2370 | 2373 |
| 2371 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, | 2374 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 2390 ComparisonInstr* other_comparison = other->AsComparison(); | 2393 ComparisonInstr* other_comparison = other->AsComparison(); |
| 2391 return kind() == other_comparison->kind() && | 2394 return kind() == other_comparison->kind() && |
| 2392 (operation_cid() == other_comparison->operation_cid()); | 2395 (operation_cid() == other_comparison->operation_cid()); |
| 2393 } | 2396 } |
| 2394 | 2397 |
| 2395 DEFINE_INSTRUCTION_TYPE_CHECK(Comparison) | 2398 DEFINE_INSTRUCTION_TYPE_CHECK(Comparison) |
| 2396 | 2399 |
| 2397 protected: | 2400 protected: |
| 2398 ComparisonInstr(TokenPosition token_pos, | 2401 ComparisonInstr(TokenPosition token_pos, |
| 2399 Token::Kind kind, | 2402 Token::Kind kind, |
| 2400 Value* left, | |
| 2401 Value* right, | |
| 2402 intptr_t deopt_id = Thread::kNoDeoptId) | 2403 intptr_t deopt_id = Thread::kNoDeoptId) |
| 2403 : TemplateDefinition(deopt_id), | 2404 : Definition(deopt_id), |
| 2404 token_pos_(token_pos), | 2405 token_pos_(token_pos), |
| 2405 kind_(kind), | 2406 kind_(kind), |
| 2406 operation_cid_(kIllegalCid) { | 2407 operation_cid_(kIllegalCid) { |
| 2407 SetInputAt(0, left); | |
| 2408 if (right != NULL) { | |
| 2409 SetInputAt(1, right); | |
| 2410 } | |
| 2411 } | 2408 } |
| 2412 | 2409 |
| 2413 private: | 2410 private: |
| 2414 const TokenPosition token_pos_; | 2411 const TokenPosition token_pos_; |
| 2415 Token::Kind kind_; | 2412 Token::Kind kind_; |
| 2416 intptr_t operation_cid_; // Set by optimizer. | 2413 intptr_t operation_cid_; // Set by optimizer. |
| 2417 | 2414 |
| 2418 DISALLOW_COPY_AND_ASSIGN(ComparisonInstr); | 2415 DISALLOW_COPY_AND_ASSIGN(ComparisonInstr); |
| 2419 }; | 2416 }; |
| 2420 | 2417 |
| 2421 | 2418 |
| 2419 class PureComparison: public ComparisonInstr { | |
|
zra
2016/10/31 17:28:15
missing space before colon.
Florian Schneider
2016/10/31 18:48:16
Done.
| |
| 2420 public: | |
| 2421 virtual bool AllowsCSE() const { return true; } | |
| 2422 virtual EffectSet Dependencies() const { return EffectSet::None(); } | |
| 2423 | |
| 2424 virtual EffectSet Effects() const { return EffectSet::None(); } | |
| 2425 | |
| 2426 protected: | |
| 2427 explicit PureComparison(TokenPosition token_pos, | |
|
zra
2016/10/31 17:28:14
explicit not needed.
Florian Schneider
2016/10/31 18:48:16
Done.
| |
| 2428 Token::Kind kind, | |
| 2429 intptr_t deopt_id) | |
| 2430 : ComparisonInstr(token_pos, kind, deopt_id) { } | |
| 2431 }; | |
| 2432 | |
| 2433 | |
| 2434 template<intptr_t N, | |
| 2435 typename ThrowsTrait, | |
| 2436 template<typename Impure, typename Pure> class CSETrait = NoCSE> | |
| 2437 class TemplateComparison : public CSETrait< | |
| 2438 ComparisonInstr, PureComparison>::Base { | |
| 2439 public: | |
| 2440 TemplateComparison(TokenPosition token_pos, | |
| 2441 Token::Kind kind, | |
| 2442 intptr_t deopt_id = Thread::kNoDeoptId) | |
| 2443 : CSETrait<ComparisonInstr, PureComparison>::Base( | |
| 2444 token_pos, kind, deopt_id), | |
| 2445 inputs_() { } | |
| 2446 | |
| 2447 virtual intptr_t InputCount() const { return N; } | |
| 2448 virtual Value* InputAt(intptr_t i) const { return inputs_[i]; } | |
| 2449 | |
| 2450 virtual bool MayThrow() const { return ThrowsTrait::kCanThrow; } | |
| 2451 | |
| 2452 protected: | |
| 2453 EmbeddedArray<Value*, N> inputs_; | |
| 2454 | |
| 2455 private: | |
| 2456 virtual void RawSetInputAt(intptr_t i, Value* value) { | |
| 2457 inputs_[i] = value; | |
| 2458 } | |
| 2459 }; | |
| 2460 | |
| 2461 | |
| 2422 class BranchInstr : public Instruction { | 2462 class BranchInstr : public Instruction { |
| 2423 public: | 2463 public: |
| 2424 explicit BranchInstr(ComparisonInstr* comparison) | 2464 explicit BranchInstr(ComparisonInstr* comparison) |
| 2425 : Instruction(Thread::Current()->GetNextDeoptId()), | 2465 : Instruction(Thread::Current()->GetNextDeoptId()), |
| 2426 comparison_(comparison), | 2466 comparison_(comparison), |
| 2427 is_checked_(false), | 2467 is_checked_(false), |
| 2428 constrained_type_(NULL), | 2468 constrained_type_(NULL), |
| 2429 constant_target_(NULL) { | 2469 constant_target_(NULL) { |
| 2430 ASSERT(comparison->env() == NULL); | 2470 ASSERT(comparison->env() == NULL); |
| 2431 for (intptr_t i = comparison->InputCount() - 1; i >= 0; --i) { | 2471 for (intptr_t i = comparison->InputCount() - 1; i >= 0; --i) { |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2970 private: | 3010 private: |
| 2971 InstanceCallInstr* instance_call_; | 3011 InstanceCallInstr* instance_call_; |
| 2972 const ICData& ic_data_; | 3012 const ICData& ic_data_; |
| 2973 bool with_checks_; | 3013 bool with_checks_; |
| 2974 const bool complete_; | 3014 const bool complete_; |
| 2975 | 3015 |
| 2976 DISALLOW_COPY_AND_ASSIGN(PolymorphicInstanceCallInstr); | 3016 DISALLOW_COPY_AND_ASSIGN(PolymorphicInstanceCallInstr); |
| 2977 }; | 3017 }; |
| 2978 | 3018 |
| 2979 | 3019 |
| 2980 class StrictCompareInstr : public ComparisonInstr { | 3020 class StrictCompareInstr : public TemplateComparison<2, NoThrow, Pure> { |
| 2981 public: | 3021 public: |
| 2982 StrictCompareInstr(TokenPosition token_pos, | 3022 StrictCompareInstr(TokenPosition token_pos, |
| 2983 Token::Kind kind, | 3023 Token::Kind kind, |
| 2984 Value* left, | 3024 Value* left, |
| 2985 Value* right, | 3025 Value* right, |
| 2986 bool needs_number_check); | 3026 bool needs_number_check); |
| 2987 | 3027 |
| 2988 DECLARE_INSTRUCTION(StrictCompare) | 3028 DECLARE_INSTRUCTION(StrictCompare) |
| 2989 | 3029 |
| 2990 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); | 3030 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 3012 // True if the comparison must check for double, Mint or Bigint and | 3052 // True if the comparison must check for double, Mint or Bigint and |
| 3013 // use value comparison instead. | 3053 // use value comparison instead. |
| 3014 bool needs_number_check_; | 3054 bool needs_number_check_; |
| 3015 | 3055 |
| 3016 DISALLOW_COPY_AND_ASSIGN(StrictCompareInstr); | 3056 DISALLOW_COPY_AND_ASSIGN(StrictCompareInstr); |
| 3017 }; | 3057 }; |
| 3018 | 3058 |
| 3019 | 3059 |
| 3020 // Comparison instruction that is equivalent to the (left & right) == 0 | 3060 // Comparison instruction that is equivalent to the (left & right) == 0 |
| 3021 // comparison pattern. | 3061 // comparison pattern. |
| 3022 class TestSmiInstr : public ComparisonInstr { | 3062 class TestSmiInstr : public TemplateComparison<2, NoThrow, Pure> { |
| 3023 public: | 3063 public: |
| 3024 TestSmiInstr(TokenPosition token_pos, | 3064 TestSmiInstr(TokenPosition token_pos, |
| 3025 Token::Kind kind, | 3065 Token::Kind kind, |
| 3026 Value* left, | 3066 Value* left, |
| 3027 Value* right) | 3067 Value* right) |
| 3028 : ComparisonInstr(token_pos, kind, left, right) { | 3068 : TemplateComparison(token_pos, kind) { |
| 3029 ASSERT(kind == Token::kEQ || kind == Token::kNE); | 3069 ASSERT(kind == Token::kEQ || kind == Token::kNE); |
| 3070 SetInputAt(0, left); | |
| 3071 SetInputAt(1, right); | |
| 3030 } | 3072 } |
| 3031 | 3073 |
| 3032 DECLARE_INSTRUCTION(TestSmi); | 3074 DECLARE_INSTRUCTION(TestSmi); |
| 3033 | 3075 |
| 3034 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); | 3076 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); |
| 3035 | 3077 |
| 3036 virtual CompileType ComputeType() const; | 3078 virtual CompileType ComputeType() const; |
| 3037 | 3079 |
| 3038 virtual bool CanDeoptimize() const { return false; } | 3080 virtual bool CanDeoptimize() const { return false; } |
| 3039 | 3081 |
| 3040 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 3082 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 3041 return kTagged; | 3083 return kTagged; |
| 3042 } | 3084 } |
| 3043 | 3085 |
| 3044 virtual void EmitBranchCode(FlowGraphCompiler* compiler, | 3086 virtual void EmitBranchCode(FlowGraphCompiler* compiler, |
| 3045 BranchInstr* branch); | 3087 BranchInstr* branch); |
| 3046 | 3088 |
| 3047 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, | 3089 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, |
| 3048 BranchLabels labels); | 3090 BranchLabels labels); |
| 3049 | 3091 |
| 3050 private: | 3092 private: |
| 3051 DISALLOW_COPY_AND_ASSIGN(TestSmiInstr); | 3093 DISALLOW_COPY_AND_ASSIGN(TestSmiInstr); |
| 3052 }; | 3094 }; |
| 3053 | 3095 |
| 3054 | 3096 |
| 3055 // Checks the input value cid against cids stored in a table and returns either | 3097 // Checks the input value cid against cids stored in a table and returns either |
| 3056 // a result or deoptimizes. | 3098 // a result or deoptimizes. |
| 3057 // TODO(srdjan): Modify ComparisonInstr to allow 1 or 2 arguments, since | 3099 class TestCidsInstr : public TemplateComparison<1, NoThrow, Pure> { |
| 3058 // TestCidInstr needs only one argument | |
| 3059 class TestCidsInstr : public ComparisonInstr { | |
| 3060 public: | 3100 public: |
| 3061 TestCidsInstr(TokenPosition token_pos, | 3101 TestCidsInstr(TokenPosition token_pos, |
| 3062 Token::Kind kind, | 3102 Token::Kind kind, |
| 3063 Value* value, | 3103 Value* value, |
| 3064 const ZoneGrowableArray<intptr_t>& cid_results, | 3104 const ZoneGrowableArray<intptr_t>& cid_results, |
| 3065 intptr_t deopt_id) | 3105 intptr_t deopt_id) |
| 3066 : ComparisonInstr(token_pos, kind, value, NULL, deopt_id), | 3106 : TemplateComparison(token_pos, kind, deopt_id), |
| 3067 cid_results_(cid_results), | 3107 cid_results_(cid_results), |
| 3068 licm_hoisted_(false) { | 3108 licm_hoisted_(false) { |
| 3069 ASSERT((kind == Token::kIS) || (kind == Token::kISNOT)); | 3109 ASSERT((kind == Token::kIS) || (kind == Token::kISNOT)); |
| 3110 SetInputAt(0, value); | |
| 3070 set_operation_cid(kObjectCid); | 3111 set_operation_cid(kObjectCid); |
| 3071 } | 3112 } |
| 3072 | 3113 |
| 3073 virtual intptr_t InputCount() const { return 1; } | |
| 3074 | |
| 3075 const ZoneGrowableArray<intptr_t>& cid_results() const { | 3114 const ZoneGrowableArray<intptr_t>& cid_results() const { |
| 3076 return cid_results_; | 3115 return cid_results_; |
| 3077 } | 3116 } |
| 3078 | 3117 |
| 3079 DECLARE_INSTRUCTION(TestCids); | 3118 DECLARE_INSTRUCTION(TestCids); |
| 3080 | 3119 |
| 3081 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); | 3120 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); |
| 3082 | 3121 |
| 3083 virtual CompileType ComputeType() const; | 3122 virtual CompileType ComputeType() const; |
| 3084 | 3123 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 3104 | 3143 |
| 3105 PRINT_OPERANDS_TO_SUPPORT | 3144 PRINT_OPERANDS_TO_SUPPORT |
| 3106 | 3145 |
| 3107 private: | 3146 private: |
| 3108 const ZoneGrowableArray<intptr_t>& cid_results_; | 3147 const ZoneGrowableArray<intptr_t>& cid_results_; |
| 3109 bool licm_hoisted_; | 3148 bool licm_hoisted_; |
| 3110 DISALLOW_COPY_AND_ASSIGN(TestCidsInstr); | 3149 DISALLOW_COPY_AND_ASSIGN(TestCidsInstr); |
| 3111 }; | 3150 }; |
| 3112 | 3151 |
| 3113 | 3152 |
| 3114 class EqualityCompareInstr : public ComparisonInstr { | 3153 class EqualityCompareInstr : public TemplateComparison<2, NoThrow, Pure> { |
| 3115 public: | 3154 public: |
| 3116 EqualityCompareInstr(TokenPosition token_pos, | 3155 EqualityCompareInstr(TokenPosition token_pos, |
| 3117 Token::Kind kind, | 3156 Token::Kind kind, |
| 3118 Value* left, | 3157 Value* left, |
| 3119 Value* right, | 3158 Value* right, |
| 3120 intptr_t cid, | 3159 intptr_t cid, |
| 3121 intptr_t deopt_id) | 3160 intptr_t deopt_id) |
| 3122 : ComparisonInstr(token_pos, kind, left, right, deopt_id) { | 3161 : TemplateComparison(token_pos, kind, deopt_id) { |
| 3123 ASSERT(Token::IsEqualityOperator(kind)); | 3162 ASSERT(Token::IsEqualityOperator(kind)); |
| 3163 SetInputAt(0, left); | |
| 3164 SetInputAt(1, right); | |
| 3124 set_operation_cid(cid); | 3165 set_operation_cid(cid); |
| 3125 } | 3166 } |
| 3126 | 3167 |
| 3127 DECLARE_INSTRUCTION(EqualityCompare) | 3168 DECLARE_INSTRUCTION(EqualityCompare) |
| 3128 | 3169 |
| 3129 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); | 3170 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); |
| 3130 | 3171 |
| 3131 virtual CompileType ComputeType() const; | 3172 virtual CompileType ComputeType() const; |
| 3132 | 3173 |
| 3133 virtual bool CanDeoptimize() const { return false; } | 3174 virtual bool CanDeoptimize() const { return false; } |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 3145 return kTagged; | 3186 return kTagged; |
| 3146 } | 3187 } |
| 3147 | 3188 |
| 3148 PRINT_OPERANDS_TO_SUPPORT | 3189 PRINT_OPERANDS_TO_SUPPORT |
| 3149 | 3190 |
| 3150 private: | 3191 private: |
| 3151 DISALLOW_COPY_AND_ASSIGN(EqualityCompareInstr); | 3192 DISALLOW_COPY_AND_ASSIGN(EqualityCompareInstr); |
| 3152 }; | 3193 }; |
| 3153 | 3194 |
| 3154 | 3195 |
| 3155 class RelationalOpInstr : public ComparisonInstr { | 3196 class RelationalOpInstr : public TemplateComparison<2, NoThrow, Pure> { |
| 3156 public: | 3197 public: |
| 3157 RelationalOpInstr(TokenPosition token_pos, | 3198 RelationalOpInstr(TokenPosition token_pos, |
| 3158 Token::Kind kind, | 3199 Token::Kind kind, |
| 3159 Value* left, | 3200 Value* left, |
| 3160 Value* right, | 3201 Value* right, |
| 3161 intptr_t cid, | 3202 intptr_t cid, |
| 3162 intptr_t deopt_id) | 3203 intptr_t deopt_id) |
| 3163 : ComparisonInstr(token_pos, kind, left, right, deopt_id) { | 3204 : TemplateComparison(token_pos, kind, deopt_id) { |
| 3164 ASSERT(Token::IsRelationalOperator(kind)); | 3205 ASSERT(Token::IsRelationalOperator(kind)); |
| 3206 SetInputAt(0, left); | |
| 3207 SetInputAt(1, right); | |
| 3165 set_operation_cid(cid); | 3208 set_operation_cid(cid); |
| 3166 } | 3209 } |
| 3167 | 3210 |
| 3168 DECLARE_INSTRUCTION(RelationalOp) | 3211 DECLARE_INSTRUCTION(RelationalOp) |
| 3169 | 3212 |
| 3170 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); | 3213 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); |
| 3171 | 3214 |
| 3172 virtual CompileType ComputeType() const; | 3215 virtual CompileType ComputeType() const; |
| 3173 | 3216 |
| 3174 virtual bool CanDeoptimize() const { return false; } | 3217 virtual bool CanDeoptimize() const { return false; } |
| (...skipping 2162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5337 } | 5380 } |
| 5338 | 5381 |
| 5339 private: | 5382 private: |
| 5340 const Token::Kind op_kind_; | 5383 const Token::Kind op_kind_; |
| 5341 const TokenPosition token_pos_; | 5384 const TokenPosition token_pos_; |
| 5342 | 5385 |
| 5343 DISALLOW_COPY_AND_ASSIGN(BinaryDoubleOpInstr); | 5386 DISALLOW_COPY_AND_ASSIGN(BinaryDoubleOpInstr); |
| 5344 }; | 5387 }; |
| 5345 | 5388 |
| 5346 | 5389 |
| 5347 class DoubleTestOpInstr : public TemplateDefinition<1, NoThrow, Pure> { | 5390 class DoubleTestOpInstr : public TemplateComparison<1, NoThrow, Pure> { |
| 5348 public: | 5391 public: |
| 5349 DoubleTestOpInstr(MethodRecognizer::Kind op_kind, | 5392 DoubleTestOpInstr(MethodRecognizer::Kind op_kind, |
| 5350 Value* d, | 5393 Value* value, |
| 5351 intptr_t deopt_id, | 5394 intptr_t deopt_id, |
| 5352 TokenPosition token_pos) | 5395 TokenPosition token_pos) |
| 5353 : TemplateDefinition(deopt_id), | 5396 : TemplateComparison(token_pos, Token::kEQ, deopt_id), |
| 5354 op_kind_(op_kind), | 5397 op_kind_(op_kind) { |
| 5355 token_pos_(token_pos) { | 5398 SetInputAt(0, value); |
| 5356 SetInputAt(0, d); | |
| 5357 } | 5399 } |
| 5358 | 5400 |
| 5359 Value* value() const { return inputs_[0]; } | 5401 Value* value() const { return InputAt(0); } |
| 5360 | 5402 |
| 5361 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 5403 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
| 5362 | 5404 |
| 5363 virtual TokenPosition token_pos() const { return token_pos_; } | |
| 5364 | |
| 5365 virtual bool CanDeoptimize() const { return false; } | 5405 virtual bool CanDeoptimize() const { return false; } |
| 5366 | 5406 |
| 5367 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5407 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 5368 ASSERT(idx == 0); | 5408 ASSERT(idx == 0); |
| 5369 return kUnboxedDouble; | 5409 return kUnboxedDouble; |
| 5370 } | 5410 } |
| 5371 | 5411 |
| 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 | 5412 PRINT_OPERANDS_TO_SUPPORT |
| 5379 | 5413 |
| 5380 DECLARE_INSTRUCTION(DoubleTestOp) | 5414 DECLARE_INSTRUCTION(DoubleTestOp) |
| 5381 virtual CompileType ComputeType() const; | 5415 virtual CompileType ComputeType() const; |
| 5382 | 5416 |
| 5383 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 5417 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
| 5384 | 5418 |
| 5385 virtual bool AttributesEqual(Instruction* other) const { | 5419 virtual bool AttributesEqual(Instruction* other) const { |
| 5386 return op_kind_ == other->AsDoubleTestOp()->op_kind(); | 5420 return op_kind_ == other->AsDoubleTestOp()->op_kind() |
| 5421 && ComparisonInstr::AttributesEqual(other); | |
| 5387 } | 5422 } |
| 5388 | 5423 |
| 5424 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); | |
| 5425 | |
| 5426 virtual void EmitBranchCode(FlowGraphCompiler* compiler, | |
| 5427 BranchInstr* branch); | |
| 5428 | |
| 5429 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, | |
| 5430 BranchLabels labels); | |
| 5431 | |
| 5389 private: | 5432 private: |
| 5390 const MethodRecognizer::Kind op_kind_; | 5433 const MethodRecognizer::Kind op_kind_; |
| 5391 const TokenPosition token_pos_; | |
| 5392 | 5434 |
| 5393 DISALLOW_COPY_AND_ASSIGN(DoubleTestOpInstr); | 5435 DISALLOW_COPY_AND_ASSIGN(DoubleTestOpInstr); |
| 5394 }; | 5436 }; |
| 5395 | 5437 |
| 5396 | 5438 |
| 5397 class BinaryFloat32x4OpInstr : public TemplateDefinition<2, NoThrow, Pure> { | 5439 class BinaryFloat32x4OpInstr : public TemplateDefinition<2, NoThrow, Pure> { |
| 5398 public: | 5440 public: |
| 5399 BinaryFloat32x4OpInstr(Token::Kind op_kind, | 5441 BinaryFloat32x4OpInstr(Token::Kind op_kind, |
| 5400 Value* left, | 5442 Value* left, |
| 5401 Value* right, | 5443 Value* right, |
| (...skipping 2981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8383 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ | 8425 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ |
| 8384 UNIMPLEMENTED(); \ | 8426 UNIMPLEMENTED(); \ |
| 8385 return NULL; \ | 8427 return NULL; \ |
| 8386 } \ | 8428 } \ |
| 8387 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8429 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
| 8388 | 8430 |
| 8389 | 8431 |
| 8390 } // namespace dart | 8432 } // namespace dart |
| 8391 | 8433 |
| 8392 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ | 8434 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |