| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_KERNEL_TO_IL_H_ | 5 #ifndef RUNTIME_VM_KERNEL_TO_IL_H_ |
| 6 #define RUNTIME_VM_KERNEL_TO_IL_H_ | 6 #define RUNTIME_VM_KERNEL_TO_IL_H_ |
| 7 | 7 |
| 8 #include "vm/growable_array.h" | 8 #include "vm/growable_array.h" |
| 9 #include "vm/hash_map.h" | 9 #include "vm/hash_map.h" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 static bool IsMatch(const TreeNode* key1, const Object& b) { | 31 static bool IsMatch(const TreeNode* key1, const Object& b) { |
| 32 return KeyAsSmi(key1) == Smi::Cast(b).raw(); | 32 return KeyAsSmi(key1) == Smi::Cast(b).raw(); |
| 33 } | 33 } |
| 34 static uword Hash(const Object& obj) { | 34 static uword Hash(const Object& obj) { |
| 35 const Smi& key = Smi::Cast(obj); | 35 const Smi& key = Smi::Cast(obj); |
| 36 return HashValue(key.Value()); | 36 return HashValue(key.Value()); |
| 37 } | 37 } |
| 38 static uword Hash(const TreeNode* key) { | 38 static uword Hash(const TreeNode* key) { |
| 39 return HashValue(Smi::Value(KeyAsSmi(key))); | 39 return HashValue(Smi::Value(KeyAsSmi(key))); |
| 40 } | 40 } |
| 41 static RawObject* NewKey(const TreeNode* key) { | 41 static RawObject* NewKey(const TreeNode* key) { return KeyAsSmi(key); } |
| 42 return KeyAsSmi(key); | |
| 43 } | |
| 44 | 42 |
| 45 private: | 43 private: |
| 46 static uword HashValue(intptr_t pos) { | 44 static uword HashValue(intptr_t pos) { return pos % (Smi::kMaxValue - 13); } |
| 47 return pos % (Smi::kMaxValue - 13); | |
| 48 } | |
| 49 | 45 |
| 50 static RawSmi* KeyAsSmi(const TreeNode* key) { | 46 static RawSmi* KeyAsSmi(const TreeNode* key) { |
| 51 // We exploit that all [TreeNode] objects will be aligned and therefore are | 47 // We exploit that all [TreeNode] objects will be aligned and therefore are |
| 52 // already [Smi]s! | 48 // already [Smi]s! |
| 53 return reinterpret_cast<RawSmi*>(const_cast<TreeNode*>(key)); | 49 return reinterpret_cast<RawSmi*>(const_cast<TreeNode*>(key)); |
| 54 } | 50 } |
| 55 }; | 51 }; |
| 56 typedef UnorderedHashMap<KernelConstMapKeyEqualsTraits> KernelConstantsMap; | 52 typedef UnorderedHashMap<KernelConstMapKeyEqualsTraits> KernelConstantsMap; |
| 57 | 53 |
| 58 | 54 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // is one. | 126 // is one. |
| 131 Member* member; | 127 Member* member; |
| 132 | 128 |
| 133 // The current function. | 129 // The current function. |
| 134 FunctionNode* kernel_function; | 130 FunctionNode* kernel_function; |
| 135 }; | 131 }; |
| 136 | 132 |
| 137 | 133 |
| 138 class ActiveClassScope { | 134 class ActiveClassScope { |
| 139 public: | 135 public: |
| 140 ActiveClassScope(ActiveClass* active_class, Class* kernel_class, | 136 ActiveClassScope(ActiveClass* active_class, |
| 137 Class* kernel_class, |
| 141 const dart::Class* klass) | 138 const dart::Class* klass) |
| 142 : active_class_(active_class), saved_(*active_class) { | 139 : active_class_(active_class), saved_(*active_class) { |
| 143 active_class_->kernel_class = kernel_class; | 140 active_class_->kernel_class = kernel_class; |
| 144 active_class_->klass = klass; | 141 active_class_->klass = klass; |
| 145 active_class_->member = NULL; | 142 active_class_->member = NULL; |
| 146 active_class_->kernel_function = NULL; | 143 active_class_->kernel_function = NULL; |
| 147 } | 144 } |
| 148 | 145 |
| 149 ~ActiveClassScope() { *active_class_ = saved_; } | 146 ~ActiveClassScope() { *active_class_ = saved_; } |
| 150 | 147 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 ActiveClass saved_; | 183 ActiveClass saved_; |
| 187 }; | 184 }; |
| 188 | 185 |
| 189 | 186 |
| 190 class TranslationHelper { | 187 class TranslationHelper { |
| 191 public: | 188 public: |
| 192 TranslationHelper(dart::Thread* thread, dart::Zone* zone, Isolate* isolate) | 189 TranslationHelper(dart::Thread* thread, dart::Zone* zone, Isolate* isolate) |
| 193 : thread_(thread), | 190 : thread_(thread), |
| 194 zone_(zone), | 191 zone_(zone), |
| 195 isolate_(isolate), | 192 isolate_(isolate), |
| 196 allocation_space_( | 193 allocation_space_(thread_->IsMutatorThread() ? Heap::kNew |
| 197 thread_->IsMutatorThread() ? Heap::kNew : Heap::kOld) {} | 194 : Heap::kOld) {} |
| 198 virtual ~TranslationHelper() {} | 195 virtual ~TranslationHelper() {} |
| 199 | 196 |
| 200 Thread* thread() { return thread_; } | 197 Thread* thread() { return thread_; } |
| 201 | 198 |
| 202 Zone* zone() { return zone_; } | 199 Zone* zone() { return zone_; } |
| 203 | 200 |
| 204 Isolate* isolate() { return isolate_; } | 201 Isolate* isolate() { return isolate_; } |
| 205 | 202 |
| 206 Heap::Space allocation_space() { return allocation_space_; } | 203 Heap::Space allocation_space() { return allocation_space_; } |
| 207 | 204 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // A subclass overrides these when reading in the Kernel program in order to | 238 // A subclass overrides these when reading in the Kernel program in order to |
| 242 // support recursive type expressions (e.g. for "implements X" ... | 239 // support recursive type expressions (e.g. for "implements X" ... |
| 243 // annotations). | 240 // annotations). |
| 244 virtual RawLibrary* LookupLibraryByKernelLibrary(Library* library); | 241 virtual RawLibrary* LookupLibraryByKernelLibrary(Library* library); |
| 245 virtual RawClass* LookupClassByKernelClass(Class* klass); | 242 virtual RawClass* LookupClassByKernelClass(Class* klass); |
| 246 | 243 |
| 247 RawField* LookupFieldByKernelField(Field* field); | 244 RawField* LookupFieldByKernelField(Field* field); |
| 248 RawFunction* LookupStaticMethodByKernelProcedure(Procedure* procedure); | 245 RawFunction* LookupStaticMethodByKernelProcedure(Procedure* procedure); |
| 249 RawFunction* LookupConstructorByKernelConstructor(Constructor* constructor); | 246 RawFunction* LookupConstructorByKernelConstructor(Constructor* constructor); |
| 250 dart::RawFunction* LookupConstructorByKernelConstructor( | 247 dart::RawFunction* LookupConstructorByKernelConstructor( |
| 251 const dart::Class& owner, Constructor* constructor); | 248 const dart::Class& owner, |
| 249 Constructor* constructor); |
| 252 | 250 |
| 253 dart::Type& GetCanonicalType(const dart::Class& klass); | 251 dart::Type& GetCanonicalType(const dart::Class& klass); |
| 254 | 252 |
| 255 void ReportError(const char* format, ...); | 253 void ReportError(const char* format, ...); |
| 256 void ReportError(const Error& prev_error, const char* format, ...); | 254 void ReportError(const Error& prev_error, const char* format, ...); |
| 257 | 255 |
| 258 private: | 256 private: |
| 259 // This will mangle [kernel_name] (if necessary) and make the result a symbol. | 257 // This will mangle [kernel_name] (if necessary) and make the result a symbol. |
| 260 // The result will be avilable in [name_to_modify] and it is also returned. | 258 // The result will be avilable in [name_to_modify] and it is also returned. |
| 261 dart::String& ManglePrivateName(Library* kernel_library, | 259 dart::String& ManglePrivateName(Library* kernel_library, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 275 // * T does not denote a type in scope | 273 // * T does not denote a type in scope |
| 276 // * T refers to a type parameter in a static member | 274 // * T refers to a type parameter in a static member |
| 277 // * T is a parametrized Type G<T1, ...> and G is malformed | 275 // * T is a parametrized Type G<T1, ...> and G is malformed |
| 278 // * T denotes declarations from multiple imports | 276 // * T denotes declarations from multiple imports |
| 279 // | 277 // |
| 280 // Any use of a malformed type gives rise to a static warning. A malformed | 278 // Any use of a malformed type gives rise to a static warning. A malformed |
| 281 // type is then interpreted as dynamic by the static type checker and the | 279 // type is then interpreted as dynamic by the static type checker and the |
| 282 // runtime unless explicitly specified otherwise. | 280 // runtime unless explicitly specified otherwise. |
| 283 class DartTypeTranslator : public DartTypeVisitor { | 281 class DartTypeTranslator : public DartTypeVisitor { |
| 284 public: | 282 public: |
| 285 DartTypeTranslator(TranslationHelper* helper, ActiveClass* active_class, | 283 DartTypeTranslator(TranslationHelper* helper, |
| 284 ActiveClass* active_class, |
| 286 bool finalize = true) | 285 bool finalize = true) |
| 287 : translation_helper_(*helper), | 286 : translation_helper_(*helper), |
| 288 active_class_(active_class), | 287 active_class_(active_class), |
| 289 zone_(helper->zone()), | 288 zone_(helper->zone()), |
| 290 result_(AbstractType::Handle(helper->zone())), | 289 result_(AbstractType::Handle(helper->zone())), |
| 291 finalize_(finalize) {} | 290 finalize_(finalize) {} |
| 292 | 291 |
| 293 // Can return a malformed type. | 292 // Can return a malformed type. |
| 294 AbstractType& TranslateType(DartType* node); | 293 AbstractType& TranslateType(DartType* node); |
| 295 | 294 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 310 | 309 |
| 311 virtual void VisitInterfaceType(InterfaceType* node); | 310 virtual void VisitInterfaceType(InterfaceType* node); |
| 312 | 311 |
| 313 virtual void VisitDynamicType(DynamicType* node); | 312 virtual void VisitDynamicType(DynamicType* node); |
| 314 | 313 |
| 315 virtual void VisitVoidType(VoidType* node); | 314 virtual void VisitVoidType(VoidType* node); |
| 316 | 315 |
| 317 // Will return `TypeArguments::null()` in case any of the arguments are | 316 // Will return `TypeArguments::null()` in case any of the arguments are |
| 318 // malformed. | 317 // malformed. |
| 319 const TypeArguments& TranslateInstantiatedTypeArguments( | 318 const TypeArguments& TranslateInstantiatedTypeArguments( |
| 320 const dart::Class& receiver_class, DartType** receiver_type_arguments, | 319 const dart::Class& receiver_class, |
| 320 DartType** receiver_type_arguments, |
| 321 intptr_t length); | 321 intptr_t length); |
| 322 | 322 |
| 323 // Will return `TypeArguments::null()` in case any of the arguments are | 323 // Will return `TypeArguments::null()` in case any of the arguments are |
| 324 // malformed. | 324 // malformed. |
| 325 const TypeArguments& TranslateTypeArguments(DartType** dart_types, | 325 const TypeArguments& TranslateTypeArguments(DartType** dart_types, |
| 326 intptr_t length); | 326 intptr_t length); |
| 327 | 327 |
| 328 const Type& ReceiverType(const dart::Class& klass); | 328 const Type& ReceiverType(const dart::Class& klass); |
| 329 | 329 |
| 330 private: | 330 private: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 351 // f(a, [b = <expr>]) | 351 // f(a, [b = <expr>]) |
| 352 // f(a, {b: <expr>}) | 352 // f(a, {b: <expr>}) |
| 353 // | 353 // |
| 354 // * constant values to compare in a [SwitchCase] | 354 // * constant values to compare in a [SwitchCase] |
| 355 // case <expr>: | 355 // case <expr>: |
| 356 // | 356 // |
| 357 // In all cases `<expr>` must be recursively evaluated and canonicalized at | 357 // In all cases `<expr>` must be recursively evaluated and canonicalized at |
| 358 // compile-time. | 358 // compile-time. |
| 359 class ConstantEvaluator : public ExpressionVisitor { | 359 class ConstantEvaluator : public ExpressionVisitor { |
| 360 public: | 360 public: |
| 361 ConstantEvaluator(FlowGraphBuilder* builder, Zone* zone, TranslationHelper* h, | 361 ConstantEvaluator(FlowGraphBuilder* builder, |
| 362 Zone* zone, |
| 363 TranslationHelper* h, |
| 362 DartTypeTranslator* type_translator); | 364 DartTypeTranslator* type_translator); |
| 363 virtual ~ConstantEvaluator() {} | 365 virtual ~ConstantEvaluator() {} |
| 364 | 366 |
| 365 Instance& EvaluateExpression(Expression* node); | 367 Instance& EvaluateExpression(Expression* node); |
| 366 Object& EvaluateExpressionSafe(Expression* node); | 368 Object& EvaluateExpressionSafe(Expression* node); |
| 367 Instance& EvaluateConstructorInvocation(ConstructorInvocation* node); | 369 Instance& EvaluateConstructorInvocation(ConstructorInvocation* node); |
| 368 Instance& EvaluateListLiteral(ListLiteral* node); | 370 Instance& EvaluateListLiteral(ListLiteral* node); |
| 369 Instance& EvaluateMapLiteral(MapLiteral* node); | 371 Instance& EvaluateMapLiteral(MapLiteral* node); |
| 370 | 372 |
| 371 virtual void VisitDefaultExpression(Expression* node) { UNREACHABLE(); } | 373 virtual void VisitDefaultExpression(Expression* node) { UNREACHABLE(); } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 396 private: | 398 private: |
| 397 // This will translate type arguments form [kernel_arguments]. If no type | 399 // This will translate type arguments form [kernel_arguments]. If no type |
| 398 // arguments are passed and the [target] is a factory then the null type | 400 // arguments are passed and the [target] is a factory then the null type |
| 399 // argument array will be returned. | 401 // argument array will be returned. |
| 400 // | 402 // |
| 401 // If none of these cases apply, NULL will be returned. | 403 // If none of these cases apply, NULL will be returned. |
| 402 const TypeArguments* TranslateTypeArguments(const Function& target, | 404 const TypeArguments* TranslateTypeArguments(const Function& target, |
| 403 dart::Class* target_klass, | 405 dart::Class* target_klass, |
| 404 Arguments* kernel_arguments); | 406 Arguments* kernel_arguments); |
| 405 | 407 |
| 406 const Object& RunFunction(const Function& function, Arguments* arguments, | 408 const Object& RunFunction(const Function& function, |
| 409 Arguments* arguments, |
| 407 const Instance* receiver = NULL, | 410 const Instance* receiver = NULL, |
| 408 const TypeArguments* type_args = NULL); | 411 const TypeArguments* type_args = NULL); |
| 409 | 412 |
| 410 const Object& RunFunction(const Function& function, const Array& arguments, | 413 const Object& RunFunction(const Function& function, |
| 414 const Array& arguments, |
| 411 const Array& names); | 415 const Array& names); |
| 412 | 416 |
| 413 RawObject* EvaluateConstConstructorCall(const dart::Class& type_class, | 417 RawObject* EvaluateConstConstructorCall(const dart::Class& type_class, |
| 414 const TypeArguments& type_arguments, | 418 const TypeArguments& type_arguments, |
| 415 const Function& constructor, | 419 const Function& constructor, |
| 416 const Object& argument); | 420 const Object& argument); |
| 417 | 421 |
| 418 // TODO(27590): Instead of using [dart::kernel::TreeNode]s as keys we | 422 // TODO(27590): Instead of using [dart::kernel::TreeNode]s as keys we |
| 419 // should use [TokenPosition]s as well as the existing functionality in | 423 // should use [TokenPosition]s as well as the existing functionality in |
| 420 // `Parser::CacheConstantValue`. | 424 // `Parser::CacheConstantValue`. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 434 | 438 |
| 435 struct FunctionScope { | 439 struct FunctionScope { |
| 436 FunctionNode* function; | 440 FunctionNode* function; |
| 437 LocalScope* scope; | 441 LocalScope* scope; |
| 438 }; | 442 }; |
| 439 | 443 |
| 440 | 444 |
| 441 class ScopeBuildingResult : public ZoneAllocated { | 445 class ScopeBuildingResult : public ZoneAllocated { |
| 442 public: | 446 public: |
| 443 ScopeBuildingResult() | 447 ScopeBuildingResult() |
| 444 : this_variable(NULL), | 448 : this_variable(NULL), |
| 445 type_arguments_variable(NULL), | 449 type_arguments_variable(NULL), |
| 446 switch_variable(NULL), | 450 switch_variable(NULL), |
| 447 finally_return_variable(NULL), | 451 finally_return_variable(NULL), |
| 448 setter_value(NULL), | 452 setter_value(NULL), |
| 449 yield_jump_variable(NULL), | 453 yield_jump_variable(NULL), |
| 450 yield_context_variable(NULL) {} | 454 yield_context_variable(NULL) {} |
| 451 | 455 |
| 452 Map<VariableDeclaration, LocalVariable*> locals; | 456 Map<VariableDeclaration, LocalVariable*> locals; |
| 453 Map<TreeNode, LocalScope*> scopes; | 457 Map<TreeNode, LocalScope*> scopes; |
| 454 GrowableArray<FunctionScope> function_scopes; | 458 GrowableArray<FunctionScope> function_scopes; |
| 455 | 459 |
| 456 // Only non-NULL for instance functions. | 460 // Only non-NULL for instance functions. |
| 457 LocalVariable* this_variable; | 461 LocalVariable* this_variable; |
| 458 | 462 |
| 459 // Only non-NULL for factory constructor functions. | 463 // Only non-NULL for factory constructor functions. |
| 460 LocalVariable* type_arguments_variable; | 464 LocalVariable* type_arguments_variable; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 void ExitScope(); | 543 void ExitScope(); |
| 540 | 544 |
| 541 const Type& TranslateVariableType(VariableDeclaration* variable); | 545 const Type& TranslateVariableType(VariableDeclaration* variable); |
| 542 LocalVariable* MakeVariable(const dart::String& name, | 546 LocalVariable* MakeVariable(const dart::String& name, |
| 543 const AbstractType& type); | 547 const AbstractType& type); |
| 544 | 548 |
| 545 void AddParameters(FunctionNode* function, intptr_t pos = 0); | 549 void AddParameters(FunctionNode* function, intptr_t pos = 0); |
| 546 void AddParameter(VariableDeclaration* declaration, intptr_t pos); | 550 void AddParameter(VariableDeclaration* declaration, intptr_t pos); |
| 547 void AddVariable(VariableDeclaration* declaration); | 551 void AddVariable(VariableDeclaration* declaration); |
| 548 void AddExceptionVariable(GrowableArray<LocalVariable*>* variables, | 552 void AddExceptionVariable(GrowableArray<LocalVariable*>* variables, |
| 549 const char* prefix, intptr_t nesting_depth); | 553 const char* prefix, |
| 554 intptr_t nesting_depth); |
| 550 void AddTryVariables(); | 555 void AddTryVariables(); |
| 551 void AddCatchVariables(); | 556 void AddCatchVariables(); |
| 552 void AddIteratorVariable(); | 557 void AddIteratorVariable(); |
| 553 void AddSwitchVariable(); | 558 void AddSwitchVariable(); |
| 554 | 559 |
| 555 // Record an assignment or reference to a variable. If the occurrence is | 560 // Record an assignment or reference to a variable. If the occurrence is |
| 556 // in a nested function, ensure that the variable is handled properly as a | 561 // in a nested function, ensure that the variable is handled properly as a |
| 557 // captured variable. | 562 // captured variable. |
| 558 void LookupVariable(VariableDeclaration* declaration); | 563 void LookupVariable(VariableDeclaration* declaration); |
| 559 | 564 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 LocalScope* current_function_scope_; | 601 LocalScope* current_function_scope_; |
| 597 LocalScope* scope_; | 602 LocalScope* scope_; |
| 598 DepthState depth_; | 603 DepthState depth_; |
| 599 | 604 |
| 600 intptr_t name_index_; | 605 intptr_t name_index_; |
| 601 }; | 606 }; |
| 602 | 607 |
| 603 | 608 |
| 604 class FlowGraphBuilder : public TreeVisitor { | 609 class FlowGraphBuilder : public TreeVisitor { |
| 605 public: | 610 public: |
| 606 FlowGraphBuilder(TreeNode* node, ParsedFunction* parsed_function, | 611 FlowGraphBuilder(TreeNode* node, |
| 612 ParsedFunction* parsed_function, |
| 607 const ZoneGrowableArray<const ICData*>& ic_data_array, | 613 const ZoneGrowableArray<const ICData*>& ic_data_array, |
| 608 InlineExitCollector* exit_collector, intptr_t osr_id, | 614 InlineExitCollector* exit_collector, |
| 615 intptr_t osr_id, |
| 609 intptr_t first_block_id = 1); | 616 intptr_t first_block_id = 1); |
| 610 virtual ~FlowGraphBuilder(); | 617 virtual ~FlowGraphBuilder(); |
| 611 | 618 |
| 612 FlowGraph* BuildGraph(); | 619 FlowGraph* BuildGraph(); |
| 613 | 620 |
| 614 virtual void VisitDefaultTreeNode(TreeNode* node) { UNREACHABLE(); } | 621 virtual void VisitDefaultTreeNode(TreeNode* node) { UNREACHABLE(); } |
| 615 | 622 |
| 616 virtual void VisitInvalidExpression(InvalidExpression* node); | 623 virtual void VisitInvalidExpression(InvalidExpression* node); |
| 617 virtual void VisitNullLiteral(NullLiteral* node); | 624 virtual void VisitNullLiteral(NullLiteral* node); |
| 618 virtual void VisitBoolLiteral(BoolLiteral* node); | 625 virtual void VisitBoolLiteral(BoolLiteral* node); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 TargetEntryInstr** otherwise_entry); | 745 TargetEntryInstr** otherwise_entry); |
| 739 Fragment CatchBlockEntry(const Array& handler_types, intptr_t handler_index); | 746 Fragment CatchBlockEntry(const Array& handler_types, intptr_t handler_index); |
| 740 Fragment TryCatch(int try_handler_index); | 747 Fragment TryCatch(int try_handler_index); |
| 741 Fragment CheckStackOverflowInPrologue(); | 748 Fragment CheckStackOverflowInPrologue(); |
| 742 Fragment CheckStackOverflow(); | 749 Fragment CheckStackOverflow(); |
| 743 Fragment CloneContext(); | 750 Fragment CloneContext(); |
| 744 Fragment Constant(const Object& value); | 751 Fragment Constant(const Object& value); |
| 745 Fragment CreateArray(); | 752 Fragment CreateArray(); |
| 746 Fragment Goto(JoinEntryInstr* destination); | 753 Fragment Goto(JoinEntryInstr* destination); |
| 747 Fragment IntConstant(int64_t value); | 754 Fragment IntConstant(int64_t value); |
| 748 Fragment InstanceCall(const dart::String& name, Token::Kind kind, | 755 Fragment InstanceCall(const dart::String& name, |
| 749 intptr_t argument_count, intptr_t num_args_checked = 1); | 756 Token::Kind kind, |
| 750 Fragment InstanceCall(const dart::String& name, Token::Kind kind, | 757 intptr_t argument_count, |
| 751 intptr_t argument_count, const Array& argument_names, | 758 intptr_t num_args_checked = 1); |
| 759 Fragment InstanceCall(const dart::String& name, |
| 760 Token::Kind kind, |
| 761 intptr_t argument_count, |
| 762 const Array& argument_names, |
| 752 intptr_t num_args_checked = 1); | 763 intptr_t num_args_checked = 1); |
| 753 Fragment ClosureCall(int argument_count, const Array& argument_names); | 764 Fragment ClosureCall(int argument_count, const Array& argument_names); |
| 754 Fragment ThrowException(); | 765 Fragment ThrowException(); |
| 755 Fragment RethrowException(int catch_try_index); | 766 Fragment RethrowException(int catch_try_index); |
| 756 Fragment LoadClassId(); | 767 Fragment LoadClassId(); |
| 757 Fragment LoadField(const dart::Field& field); | 768 Fragment LoadField(const dart::Field& field); |
| 758 Fragment LoadField(intptr_t offset, intptr_t class_id = kDynamicCid); | 769 Fragment LoadField(intptr_t offset, intptr_t class_id = kDynamicCid); |
| 759 Fragment LoadNativeField(MethodRecognizer::Kind kind, intptr_t offset, | 770 Fragment LoadNativeField(MethodRecognizer::Kind kind, |
| 760 const Type& type, intptr_t class_id, | 771 intptr_t offset, |
| 772 const Type& type, |
| 773 intptr_t class_id, |
| 761 bool is_immutable = false); | 774 bool is_immutable = false); |
| 762 Fragment LoadLocal(LocalVariable* variable); | 775 Fragment LoadLocal(LocalVariable* variable); |
| 763 Fragment InitStaticField(const dart::Field& field); | 776 Fragment InitStaticField(const dart::Field& field); |
| 764 Fragment LoadStaticField(); | 777 Fragment LoadStaticField(); |
| 765 Fragment NullConstant(); | 778 Fragment NullConstant(); |
| 766 Fragment NativeCall(const dart::String* name, const Function* function); | 779 Fragment NativeCall(const dart::String* name, const Function* function); |
| 767 Fragment PushArgument(); | 780 Fragment PushArgument(); |
| 768 Fragment Return(); | 781 Fragment Return(); |
| 769 Fragment StaticCall(const Function& target, intptr_t argument_count); | 782 Fragment StaticCall(const Function& target, intptr_t argument_count); |
| 770 Fragment StaticCall(const Function& target, intptr_t argument_count, | 783 Fragment StaticCall(const Function& target, |
| 784 intptr_t argument_count, |
| 771 const Array& argument_names); | 785 const Array& argument_names); |
| 772 Fragment StoreIndexed(intptr_t class_id); | 786 Fragment StoreIndexed(intptr_t class_id); |
| 773 Fragment StoreInstanceFieldGuarded(const dart::Field& field); | 787 Fragment StoreInstanceFieldGuarded(const dart::Field& field); |
| 774 Fragment StoreInstanceField( | 788 Fragment StoreInstanceField( |
| 775 const dart::Field& field, | 789 const dart::Field& field, |
| 776 StoreBarrierType emit_store_barrier = kEmitStoreBarrier); | 790 StoreBarrierType emit_store_barrier = kEmitStoreBarrier); |
| 777 Fragment StoreInstanceField( | 791 Fragment StoreInstanceField( |
| 778 intptr_t offset, | 792 intptr_t offset, |
| 779 StoreBarrierType emit_store_barrier = kEmitStoreBarrier); | 793 StoreBarrierType emit_store_barrier = kEmitStoreBarrier); |
| 780 Fragment StoreLocal(LocalVariable* variable); | 794 Fragment StoreLocal(LocalVariable* variable); |
| 781 Fragment StoreStaticField(const dart::Field& field); | 795 Fragment StoreStaticField(const dart::Field& field); |
| 782 Fragment StringInterpolate(); | 796 Fragment StringInterpolate(); |
| 783 Fragment ThrowTypeError(); | 797 Fragment ThrowTypeError(); |
| 784 Fragment ThrowNoSuchMethodError(); | 798 Fragment ThrowNoSuchMethodError(); |
| 785 Fragment BuildImplicitClosureCreation(const Function& target); | 799 Fragment BuildImplicitClosureCreation(const Function& target); |
| 786 Fragment GuardFieldLength(const dart::Field& field, intptr_t deopt_id); | 800 Fragment GuardFieldLength(const dart::Field& field, intptr_t deopt_id); |
| 787 Fragment GuardFieldClass(const dart::Field& field, intptr_t deopt_id); | 801 Fragment GuardFieldClass(const dart::Field& field, intptr_t deopt_id); |
| 788 | 802 |
| 789 dart::RawFunction* LookupMethodByMember(Member* target, | 803 dart::RawFunction* LookupMethodByMember(Member* target, |
| 790 const dart::String& method_name); | 804 const dart::String& method_name); |
| 791 | 805 |
| 792 LocalVariable* MakeTemporary(); | 806 LocalVariable* MakeTemporary(); |
| 793 LocalVariable* MakeNonTemporary(const dart::String& symbol); | 807 LocalVariable* MakeNonTemporary(const dart::String& symbol); |
| 794 | 808 |
| 795 intptr_t CurrentTryIndex(); | 809 intptr_t CurrentTryIndex(); |
| 796 intptr_t AllocateTryIndex() { return next_used_try_index_++; } | 810 intptr_t AllocateTryIndex() { return next_used_try_index_++; } |
| 797 | 811 |
| 798 void AddVariable(VariableDeclaration* declaration, LocalVariable* variable); | 812 void AddVariable(VariableDeclaration* declaration, LocalVariable* variable); |
| 799 void AddParameter(VariableDeclaration* declaration, LocalVariable* variable, | 813 void AddParameter(VariableDeclaration* declaration, |
| 814 LocalVariable* variable, |
| 800 intptr_t pos); | 815 intptr_t pos); |
| 801 dart::LocalVariable* LookupVariable(VariableDeclaration* var); | 816 dart::LocalVariable* LookupVariable(VariableDeclaration* var); |
| 802 | 817 |
| 803 void SetTempIndex(Definition* definition); | 818 void SetTempIndex(Definition* definition); |
| 804 | 819 |
| 805 void Push(Definition* definition); | 820 void Push(Definition* definition); |
| 806 Value* Pop(); | 821 Value* Pop(); |
| 807 Fragment Drop(); | 822 Fragment Drop(); |
| 808 | 823 |
| 809 bool IsInlining() { return exit_collector_ != NULL; } | 824 bool IsInlining() { return exit_collector_ != NULL; } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 friend class SwitchBlock; | 914 friend class SwitchBlock; |
| 900 friend class TryCatchBlock; | 915 friend class TryCatchBlock; |
| 901 friend class TryFinallyBlock; | 916 friend class TryFinallyBlock; |
| 902 }; | 917 }; |
| 903 | 918 |
| 904 } // namespace kernel | 919 } // namespace kernel |
| 905 } // namespace dart | 920 } // namespace dart |
| 906 | 921 |
| 907 | 922 |
| 908 #endif // RUNTIME_VM_KERNEL_TO_IL_H_ | 923 #endif // RUNTIME_VM_KERNEL_TO_IL_H_ |
| OLD | NEW |