| 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 3242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3253 ZoneGrowableArray<PushArgumentInstr*>* arguments, | 3253 ZoneGrowableArray<PushArgumentInstr*>* arguments, |
| 3254 const ZoneGrowableArray<const ICData*>& ic_data_array) | 3254 const ZoneGrowableArray<const ICData*>& ic_data_array) |
| 3255 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), | 3255 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), |
| 3256 ic_data_(NULL), | 3256 ic_data_(NULL), |
| 3257 token_pos_(token_pos), | 3257 token_pos_(token_pos), |
| 3258 function_(function), | 3258 function_(function), |
| 3259 argument_names_(argument_names), | 3259 argument_names_(argument_names), |
| 3260 arguments_(arguments), | 3260 arguments_(arguments), |
| 3261 result_cid_(kDynamicCid), | 3261 result_cid_(kDynamicCid), |
| 3262 is_known_list_constructor_(false), | 3262 is_known_list_constructor_(false), |
| 3263 is_native_list_factory_(false), | |
| 3264 identity_(AliasIdentity::Unknown()) { | 3263 identity_(AliasIdentity::Unknown()) { |
| 3265 ic_data_ = GetICData(ic_data_array); | 3264 ic_data_ = GetICData(ic_data_array); |
| 3266 ASSERT(function.IsZoneHandle()); | 3265 ASSERT(function.IsZoneHandle()); |
| 3267 ASSERT(argument_names.IsZoneHandle() || argument_names.InVMHeap()); | 3266 ASSERT(argument_names.IsZoneHandle() || argument_names.InVMHeap()); |
| 3268 } | 3267 } |
| 3269 | 3268 |
| 3270 StaticCallInstr(TokenPosition token_pos, | 3269 StaticCallInstr(TokenPosition token_pos, |
| 3271 const Function& function, | 3270 const Function& function, |
| 3272 const Array& argument_names, | 3271 const Array& argument_names, |
| 3273 ZoneGrowableArray<PushArgumentInstr*>* arguments, | 3272 ZoneGrowableArray<PushArgumentInstr*>* arguments, |
| 3274 intptr_t deopt_id) | 3273 intptr_t deopt_id) |
| 3275 : TemplateDefinition(deopt_id), | 3274 : TemplateDefinition(deopt_id), |
| 3276 ic_data_(NULL), | 3275 ic_data_(NULL), |
| 3277 token_pos_(token_pos), | 3276 token_pos_(token_pos), |
| 3278 function_(function), | 3277 function_(function), |
| 3279 argument_names_(argument_names), | 3278 argument_names_(argument_names), |
| 3280 arguments_(arguments), | 3279 arguments_(arguments), |
| 3281 result_cid_(kDynamicCid), | 3280 result_cid_(kDynamicCid), |
| 3282 is_known_list_constructor_(false), | 3281 is_known_list_constructor_(false), |
| 3283 is_native_list_factory_(false), | |
| 3284 identity_(AliasIdentity::Unknown()) { | 3282 identity_(AliasIdentity::Unknown()) { |
| 3285 ASSERT(function.IsZoneHandle()); | 3283 ASSERT(function.IsZoneHandle()); |
| 3286 ASSERT(argument_names.IsZoneHandle() || argument_names.InVMHeap()); | 3284 ASSERT(argument_names.IsZoneHandle() || argument_names.InVMHeap()); |
| 3287 } | 3285 } |
| 3288 | 3286 |
| 3289 // ICData for static calls carries call count. | 3287 // ICData for static calls carries call count. |
| 3290 const ICData* ic_data() const { return ic_data_; } | 3288 const ICData* ic_data() const { return ic_data_; } |
| 3291 bool HasICData() const { | 3289 bool HasICData() const { |
| 3292 return (ic_data() != NULL) && !ic_data()->IsNull(); | 3290 return (ic_data() != NULL) && !ic_data()->IsNull(); |
| 3293 } | 3291 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 3319 | 3317 |
| 3320 virtual EffectSet Effects() const { return EffectSet::All(); } | 3318 virtual EffectSet Effects() const { return EffectSet::All(); } |
| 3321 | 3319 |
| 3322 void set_result_cid(intptr_t value) { result_cid_ = value; } | 3320 void set_result_cid(intptr_t value) { result_cid_ = value; } |
| 3323 | 3321 |
| 3324 bool is_known_list_constructor() const { return is_known_list_constructor_; } | 3322 bool is_known_list_constructor() const { return is_known_list_constructor_; } |
| 3325 void set_is_known_list_constructor(bool value) { | 3323 void set_is_known_list_constructor(bool value) { |
| 3326 is_known_list_constructor_ = value; | 3324 is_known_list_constructor_ = value; |
| 3327 } | 3325 } |
| 3328 | 3326 |
| 3329 bool is_native_list_factory() const { return is_native_list_factory_; } | |
| 3330 void set_is_native_list_factory(bool value) { | |
| 3331 is_native_list_factory_ = value; | |
| 3332 } | |
| 3333 | |
| 3334 bool IsRecognizedFactory() const { | 3327 bool IsRecognizedFactory() const { |
| 3335 return is_known_list_constructor() || is_native_list_factory(); | 3328 return is_known_list_constructor(); |
| 3336 } | 3329 } |
| 3337 | 3330 |
| 3338 virtual AliasIdentity Identity() const { return identity_; } | 3331 virtual AliasIdentity Identity() const { return identity_; } |
| 3339 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; } | 3332 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; } |
| 3340 | 3333 |
| 3341 PRINT_OPERANDS_TO_SUPPORT | 3334 PRINT_OPERANDS_TO_SUPPORT |
| 3342 | 3335 |
| 3343 private: | 3336 private: |
| 3344 const ICData* ic_data_; | 3337 const ICData* ic_data_; |
| 3345 const TokenPosition token_pos_; | 3338 const TokenPosition token_pos_; |
| 3346 const Function& function_; | 3339 const Function& function_; |
| 3347 const Array& argument_names_; | 3340 const Array& argument_names_; |
| 3348 ZoneGrowableArray<PushArgumentInstr*>* arguments_; | 3341 ZoneGrowableArray<PushArgumentInstr*>* arguments_; |
| 3349 intptr_t result_cid_; // For some library functions we know the result. | 3342 intptr_t result_cid_; // For some library functions we know the result. |
| 3350 | 3343 |
| 3351 // 'True' for recognized list constructors. | 3344 // 'True' for recognized list constructors. |
| 3352 bool is_known_list_constructor_; | 3345 bool is_known_list_constructor_; |
| 3353 bool is_native_list_factory_; | |
| 3354 | 3346 |
| 3355 AliasIdentity identity_; | 3347 AliasIdentity identity_; |
| 3356 | 3348 |
| 3357 DISALLOW_COPY_AND_ASSIGN(StaticCallInstr); | 3349 DISALLOW_COPY_AND_ASSIGN(StaticCallInstr); |
| 3358 }; | 3350 }; |
| 3359 | 3351 |
| 3360 | 3352 |
| 3361 class LoadLocalInstr : public TemplateDefinition<0, NoThrow> { | 3353 class LoadLocalInstr : public TemplateDefinition<0, NoThrow> { |
| 3362 public: | 3354 public: |
| 3363 LoadLocalInstr(const LocalVariable& local, | 3355 LoadLocalInstr(const LocalVariable& local, |
| (...skipping 4943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8307 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ | 8299 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ |
| 8308 UNIMPLEMENTED(); \ | 8300 UNIMPLEMENTED(); \ |
| 8309 return NULL; \ | 8301 return NULL; \ |
| 8310 } \ | 8302 } \ |
| 8311 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8303 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
| 8312 | 8304 |
| 8313 | 8305 |
| 8314 } // namespace dart | 8306 } // namespace dart |
| 8315 | 8307 |
| 8316 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 8308 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |