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