| 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 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 3090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3101 virtual void InferRange(); | 3101 virtual void InferRange(); |
| 3102 | 3102 |
| 3103 void set_recognized_kind(MethodRecognizer::Kind kind) { | 3103 void set_recognized_kind(MethodRecognizer::Kind kind) { |
| 3104 recognized_kind_ = kind; | 3104 recognized_kind_ = kind; |
| 3105 } | 3105 } |
| 3106 | 3106 |
| 3107 MethodRecognizer::Kind recognized_kind() const { | 3107 MethodRecognizer::Kind recognized_kind() const { |
| 3108 return recognized_kind_; | 3108 return recognized_kind_; |
| 3109 } | 3109 } |
| 3110 | 3110 |
| 3111 bool IsImmutableLengthLoad() const; |
| 3112 |
| 3113 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); |
| 3114 |
| 3115 static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid); |
| 3116 |
| 3111 private: | 3117 private: |
| 3112 const intptr_t offset_in_bytes_; | 3118 const intptr_t offset_in_bytes_; |
| 3113 const AbstractType& type_; | 3119 const AbstractType& type_; |
| 3114 intptr_t result_cid_; | 3120 intptr_t result_cid_; |
| 3115 const bool immutable_; | 3121 const bool immutable_; |
| 3116 | 3122 |
| 3117 MethodRecognizer::Kind recognized_kind_; | 3123 MethodRecognizer::Kind recognized_kind_; |
| 3118 | 3124 |
| 3119 DISALLOW_COPY_AND_ASSIGN(LoadFieldInstr); | 3125 DISALLOW_COPY_AND_ASSIGN(LoadFieldInstr); |
| 3120 }; | 3126 }; |
| (...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4201 | 4207 |
| 4202 Value* value() const { return inputs_[0]; } | 4208 Value* value() const { return inputs_[0]; } |
| 4203 | 4209 |
| 4204 private: | 4210 private: |
| 4205 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr); | 4211 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr); |
| 4206 }; | 4212 }; |
| 4207 | 4213 |
| 4208 | 4214 |
| 4209 class CheckArrayBoundInstr : public TemplateInstruction<2> { | 4215 class CheckArrayBoundInstr : public TemplateInstruction<2> { |
| 4210 public: | 4216 public: |
| 4211 CheckArrayBoundInstr(Value* array, | 4217 CheckArrayBoundInstr(Value* length, |
| 4212 Value* index, | 4218 Value* index, |
| 4213 intptr_t array_type, | 4219 intptr_t array_type, |
| 4214 InstanceCallInstr* instance_call) | 4220 InstanceCallInstr* instance_call) |
| 4215 : array_type_(array_type) { | 4221 : array_type_(array_type) { |
| 4216 ASSERT(array != NULL); | 4222 ASSERT(length != NULL); |
| 4217 ASSERT(index != NULL); | 4223 ASSERT(index != NULL); |
| 4218 inputs_[0] = array; | 4224 inputs_[0] = length; |
| 4219 inputs_[1] = index; | 4225 inputs_[1] = index; |
| 4220 deopt_id_ = instance_call->deopt_id(); | 4226 deopt_id_ = instance_call->deopt_id(); |
| 4221 } | 4227 } |
| 4222 | 4228 |
| 4223 DECLARE_INSTRUCTION(CheckArrayBound) | 4229 DECLARE_INSTRUCTION(CheckArrayBound) |
| 4224 virtual RawAbstractType* CompileType() const; | 4230 virtual RawAbstractType* CompileType() const; |
| 4225 | 4231 |
| 4226 virtual intptr_t ArgumentCount() const { return 0; } | 4232 virtual intptr_t ArgumentCount() const { return 0; } |
| 4227 | 4233 |
| 4228 virtual bool CanDeoptimize() const { return true; } | 4234 virtual bool CanDeoptimize() const { return true; } |
| 4229 | 4235 |
| 4230 virtual bool HasSideEffect() const { return false; } | 4236 virtual bool HasSideEffect() const { return false; } |
| 4231 | 4237 |
| 4232 virtual bool AttributesEqual(Instruction* other) const; | 4238 virtual bool AttributesEqual(Instruction* other) const; |
| 4233 | 4239 |
| 4234 virtual bool AffectedBySideEffect() const { return false; } | 4240 virtual bool AffectedBySideEffect() const { return false; } |
| 4235 | 4241 |
| 4236 Value* array() const { return inputs_[0]; } | 4242 Value* length() const { return inputs_[0]; } |
| 4237 Value* index() const { return inputs_[1]; } | 4243 Value* index() const { return inputs_[1]; } |
| 4238 | 4244 |
| 4239 intptr_t array_type() const { return array_type_; } | 4245 intptr_t array_type() const { return array_type_; } |
| 4240 | 4246 |
| 4241 bool IsRedundant(RangeBoundary length); | 4247 bool IsRedundant(RangeBoundary length); |
| 4242 | 4248 |
| 4243 // Returns the length offset for array and string types. | 4249 // Returns the length offset for array and string types. |
| 4244 static intptr_t LengthOffsetFor(intptr_t class_id); | 4250 static intptr_t LengthOffsetFor(intptr_t class_id); |
| 4245 | 4251 |
| 4246 static bool IsFixedLengthArrayType(intptr_t class_id); | 4252 static bool IsFixedLengthArrayType(intptr_t class_id); |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4470 ForwardInstructionIterator* current_iterator_; | 4476 ForwardInstructionIterator* current_iterator_; |
| 4471 | 4477 |
| 4472 private: | 4478 private: |
| 4473 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 4479 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 4474 }; | 4480 }; |
| 4475 | 4481 |
| 4476 | 4482 |
| 4477 } // namespace dart | 4483 } // namespace dart |
| 4478 | 4484 |
| 4479 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 4485 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |