| 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 #if !defined(DART_PRECOMPILED_RUNTIME) | 8 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 9 | 9 |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 bool MemberIsFactoryProcedure() { | 207 bool MemberIsFactoryProcedure() { |
| 208 ASSERT(member != NULL); | 208 ASSERT(member != NULL); |
| 209 return member->IsFactory(); | 209 return member->IsFactory(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 intptr_t MemberTypeParameterCount(Zone* zone); | 212 intptr_t MemberTypeParameterCount(Zone* zone); |
| 213 | 213 |
| 214 intptr_t ClassTypeParameterCount(Zone* zone) { | 214 intptr_t ClassTypeParameterCount(Zone* zone) { |
| 215 ASSERT(member != NULL); | 215 ASSERT(member != NULL); |
| 216 TypeArguments& class_types = | 216 TypeArguments& class_types = |
| 217 dart::TypeArguments::Handle(zone, klass->type_parameters()); | 217 TypeArguments::Handle(zone, klass->type_parameters()); |
| 218 return class_types.Length(); | 218 return class_types.Length(); |
| 219 } | 219 } |
| 220 | 220 |
| 221 // The current enclosing class (or the library top-level class). | 221 // The current enclosing class (or the library top-level class). |
| 222 const dart::Class* klass; | 222 const Class* klass; |
| 223 | 223 |
| 224 const dart::Function* member; | 224 const Function* member; |
| 225 }; | 225 }; |
| 226 | 226 |
| 227 class ActiveClassScope { | 227 class ActiveClassScope { |
| 228 public: | 228 public: |
| 229 ActiveClassScope(ActiveClass* active_class, const dart::Class* klass) | 229 ActiveClassScope(ActiveClass* active_class, const Class* klass) |
| 230 : active_class_(active_class), saved_(*active_class) { | 230 : active_class_(active_class), saved_(*active_class) { |
| 231 active_class_->klass = klass; | 231 active_class_->klass = klass; |
| 232 } | 232 } |
| 233 | 233 |
| 234 ~ActiveClassScope() { *active_class_ = saved_; } | 234 ~ActiveClassScope() { *active_class_ = saved_; } |
| 235 | 235 |
| 236 private: | 236 private: |
| 237 ActiveClass* active_class_; | 237 ActiveClass* active_class_; |
| 238 ActiveClass saved_; | 238 ActiveClass saved_; |
| 239 }; | 239 }; |
| 240 | 240 |
| 241 class ActiveMemberScope { | 241 class ActiveMemberScope { |
| 242 public: | 242 public: |
| 243 ActiveMemberScope(ActiveClass* active_class, const Function* member) | 243 ActiveMemberScope(ActiveClass* active_class, const Function* member) |
| 244 : active_class_(active_class), saved_(*active_class) { | 244 : active_class_(active_class), saved_(*active_class) { |
| 245 // The class is inherited. | 245 // The class is inherited. |
| 246 active_class_->member = member; | 246 active_class_->member = member; |
| 247 } | 247 } |
| 248 | 248 |
| 249 ~ActiveMemberScope() { *active_class_ = saved_; } | 249 ~ActiveMemberScope() { *active_class_ = saved_; } |
| 250 | 250 |
| 251 private: | 251 private: |
| 252 ActiveClass* active_class_; | 252 ActiveClass* active_class_; |
| 253 ActiveClass saved_; | 253 ActiveClass saved_; |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 class TranslationHelper { | 256 class TranslationHelper { |
| 257 public: | 257 public: |
| 258 explicit TranslationHelper(dart::Thread* thread); | 258 explicit TranslationHelper(Thread* thread); |
| 259 | 259 |
| 260 TranslationHelper(dart::Thread* thread, | 260 TranslationHelper(Thread* thread, |
| 261 dart::RawTypedData* string_offsets, | 261 RawTypedData* string_offsets, |
| 262 dart::RawTypedData* string_data, | 262 RawTypedData* string_data, |
| 263 dart::RawTypedData* canonical_names); | 263 RawTypedData* canonical_names); |
| 264 | 264 |
| 265 virtual ~TranslationHelper() {} | 265 virtual ~TranslationHelper() {} |
| 266 | 266 |
| 267 Thread* thread() { return thread_; } | 267 Thread* thread() { return thread_; } |
| 268 | 268 |
| 269 Zone* zone() { return zone_; } | 269 Zone* zone() { return zone_; } |
| 270 | 270 |
| 271 Isolate* isolate() { return isolate_; } | 271 Isolate* isolate() { return isolate_; } |
| 272 | 272 |
| 273 Heap::Space allocation_space() { return allocation_space_; } | 273 Heap::Space allocation_space() { return allocation_space_; } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 303 bool IsGetter(NameIndex name); | 303 bool IsGetter(NameIndex name); |
| 304 bool IsSetter(NameIndex name); | 304 bool IsSetter(NameIndex name); |
| 305 bool IsFactory(NameIndex name); | 305 bool IsFactory(NameIndex name); |
| 306 | 306 |
| 307 // For a member (field, constructor, or procedure) return the canonical name | 307 // For a member (field, constructor, or procedure) return the canonical name |
| 308 // of the enclosing class or library. | 308 // of the enclosing class or library. |
| 309 NameIndex EnclosingName(NameIndex name); | 309 NameIndex EnclosingName(NameIndex name); |
| 310 | 310 |
| 311 RawInstance* Canonicalize(const Instance& instance); | 311 RawInstance* Canonicalize(const Instance& instance); |
| 312 | 312 |
| 313 const dart::String& DartString(const char* content) { | 313 const String& DartString(const char* content) { |
| 314 return DartString(content, allocation_space_); | 314 return DartString(content, allocation_space_); |
| 315 } | 315 } |
| 316 const dart::String& DartString(const char* content, Heap::Space space); | 316 const String& DartString(const char* content, Heap::Space space); |
| 317 | 317 |
| 318 dart::String& DartString(StringIndex index) { | 318 String& DartString(StringIndex index) { |
| 319 return DartString(index, allocation_space_); | 319 return DartString(index, allocation_space_); |
| 320 } | 320 } |
| 321 dart::String& DartString(StringIndex string_index, Heap::Space space); | 321 String& DartString(StringIndex string_index, Heap::Space space); |
| 322 | 322 |
| 323 dart::String& DartString(const uint8_t* utf8_array, | 323 String& DartString(const uint8_t* utf8_array, |
| 324 intptr_t len, | 324 intptr_t len, |
| 325 Heap::Space space); | 325 Heap::Space space); |
| 326 | 326 |
| 327 const dart::String& DartSymbol(const char* content) const; | 327 const String& DartSymbol(const char* content) const; |
| 328 dart::String& DartSymbol(StringIndex string_index) const; | 328 String& DartSymbol(StringIndex string_index) const; |
| 329 dart::String& DartSymbol(const uint8_t* utf8_array, intptr_t len) const; | 329 String& DartSymbol(const uint8_t* utf8_array, intptr_t len) const; |
| 330 | 330 |
| 331 const dart::String& DartClassName(NameIndex kernel_class); | 331 const String& DartClassName(NameIndex kernel_class); |
| 332 | 332 |
| 333 const dart::String& DartConstructorName(NameIndex constructor); | 333 const String& DartConstructorName(NameIndex constructor); |
| 334 | 334 |
| 335 const dart::String& DartProcedureName(NameIndex procedure); | 335 const String& DartProcedureName(NameIndex procedure); |
| 336 | 336 |
| 337 const dart::String& DartSetterName(NameIndex setter); | 337 const String& DartSetterName(NameIndex setter); |
| 338 const dart::String& DartSetterName(NameIndex parent, StringIndex setter); | 338 const String& DartSetterName(NameIndex parent, StringIndex setter); |
| 339 | 339 |
| 340 const dart::String& DartGetterName(NameIndex getter); | 340 const String& DartGetterName(NameIndex getter); |
| 341 const dart::String& DartGetterName(NameIndex parent, StringIndex getter); | 341 const String& DartGetterName(NameIndex parent, StringIndex getter); |
| 342 | 342 |
| 343 const dart::String& DartFieldName(NameIndex parent, StringIndex field); | 343 const String& DartFieldName(NameIndex parent, StringIndex field); |
| 344 | 344 |
| 345 const dart::String& DartMethodName(NameIndex method); | 345 const String& DartMethodName(NameIndex method); |
| 346 const dart::String& DartMethodName(NameIndex parent, StringIndex method); | 346 const String& DartMethodName(NameIndex parent, StringIndex method); |
| 347 | 347 |
| 348 const dart::String& DartFactoryName(NameIndex factory); | 348 const String& DartFactoryName(NameIndex factory); |
| 349 | 349 |
| 350 // A subclass overrides these when reading in the Kernel program in order to | 350 // A subclass overrides these when reading in the Kernel program in order to |
| 351 // support recursive type expressions (e.g. for "implements X" ... | 351 // support recursive type expressions (e.g. for "implements X" ... |
| 352 // annotations). | 352 // annotations). |
| 353 virtual RawLibrary* LookupLibraryByKernelLibrary(NameIndex library); | 353 virtual RawLibrary* LookupLibraryByKernelLibrary(NameIndex library); |
| 354 virtual RawClass* LookupClassByKernelClass(NameIndex klass); | 354 virtual RawClass* LookupClassByKernelClass(NameIndex klass); |
| 355 | 355 |
| 356 RawField* LookupFieldByKernelField(NameIndex field); | 356 RawField* LookupFieldByKernelField(NameIndex field); |
| 357 RawFunction* LookupStaticMethodByKernelProcedure(NameIndex procedure); | 357 RawFunction* LookupStaticMethodByKernelProcedure(NameIndex procedure); |
| 358 RawFunction* LookupConstructorByKernelConstructor(NameIndex constructor); | 358 RawFunction* LookupConstructorByKernelConstructor(NameIndex constructor); |
| 359 dart::RawFunction* LookupConstructorByKernelConstructor( | 359 RawFunction* LookupConstructorByKernelConstructor(const Class& owner, |
| 360 const dart::Class& owner, | 360 NameIndex constructor); |
| 361 NameIndex constructor); | |
| 362 | 361 |
| 363 dart::Type& GetCanonicalType(const dart::Class& klass); | 362 Type& GetCanonicalType(const Class& klass); |
| 364 | 363 |
| 365 void ReportError(const char* format, ...); | 364 void ReportError(const char* format, ...); |
| 366 void ReportError(const Error& prev_error, const char* format, ...); | 365 void ReportError(const Error& prev_error, const char* format, ...); |
| 367 | 366 |
| 368 private: | 367 private: |
| 369 // This will mangle [name_to_modify] if necessary and make the result a symbol | 368 // This will mangle [name_to_modify] if necessary and make the result a symbol |
| 370 // if asked. The result will be available in [name_to_modify] and it is also | 369 // if asked. The result will be available in [name_to_modify] and it is also |
| 371 // returned. If the name is private, the canonical name [parent] will be used | 370 // returned. If the name is private, the canonical name [parent] will be used |
| 372 // to get the import URI of the library where the name is visible. | 371 // to get the import URI of the library where the name is visible. |
| 373 dart::String& ManglePrivateName(NameIndex parent, | 372 String& ManglePrivateName(NameIndex parent, |
| 374 dart::String* name_to_modify, | 373 String* name_to_modify, |
| 375 bool symbolize = true); | 374 bool symbolize = true); |
| 376 | 375 |
| 377 Thread* thread_; | 376 Thread* thread_; |
| 378 Zone* zone_; | 377 Zone* zone_; |
| 379 Isolate* isolate_; | 378 Isolate* isolate_; |
| 380 Heap::Space allocation_space_; | 379 Heap::Space allocation_space_; |
| 381 | 380 |
| 382 TypedData& string_offsets_; | 381 TypedData& string_offsets_; |
| 383 TypedData& string_data_; | 382 TypedData& string_data_; |
| 384 TypedData& canonical_names_; | 383 TypedData& canonical_names_; |
| 385 }; | 384 }; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 | 490 |
| 492 Fragment LoadInstantiatorTypeArguments(); | 491 Fragment LoadInstantiatorTypeArguments(); |
| 493 Fragment LoadFunctionTypeArguments(); | 492 Fragment LoadFunctionTypeArguments(); |
| 494 Fragment InstantiateType(const AbstractType& type); | 493 Fragment InstantiateType(const AbstractType& type); |
| 495 Fragment InstantiateTypeArguments(const TypeArguments& type_arguments); | 494 Fragment InstantiateTypeArguments(const TypeArguments& type_arguments); |
| 496 Fragment TranslateInstantiatedTypeArguments( | 495 Fragment TranslateInstantiatedTypeArguments( |
| 497 const TypeArguments& type_arguments); | 496 const TypeArguments& type_arguments); |
| 498 | 497 |
| 499 Fragment AllocateContext(intptr_t size); | 498 Fragment AllocateContext(intptr_t size); |
| 500 Fragment AllocateObject(TokenPosition position, | 499 Fragment AllocateObject(TokenPosition position, |
| 501 const dart::Class& klass, | 500 const Class& klass, |
| 502 intptr_t argument_count); | 501 intptr_t argument_count); |
| 503 Fragment AllocateObject(const dart::Class& klass, | 502 Fragment AllocateObject(const Class& klass, const Function& closure_function); |
| 504 const Function& closure_function); | |
| 505 Fragment BooleanNegate(); | 503 Fragment BooleanNegate(); |
| 506 Fragment StrictCompare(Token::Kind kind, bool number_check = false); | 504 Fragment StrictCompare(Token::Kind kind, bool number_check = false); |
| 507 Fragment BranchIfTrue(TargetEntryInstr** then_entry, | 505 Fragment BranchIfTrue(TargetEntryInstr** then_entry, |
| 508 TargetEntryInstr** otherwise_entry, | 506 TargetEntryInstr** otherwise_entry, |
| 509 bool negate = false); | 507 bool negate = false); |
| 510 Fragment BranchIfNull(TargetEntryInstr** then_entry, | 508 Fragment BranchIfNull(TargetEntryInstr** then_entry, |
| 511 TargetEntryInstr** otherwise_entry, | 509 TargetEntryInstr** otherwise_entry, |
| 512 bool negate = false); | 510 bool negate = false); |
| 513 Fragment BranchIfEqual(TargetEntryInstr** then_entry, | 511 Fragment BranchIfEqual(TargetEntryInstr** then_entry, |
| 514 TargetEntryInstr** otherwise_entry, | 512 TargetEntryInstr** otherwise_entry, |
| 515 bool negate = false); | 513 bool negate = false); |
| 516 Fragment BranchIfStrictEqual(TargetEntryInstr** then_entry, | 514 Fragment BranchIfStrictEqual(TargetEntryInstr** then_entry, |
| 517 TargetEntryInstr** otherwise_entry); | 515 TargetEntryInstr** otherwise_entry); |
| 518 Fragment CatchBlockEntry(const Array& handler_types, | 516 Fragment CatchBlockEntry(const Array& handler_types, |
| 519 intptr_t handler_index, | 517 intptr_t handler_index, |
| 520 bool needs_stacktrace); | 518 bool needs_stacktrace); |
| 521 Fragment TryCatch(int try_handler_index); | 519 Fragment TryCatch(int try_handler_index); |
| 522 Fragment CheckStackOverflowInPrologue(); | 520 Fragment CheckStackOverflowInPrologue(); |
| 523 Fragment CheckStackOverflow(); | 521 Fragment CheckStackOverflow(); |
| 524 Fragment CloneContext(); | 522 Fragment CloneContext(); |
| 525 Fragment Constant(const Object& value); | 523 Fragment Constant(const Object& value); |
| 526 Fragment CreateArray(); | 524 Fragment CreateArray(); |
| 527 Fragment Goto(JoinEntryInstr* destination); | 525 Fragment Goto(JoinEntryInstr* destination); |
| 528 Fragment IntConstant(int64_t value); | 526 Fragment IntConstant(int64_t value); |
| 529 Fragment InstanceCall(TokenPosition position, | 527 Fragment InstanceCall(TokenPosition position, |
| 530 const dart::String& name, | 528 const String& name, |
| 531 Token::Kind kind, | 529 Token::Kind kind, |
| 532 intptr_t argument_count, | 530 intptr_t argument_count, |
| 533 intptr_t checked_argument_count = 1); | 531 intptr_t checked_argument_count = 1); |
| 534 Fragment InstanceCall(TokenPosition position, | 532 Fragment InstanceCall(TokenPosition position, |
| 535 const dart::String& name, | 533 const String& name, |
| 536 Token::Kind kind, | 534 Token::Kind kind, |
| 537 intptr_t type_args_len, | 535 intptr_t type_args_len, |
| 538 intptr_t argument_count, | 536 intptr_t argument_count, |
| 539 const Array& argument_names, | 537 const Array& argument_names, |
| 540 intptr_t checked_argument_count = 1); | 538 intptr_t checked_argument_count = 1); |
| 541 Fragment ClosureCall(intptr_t type_args_len, | 539 Fragment ClosureCall(intptr_t type_args_len, |
| 542 intptr_t argument_count, | 540 intptr_t argument_count, |
| 543 const Array& argument_names); | 541 const Array& argument_names); |
| 544 Fragment ThrowException(TokenPosition position); | 542 Fragment ThrowException(TokenPosition position); |
| 545 Fragment RethrowException(TokenPosition position, int catch_try_index); | 543 Fragment RethrowException(TokenPosition position, int catch_try_index); |
| 546 Fragment LoadClassId(); | 544 Fragment LoadClassId(); |
| 547 Fragment LoadField(const dart::Field& field); | 545 Fragment LoadField(const Field& field); |
| 548 Fragment LoadField(intptr_t offset, intptr_t class_id = kDynamicCid); | 546 Fragment LoadField(intptr_t offset, intptr_t class_id = kDynamicCid); |
| 549 Fragment LoadNativeField(MethodRecognizer::Kind kind, | 547 Fragment LoadNativeField(MethodRecognizer::Kind kind, |
| 550 intptr_t offset, | 548 intptr_t offset, |
| 551 const Type& type, | 549 const Type& type, |
| 552 intptr_t class_id, | 550 intptr_t class_id, |
| 553 bool is_immutable = false); | 551 bool is_immutable = false); |
| 554 Fragment LoadLocal(LocalVariable* variable); | 552 Fragment LoadLocal(LocalVariable* variable); |
| 555 Fragment InitStaticField(const dart::Field& field); | 553 Fragment InitStaticField(const Field& field); |
| 556 Fragment LoadStaticField(); | 554 Fragment LoadStaticField(); |
| 557 Fragment NullConstant(); | 555 Fragment NullConstant(); |
| 558 Fragment NativeCall(const dart::String* name, const Function* function); | 556 Fragment NativeCall(const String* name, const Function* function); |
| 559 Fragment PushArgument(); | 557 Fragment PushArgument(); |
| 560 Fragment Return(TokenPosition position); | 558 Fragment Return(TokenPosition position); |
| 561 Fragment StaticCall(TokenPosition position, | 559 Fragment StaticCall(TokenPosition position, |
| 562 const Function& target, | 560 const Function& target, |
| 563 intptr_t argument_count); | 561 intptr_t argument_count); |
| 564 Fragment StaticCall(TokenPosition position, | 562 Fragment StaticCall(TokenPosition position, |
| 565 const Function& target, | 563 const Function& target, |
| 566 intptr_t argument_count, | 564 intptr_t argument_count, |
| 567 const Array& argument_names, | 565 const Array& argument_names, |
| 568 intptr_t type_args_len = 0); | 566 intptr_t type_args_len = 0); |
| 569 Fragment StoreIndexed(intptr_t class_id); | 567 Fragment StoreIndexed(intptr_t class_id); |
| 570 Fragment StoreInstanceFieldGuarded(const dart::Field& field, | 568 Fragment StoreInstanceFieldGuarded(const Field& field, |
| 571 bool is_initialization_store); | 569 bool is_initialization_store); |
| 572 Fragment StoreInstanceField( | 570 Fragment StoreInstanceField( |
| 573 const dart::Field& field, | 571 const Field& field, |
| 574 bool is_initialization_store, | 572 bool is_initialization_store, |
| 575 StoreBarrierType emit_store_barrier = kEmitStoreBarrier); | 573 StoreBarrierType emit_store_barrier = kEmitStoreBarrier); |
| 576 Fragment StoreInstanceField( | 574 Fragment StoreInstanceField( |
| 577 TokenPosition position, | 575 TokenPosition position, |
| 578 intptr_t offset, | 576 intptr_t offset, |
| 579 StoreBarrierType emit_store_barrier = kEmitStoreBarrier); | 577 StoreBarrierType emit_store_barrier = kEmitStoreBarrier); |
| 580 Fragment StoreLocal(TokenPosition position, LocalVariable* variable); | 578 Fragment StoreLocal(TokenPosition position, LocalVariable* variable); |
| 581 Fragment StoreStaticField(TokenPosition position, const dart::Field& field); | 579 Fragment StoreStaticField(TokenPosition position, const Field& field); |
| 582 Fragment StringInterpolate(TokenPosition position); | 580 Fragment StringInterpolate(TokenPosition position); |
| 583 Fragment StringInterpolateSingle(TokenPosition position); | 581 Fragment StringInterpolateSingle(TokenPosition position); |
| 584 Fragment ThrowTypeError(); | 582 Fragment ThrowTypeError(); |
| 585 Fragment ThrowNoSuchMethodError(); | 583 Fragment ThrowNoSuchMethodError(); |
| 586 Fragment BuildImplicitClosureCreation(const Function& target); | 584 Fragment BuildImplicitClosureCreation(const Function& target); |
| 587 Fragment GuardFieldLength(const dart::Field& field, intptr_t deopt_id); | 585 Fragment GuardFieldLength(const Field& field, intptr_t deopt_id); |
| 588 Fragment GuardFieldClass(const dart::Field& field, intptr_t deopt_id); | 586 Fragment GuardFieldClass(const Field& field, intptr_t deopt_id); |
| 589 | 587 |
| 590 Fragment EvaluateAssertion(); | 588 Fragment EvaluateAssertion(); |
| 591 Fragment CheckReturnTypeInCheckedMode(); | 589 Fragment CheckReturnTypeInCheckedMode(); |
| 592 Fragment CheckVariableTypeInCheckedMode(const AbstractType& dst_type, | 590 Fragment CheckVariableTypeInCheckedMode(const AbstractType& dst_type, |
| 593 const dart::String& name_symbol); | 591 const String& name_symbol); |
| 594 Fragment CheckBooleanInCheckedMode(); | 592 Fragment CheckBooleanInCheckedMode(); |
| 595 Fragment CheckAssignableInCheckedMode(const dart::AbstractType& dst_type, | 593 Fragment CheckAssignableInCheckedMode(const AbstractType& dst_type, |
| 596 const dart::String& dst_name); | 594 const String& dst_name); |
| 597 | 595 |
| 598 Fragment AssertBool(); | 596 Fragment AssertBool(); |
| 599 Fragment AssertAssignable(const dart::AbstractType& dst_type, | 597 Fragment AssertAssignable(const AbstractType& dst_type, |
| 600 const dart::String& dst_name); | 598 const String& dst_name); |
| 601 | 599 |
| 602 bool NeedsDebugStepCheck(const Function& function, TokenPosition position); | 600 bool NeedsDebugStepCheck(const Function& function, TokenPosition position); |
| 603 bool NeedsDebugStepCheck(Value* value, TokenPosition position); | 601 bool NeedsDebugStepCheck(Value* value, TokenPosition position); |
| 604 Fragment DebugStepCheck(TokenPosition position); | 602 Fragment DebugStepCheck(TokenPosition position); |
| 605 | 603 |
| 606 dart::RawFunction* LookupMethodByMember(NameIndex target, | 604 RawFunction* LookupMethodByMember(NameIndex target, |
| 607 const dart::String& method_name); | 605 const String& method_name); |
| 608 | 606 |
| 609 LocalVariable* MakeTemporary(); | 607 LocalVariable* MakeTemporary(); |
| 610 LocalVariable* MakeNonTemporary(const dart::String& symbol); | 608 LocalVariable* MakeNonTemporary(const String& symbol); |
| 611 | 609 |
| 612 intptr_t CurrentTryIndex(); | 610 intptr_t CurrentTryIndex(); |
| 613 intptr_t AllocateTryIndex() { return next_used_try_index_++; } | 611 intptr_t AllocateTryIndex() { return next_used_try_index_++; } |
| 614 | 612 |
| 615 dart::LocalVariable* LookupVariable(intptr_t kernel_offset); | 613 LocalVariable* LookupVariable(intptr_t kernel_offset); |
| 616 | 614 |
| 617 void SetTempIndex(Definition* definition); | 615 void SetTempIndex(Definition* definition); |
| 618 | 616 |
| 619 void Push(Definition* definition); | 617 void Push(Definition* definition); |
| 620 Value* Pop(); | 618 Value* Pop(); |
| 621 Fragment Drop(); | 619 Fragment Drop(); |
| 622 | 620 |
| 623 bool IsInlining() { return exit_collector_ != NULL; } | 621 bool IsInlining() { return exit_collector_ != NULL; } |
| 624 | 622 |
| 625 Token::Kind MethodKind(const dart::String& name); | 623 Token::Kind MethodKind(const String& name); |
| 626 | 624 |
| 627 void InlineBailout(const char* reason); | 625 void InlineBailout(const char* reason); |
| 628 | 626 |
| 629 TranslationHelper translation_helper_; | 627 TranslationHelper translation_helper_; |
| 630 Thread* thread_; | 628 Thread* thread_; |
| 631 Zone* zone_; | 629 Zone* zone_; |
| 632 | 630 |
| 633 intptr_t kernel_offset_; | 631 intptr_t kernel_offset_; |
| 634 | 632 |
| 635 ParsedFunction* parsed_function_; | 633 ParsedFunction* parsed_function_; |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 intptr_t catch_try_index() { return catch_try_index_; } | 917 intptr_t catch_try_index() { return catch_try_index_; } |
| 920 | 918 |
| 921 private: | 919 private: |
| 922 FlowGraphBuilder* builder_; | 920 FlowGraphBuilder* builder_; |
| 923 CatchBlock* outer_; | 921 CatchBlock* outer_; |
| 924 LocalVariable* exception_var_; | 922 LocalVariable* exception_var_; |
| 925 LocalVariable* stack_trace_var_; | 923 LocalVariable* stack_trace_var_; |
| 926 intptr_t catch_try_index_; | 924 intptr_t catch_try_index_; |
| 927 }; | 925 }; |
| 928 | 926 |
| 929 RawObject* EvaluateMetadata(const dart::Field& metadata_field); | 927 RawObject* EvaluateMetadata(const Field& metadata_field); |
| 930 RawObject* BuildParameterDescriptor(const Function& function); | 928 RawObject* BuildParameterDescriptor(const Function& function); |
| 931 void CollectTokenPositionsFor(const Script& script); | 929 void CollectTokenPositionsFor(const Script& script); |
| 932 | 930 |
| 933 } // namespace kernel | 931 } // namespace kernel |
| 934 } // namespace dart | 932 } // namespace dart |
| 935 | 933 |
| 936 #else // !defined(DART_PRECOMPILED_RUNTIME) | 934 #else // !defined(DART_PRECOMPILED_RUNTIME) |
| 937 | 935 |
| 938 #include "vm/kernel.h" | 936 #include "vm/kernel.h" |
| 939 #include "vm/object.h" | 937 #include "vm/object.h" |
| 940 | 938 |
| 941 namespace dart { | 939 namespace dart { |
| 942 namespace kernel { | 940 namespace kernel { |
| 943 | 941 |
| 944 RawObject* EvaluateMetadata(const dart::Field& metadata_field); | 942 RawObject* EvaluateMetadata(const Field& metadata_field); |
| 945 RawObject* BuildParameterDescriptor(const Function& function); | 943 RawObject* BuildParameterDescriptor(const Function& function); |
| 946 | 944 |
| 947 } // namespace kernel | 945 } // namespace kernel |
| 948 } // namespace dart | 946 } // namespace dart |
| 949 | 947 |
| 950 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 948 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| 951 #endif // RUNTIME_VM_KERNEL_TO_IL_H_ | 949 #endif // RUNTIME_VM_KERNEL_TO_IL_H_ |
| OLD | NEW |