| 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 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 M(CatchEntry, CatchEntryComp) \ | 1287 M(CatchEntry, CatchEntryComp) \ |
| 1288 M(BinarySmiOp, BinarySmiOpComp) \ | 1288 M(BinarySmiOp, BinarySmiOpComp) \ |
| 1289 M(BinaryMintOp, BinaryMintOpComp) \ | 1289 M(BinaryMintOp, BinaryMintOpComp) \ |
| 1290 M(UnarySmiOp, UnarySmiOpComp) \ | 1290 M(UnarySmiOp, UnarySmiOpComp) \ |
| 1291 M(NumberNegate, NumberNegateComp) \ | 1291 M(NumberNegate, NumberNegateComp) \ |
| 1292 M(CheckStackOverflow, CheckStackOverflowComp) \ | 1292 M(CheckStackOverflow, CheckStackOverflowComp) \ |
| 1293 M(DoubleToDouble, DoubleToDoubleComp) \ | 1293 M(DoubleToDouble, DoubleToDoubleComp) \ |
| 1294 M(SmiToDouble, SmiToDoubleComp) \ | 1294 M(SmiToDouble, SmiToDoubleComp) \ |
| 1295 M(CheckClass, CheckClassComp) \ | 1295 M(CheckClass, CheckClassComp) \ |
| 1296 M(CheckSmi, CheckSmiComp) \ | 1296 M(CheckSmi, CheckSmiComp) \ |
| 1297 M(CheckNonSmi, CheckNonSmiComp) \ |
| 1297 M(Constant, ConstantComp) \ | 1298 M(Constant, ConstantComp) \ |
| 1298 M(CheckEitherNonSmi, CheckEitherNonSmiComp) \ | 1299 M(CheckEitherNonSmi, CheckEitherNonSmiComp) \ |
| 1299 M(UnboxedDoubleBinaryOp, UnboxedDoubleBinaryOpComp) \ | 1300 M(UnboxedDoubleBinaryOp, UnboxedDoubleBinaryOpComp) \ |
| 1300 M(UnboxDouble, UnboxDoubleComp) \ | 1301 M(UnboxDouble, UnboxDoubleComp) \ |
| 1301 M(BoxDouble, BoxDoubleComp) \ | 1302 M(BoxDouble, BoxDoubleComp) \ |
| 1302 M(CheckArrayBound, CheckArrayBoundComp) | 1303 M(CheckArrayBound, CheckArrayBoundComp) |
| 1303 | 1304 |
| 1304 | 1305 |
| 1305 #define FORWARD_DECLARATION(ShortName, ClassName) class ClassName; | 1306 #define FORWARD_DECLARATION(ShortName, ClassName) class ClassName; |
| 1306 FOR_EACH_COMPUTATION(FORWARD_DECLARATION) | 1307 FOR_EACH_COMPUTATION(FORWARD_DECLARATION) |
| (...skipping 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3241 | 3242 |
| 3242 virtual intptr_t deopt_id() const { return original_deopt_id_; } | 3243 virtual intptr_t deopt_id() const { return original_deopt_id_; } |
| 3243 | 3244 |
| 3244 private: | 3245 private: |
| 3245 const intptr_t original_deopt_id_; | 3246 const intptr_t original_deopt_id_; |
| 3246 | 3247 |
| 3247 DISALLOW_COPY_AND_ASSIGN(CheckSmiComp); | 3248 DISALLOW_COPY_AND_ASSIGN(CheckSmiComp); |
| 3248 }; | 3249 }; |
| 3249 | 3250 |
| 3250 | 3251 |
| 3252 class CheckNonSmiComp : public TemplateComputation<1> { |
| 3253 public: |
| 3254 CheckNonSmiComp(Value* value, intptr_t original_deopt_id) |
| 3255 : original_deopt_id_(original_deopt_id) { |
| 3256 ASSERT(value != NULL); |
| 3257 ASSERT(original_deopt_id != Isolate::kNoDeoptId); |
| 3258 inputs_[0] = value; |
| 3259 } |
| 3260 |
| 3261 DECLARE_COMPUTATION(CheckNonSmi) |
| 3262 |
| 3263 virtual bool CanDeoptimize() const { return true; } |
| 3264 virtual intptr_t ResultCid() const { return kIllegalCid; } |
| 3265 |
| 3266 virtual bool AttributesEqual(Computation* other) const { return true; } |
| 3267 |
| 3268 virtual bool HasSideEffect() const { return false; } |
| 3269 |
| 3270 Value* value() const { return inputs_[0]; } |
| 3271 |
| 3272 virtual intptr_t deopt_id() const { return original_deopt_id_; } |
| 3273 |
| 3274 private: |
| 3275 const intptr_t original_deopt_id_; |
| 3276 |
| 3277 DISALLOW_COPY_AND_ASSIGN(CheckNonSmiComp); |
| 3278 }; |
| 3279 |
| 3280 |
| 3251 class CheckArrayBoundComp : public TemplateComputation<2> { | 3281 class CheckArrayBoundComp : public TemplateComputation<2> { |
| 3252 public: | 3282 public: |
| 3253 CheckArrayBoundComp(Value* array, | 3283 CheckArrayBoundComp(Value* array, |
| 3254 Value* index, | 3284 Value* index, |
| 3255 intptr_t array_type, | 3285 intptr_t array_type, |
| 3256 InstanceCallComp* instance_call) | 3286 InstanceCallComp* instance_call) |
| 3257 : array_type_(array_type), instance_call_(instance_call) { | 3287 : array_type_(array_type), instance_call_(instance_call) { |
| 3258 ASSERT(array != NULL); | 3288 ASSERT(array != NULL); |
| 3259 ASSERT(index != NULL); | 3289 ASSERT(index != NULL); |
| 3260 inputs_[0] = array; | 3290 inputs_[0] = array; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3391 ForwardInstructionIterator* current_iterator_; | 3421 ForwardInstructionIterator* current_iterator_; |
| 3392 | 3422 |
| 3393 private: | 3423 private: |
| 3394 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 3424 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 3395 }; | 3425 }; |
| 3396 | 3426 |
| 3397 | 3427 |
| 3398 } // namespace dart | 3428 } // namespace dart |
| 3399 | 3429 |
| 3400 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 3430 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |