Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

HOT RELOAD: Initial reload notes #26127

Closed
11 tasks done
johnmccutchan opened this issue Mar 29, 2016 · 20 comments
Closed
11 tasks done

HOT RELOAD: Initial reload notes #26127

johnmccutchan opened this issue Mar 29, 2016 · 20 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. vm-hot-reload

Comments

@johnmccutchan
Copy link
Contributor

@turnidge

  • migrate static fields & values.
  • detect new classes
  • detect new libs
  • handle class hierarchy changes
  • finish migrating remaining class/lib/function metadata
  • unit tests
  • send service event on success or failure
  • timestamps added to script ids
  • detect multiple conflicting reload requests and return an error (if isreloading ...)
  • Implement Class::CanReload
  • allow static fields to be reinitialized from observatory
@sgjesse sgjesse added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Mar 30, 2016
@johnmccutchan johnmccutchan self-assigned this Mar 30, 2016
@johnmccutchan
Copy link
Contributor Author

New dump:

  • remove brain transplant style path (Class::Reload, etc).
  • walk the call stack and ensure all code has compiled unoptimized code before handling reload.
  • Keep a 'library code' dirty bit and use it when deciding whether to toss old code or not.
  • add timeline events for reloading
  • process loader messages when reloading with a live stack
  • test on dart2js -- and it fails!
  • preserve debuggable bit on libraries

@johnmccutchan
Copy link
Contributor Author

  • rework how ICData for instance calls is reset during reload.

@johnmccutchan
Copy link
Contributor Author

the dart2js source checked in has been modified with a call to 'reloadIsolate' from 'dart:developer'.

Some notes about running dart2js:

in dart/
$ ln -s sdk/lib lib

in dart/sdk/pkg/compiler
$ gdb --args ../../out/DebugX64/dart --optimization-counter-threshold=-1 --enable-vm-service bin/dart2js.dart --categories=all bin/dart2js.dart

@johnmccutchan
Copy link
Contributor Author

  • merged in all changes to master

@johnmccutchan
Copy link
Contributor Author

johnmccutchan commented Apr 6, 2016

LATEST TODO dump:

Core:

  • direct subclasses in preserved classes are wrong
  • double check all Class reference replacements are correct (we may need to preserve the old class reference).

Bugs:

  • investigate OSR crashes
  • investigate field guard crashes
  • investigate dart2js parse errors (see below).

Observatory:

  • allow static fields to be reinitialized from observatory

@johnmccutchan
Copy link
Contributor Author

  • update enum classes so that enum identity is preserved across reloads.
  • copy canonical constants from the old class onto the new class.

@johnmccutchan
Copy link
Contributor Author

  • prohibit reloads from happening if we are evaluating a static initializer or constant expression.

@johnmccutchan
Copy link
Contributor Author

  • Fix heap corruption. Was caused by 'become' and 'invalidate world' did not stop the background marker / sweeper properly.
  • Really fix enum identity across reloads.

@johnmccutchan
Copy link
Contributor Author

johnmccutchan commented Apr 14, 2016

Programs that run to completion while aggressively being reloaded:

  • box2d
  • tracer
  • richards
  • deltablue
  • cryptobigintencrypt
  • RSA
  • Havlak

TODO:

  • dart2js
  • analyzer
  • a Flutter app

@turnidge
Copy link
Contributor

turnidge commented Apr 21, 2016

Dart2JS crashes due to internal error with the following command line args:

time ../../xcodebuild/ReleaseX64/dart --no-profiler --reload-every=1000000 --reload-every-optimized=false --identity-reload --optimization-counter-threshold=-1 --trace-reload --enable-vm-service --no-use-field-guards bin/dart2js.dart --categories=all bin/dart2js.dart

../../lib/async/future.dart:754:1:
Internal Error: The compiler crashed when compiling this element.
Object _nonNullError(Object error) =>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The compiler is broken.

When compiling the above element, the compiler crashed. It is not
possible to tell if this is caused by a problem in your program or
not. Regardless, the compiler should not crash.

The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.

Please include the following information:

  • the name and version of your operating system,
  • the Dart SDK build number (build number could not be determined), and
  • the entire message you see here (including the full stack trace
    below as well as the source location above).
The compiler crashed: Bad state: no elements
#0      Link.head (package:compiler/src/util/link.dart:8:17)
#1      OrderedTypeSet.forEach (package:compiler/src/ordered_typeset.dart:105:19)
#2      Types.computeLeastUpperBoundInterfaces.getSupertypesAtDepth (package:compiler/src/dart_types.dart:1521:13)
#3      Types.computeLeastUpperBoundInterfaces (package:compiler/src/dart_types.dart:1531:52)
#4      Types.computeLeastUpperBound (package:compiler/src/dart_types.dart:1659:14)
#5      TypeCheckerVisitor.visitConditional (package:compiler/src/typechecker.dart:1800:18)
#6      Conditional.accept (package:compiler/src/tree/nodes.dart:720:38)
#7      TypeCheckerVisitor.analyze (package:compiler/src/typechecker.dart:448:28)
#8      TypeCheckerVisitor.visitReturn (package:compiler/src/typechecker.dart:1680:33)
#9      Return.accept (package:compiler/src/tree/nodes.dart:1182:38)
#10     TypeCheckerVisitor.analyze (package:compiler/src/typechecker.dart:448:28)
#11     TypeCheckerVisitor.visitFunctionExpression (package:compiler/src/typechecker.dart:676:5)
#12     FunctionExpression.accept (package:compiler/src/tree/nodes.dart:846:38)
#13     TypeCheckerTask.check.<anonymous closure>.<anonymous closure> (package:compiler/src/typechecker.dart:71:26)
#14     CompilerTask.measure (package:compiler/src/common/tasks.dart:55:37)
#15     TypeCheckerTask.check.<anonymous closure> (package:compiler/src/typechecker.dart:65:7)
#16     _CompilerDiagnosticReporter.withCurrentElement (package:compiler/src/compiler.dart:1644:15)
#17     TypeCheckerTask.check (package:compiler/src/typechecker.dart:64:14)
#18     _CompilerResolution.computeWorldImpact.<anonymous closure> (package:compiler/src/compiler.dart:2046:26)
#19     _HashVMBase&MapMixin&&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:259)
#20     _CompilerResolution.computeWorldImpact (package:compiler/src/compiler.dart:2028:30)
#21     Compiler.analyzeElement (package:compiler/src/compiler.dart:1107:23)
#22     Compiler.analyze (package:compiler/src/compiler.dart:1129:31)
#23     ResolutionWorkItem.run (package:compiler/src/common/resolution.dart:55:35)
#24     Compiler.emptyQueue.<anonymous closure>.<anonymous closure> (package:compiler/src/compiler.dart:1020:46)
#25     _CompilerDiagnosticReporter.withCurrentElement (package:compiler/src/compiler.dart:1644:15)
#26     Compiler.emptyQueue.<anonymous closure> (package:compiler/src/compiler.dart:1019:14)
#27     QueueFilter.processWorkItem (package:compiler/src/enqueue.dart:1008:6)
#28     Enqueuer.forEach (package:compiler/src/enqueue.dart:704:16)
#29     Compiler.emptyQueue (package:compiler/src/compiler.dart:1018:11)
#30     Compiler.processQueue (package:compiler/src/compiler.dart:1046:5)
#31     Compiler.compileLoadedLibraries (package:compiler/src/compiler.dart:914:5)
#32     Compiler.runInternal.<anonymous closure> (package:compiler/src/compiler.dart:784:7)
#33     _RootZone.runUnary (dart:async/zone.dart:1137)
#34     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:553)
#35     _Future._propagateToListeners (dart:async/future_impl.dart:639)
#36     _Future._completeWithValue (dart:async/future_impl.dart:426)
#37     _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:481)
#38     _microtaskLoop (dart:async/schedule_microtask.dart:41)
#39     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#40     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#41     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)

real 3m8.411s
user 3m12.179s
sys 0m16.355s

My guess is that the const Link() below is not getting correctly canonicalized after a reload...

void forEach(int level, void f(DartType type)) {
if (level < levels) {
Link pointer = _levels[level];
Link end =
level > 0 ? _levels[level - 1] : const Link();
while (!identical(pointer, end)) {
f(pointer.head);
pointer = pointer.tail;
}
}
}

@johnmccutchan
Copy link
Contributor Author

johnmccutchan commented May 2, 2016

new issue dump:

  • field guard crashes in box2d and dart2js
  • ICData no sentinel
  • direct sub classes (RawClass -> cid?)
  • cannot rebind messages
  • Siva's comments on Todd's CL

@turnidge
Copy link
Contributor

turnidge commented May 3, 2016

Example of a recent crash:

lldb -- ~/ws/dart/sdk/xcodebuild/ReleaseX64/dart --no-profiler --reload-every=1000000 --reload-every-optimized=false --identity-reload --no-trace-reload --enable-vm-service --no-use-field-guards --no-use-osr bin/dart2js.dart --categories=all bin/dart2js.dart

bin/packages/compiler/src/ssa/builder.dart:104:3:
Internal Error: The compiler crashed when compiling this element.
  HGraph build(CodegenWorkItem work) {
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The compiler is broken.

When compiling the above element, the compiler crashed. It is not
possible to tell if this is caused by a problem in your program or
not. Regardless, the compiler should not crash.

The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.

Please include the following information:

* the name and version of your operating system,

* the Dart SDK build number (build number could not be determined), and

* the entire message you see here (including the full stack trace
  below as well as the source location above).

The compiler crashed: Class 'String' has no instance method 'invalidFunctionReturnTypes'.

NoSuchMethodError: method not found: 'invalidFunctionReturnTypes'
Receiver: "dart:core-patch/array_patch.dart"
Arguments: [Instance of 'DynamicType', Instance of 'DynamicType']
#0      Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1      Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2      AbstractTypeRelation.visitFunctionType (package:compiler/src/dart_types.dart:984:9)
#3      FunctionType.accept (package:compiler/src/dart_types.dart:672:20)
#4      MoreSpecificVisitor.isMoreSpecific (package:compiler/src/dart_types.dart:1125:14)
#5      SubtypeVisitor.isSubtype (package:compiler/src/dart_types.dart:1153:32)
#6      Types.isSubtype (package:compiler/src/dart_types.dart:1280:27)
#7      InterfaceMembersCreator.computeInterfaceMembers.<anonymous closure> (package:compiler/src/resolution/class_members.dart:701:18)
#8      _HashVMBase&MapMixin&&_LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:345)
#9      InterfaceMembersCreator.computeInterfaceMembers (package:compiler/src/resolution/class_members.dart:674:10)
#10     InterfaceMembersCreator.computeMembers (package:compiler/src/resolution/class_members.dart:579:5)
#11     MembersCreator.computeAllMembers (package:compiler/src/resolution/class_members.dart:75:5)
#12     ElementX&AstElementMixin&AnalyzableElementX&ClassElementCommon&TypeDeclarationElementX&PatchMixin&ClassMemberMixin.computeAllClassMembers (package:compiler/src/resolution/class_members.dart:892:13)
#13     MembersCreator.computeAllClassMembers (package:compiler/src/resolution/class_members.dart:533:9)
#14     MembersCreator.computeSuperClassMembers (package:compiler/src/resolution/class_members.dart:126:7)
#15     InterfaceMembersCreator.computeSuperMembers (package:compiler/src/resolution/class_members.dart:591:5)
#16     InterfaceMembersCreator.computeMembers (package:compiler/src/resolution/class_members.dart:577:9)
#17     MembersCreator.computeAllMembers (package:compiler/src/resolution/class_members.dart:75:5)
#18     ElementX&AstElementMixin&AnalyzableElementX&ClassElementCommon&TypeDeclarationElementX&PatchMixin&ClassMemberMixin.computeAllClassMembers (package:compiler/src/resolution/class_members.dart:892:13)
#19     MembersCreator.computeAllClassMembers (package:compiler/src/resolution/class_members.dart:533:9)
#20     ResolverTask.computeClassMembers (package:compiler/src/resolution/resolution.dart:663:20)
#21     ResolverTask.checkClass (package:compiler/src/resolution/resolution.dart:671:5)
#22     Enqueuer.processInstantiatedClass.<anonymous closure>.processClass (package:compiler/src/enqueue.dart:313:29)
#23     Enqueuer.processInstantiatedClass.<anonymous closure> (package:compiler/src/enqueue.dart:324:21)
#24     CompilerTask.measure (package:compiler/src/common/tasks.dart:52:37)
#25     Enqueuer.processInstantiatedClass (package:compiler/src/enqueue.dart:290:10)
#26     Enqueuer.registerInstantiatedType.<anonymous closure> (package:compiler/src/enqueue.dart:171:9)
#27     CompilerTask.measure (package:compiler/src/common/tasks.dart:52:37)
#28     Enqueuer.registerInstantiatedType (package:compiler/src/enqueue.dart:159:10)
#29     Enqueuer.registerTypeUse (package:compiler/src/enqueue.dart:627:9)
#30     _EnqueuerImpactVisitor.visitTypeUse (package:compiler/src/enqueue.dart:1041:14)
#31     Setlet.forEach (package:compiler/src/util/setlet.dart:229:15)
#32     TransformedWorldImpact.apply (package:compiler/src/universe/world_impact.dart:150:14)
#33     JavaScriptImpactStrategy.visitImpact (package:compiler/src/js_backend/backend.dart:2995:16)
#34     Enqueuer.applyImpact (package:compiler/src/enqueue.dart:155:10)
#35     Compiler.emptyQueue.<anonymous closure>.<anonymous closure> (package:compiler/src/compiler.dart:931:15)
#36     _CompilerDiagnosticReporter.withCurrentElement (package:compiler/src/compiler.dart:1498:15)
#37     Compiler.emptyQueue.<anonymous closure> (package:compiler/src/compiler.dart:930:16)
#38     QueueFilter.processWorkItem (package:compiler/src/enqueue.dart:980:6)
#39     Enqueuer.forEach (package:compiler/src/enqueue.dart:673:16)
#40     Compiler.emptyQueue (package:compiler/src/compiler.dart:929:11)
#41     Compiler.processQueue (package:compiler/src/compiler.dart:957:5)
#42     Compiler.compileLoadedLibraries (package:compiler/src/compiler.dart:826:5)
#43     Compiler.runInternal.<anonymous closure> (package:compiler/src/compiler.dart:700:7)
#44     _RootZone.runUnary (dart:async/zone.dart:1137)
#45     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:553)
#46     _Future._propagateToListeners (dart:async/future_impl.dart:639)
#47     _Future._completeWithValue (dart:async/future_impl.dart:426)
#48     _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:481)
#49     _microtaskLoop (dart:async/schedule_microtask.dart:41)
#50     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#51     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#52     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)

@turnidge
Copy link
Contributor

turnidge commented May 6, 2016

Here's the kind of crash I'm seeing today...

It looks like we might be throwing out cached constants fro library_loader.dart?

...
Compiling optimized function (background): 'package:compiler/src/library_loader.dart__LibraryLoaderTask@739074547_processLibraryTags_<anonymous closure>_<anonymous closure>' @ token 2238, size 631
/Users/turnidge/ws/dart/sdk/runtime/vm/object.cc:1813: error: expected: thread->IsMutatorThread() || (space != Heap::kNew)
Process 17917 stopped
* thread #2: tid = 0x382a13, 0x00007fff8b556f06 libsystem_kernel.dylib`__pthread_kill + 10, stop reason = signal SIGABRT
    frame #0: 0x00007fff8b556f06 libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill:
->  0x7fff8b556f06 <+10>: jae    0x7fff8b556f10            ; <+20>
    0x7fff8b556f08 <+12>: movq   %rax, %rdi
    0x7fff8b556f0b <+15>: jmp    0x7fff8b5517cd            ; cerror_nocancel
    0x7fff8b556f10 <+20>: retq   
(lldb) bt
* thread #2: tid = 0x382a13, 0x00007fff8b556f06 libsystem_kernel.dylib`__pthread_kill + 10, stop reason = signal SIGABRT
  * frame #0: 0x00007fff8b556f06 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff901a44ec libsystem_pthread.dylib`pthread_kill + 90
    frame #2: 0x00007fff922146e7 libsystem_c.dylib`abort + 129
    frame #3: 0x00000001003f6cc9 dart`dart::OS::Abort() + 9 at os_macos.cc:388
    frame #4: 0x000000010005deb7 dart`dart::DynamicAssertionHelper::Fail(this=<unavailable>, format="expected: %s") + 791 at assert.cc:42
    frame #5: 0x00000001003380ca dart`dart::Object::Allocate(cls_id=64, size=48, space=kNew) + 250 at object.cc:1813
    frame #6: 0x00000001003b27ac dart`dart::Array::New(class_id=64, len=2, space=kNew) + 172 at object.cc:21461
    frame #7: 0x000000010033973d dart`dart::Array::New(len=2, space=kNew) + 189 at object.cc:21450
    frame #8: 0x0000000100454e20 dart`dart::ConstMapKeyEqualsTraits::NewKey(key=0x0000700000406a88) + 32 at parser.h:88
    frame #9: 0x000000010044d5e3 dart`dart::RawObject* dart::HashMap<dart::UnorderedHashTable<dart::ConstMapKeyEqualsTraits, 1l> >::InsertNewOrGetValue<dart::ConstantPosKey>(this=0x0000700000406a68, key=0x0000700000406a88, value_if_absent=0x0000000102801a20) const + 179 at hash_table.h:645
    frame #10: 0x0000000100444db9 dart`dart::Parser::InsertCachedConstantValue(url=<unavailable>, token_pos=<unavailable>, value=0x0000000102801a20) + 345 at parser.cc:11971
    frame #11: 0x0000000100416f55 dart`dart::Parser::CacheConstantValue(this=0x0000700000407330, token_pos=(value_ = 4908), value=0x0000000102801a20) + 181 at parser.cc:11984
    frame #12: 0x000000010040d01b dart`dart::Parser::ParseExpr(this=0x0000700000407330, require_compiletime_const=<unavailable>, consume_cascades=true) + 1515 at parser.cc:10910
    frame #13: 0x0000000100434ba9 dart`dart::Parser::ParseCaseClause(this=0x0000700000407330, switch_expr_value=0x00000001058ec698, case_expr_values=0x0000700000406d10, case_label=0x0000000000000000) + 473 at parser.cc:8252
    frame #14: 0x00000001004356e7 dart`dart::Parser::ParseSwitchStatement(this=0x0000700000407330, label_name=<unavailable>) + 1511 at parser.cc:8383
    frame #15: 0x0000000100432ec7 dart`dart::Parser::ParseStatement(this=0x0000700000407330) + 567 at parser.cc:10013
    frame #16: 0x000000010041a2d2 dart`dart::Parser::ParseStatementSequence(this=0x0000700000407330) + 162 at parser.cc:8088
    frame #17: 0x0000000100433b10 dart`dart::Parser::ParseNestedStatement(this=0x0000700000407330, parsing_loop_body=<unavailable>, label=<unavailable>) + 208 at parser.cc:8122
    frame #18: 0x0000000100433da0 dart`dart::Parser::ParseIfStatement(this=0x0000700000407330, label_name=<unavailable>) + 352 at parser.cc:8151
    frame #19: 0x0000000100433138 dart`dart::Parser::ParseStatement(this=0x0000700000407330) + 1192 at parser.cc:10049
    frame #20: 0x000000010041a2d2 dart`dart::Parser::ParseStatementSequence(this=0x0000700000407330) + 162 at parser.cc:8088
    frame #21: 0x000000010040516d dart`dart::Parser::ParseFunc(this=0x0000700000407330, func=0x000000010582f560, check_semicolon=false) + 4045 at parser.cc:3385
    frame #22: 0x0000000100402ab1 dart`dart::Parser::ParseFunction(parsed_function=0x00000001058ebb88) + 1633 at parser.cc:1029
    frame #23: 0x00000001002559a2 dart`dart::CallSiteInliner::GetParsedFunction(this=0x0000700000407c20, function=0x000000010582f560, in_cache=0x000070000040786f) + 146 at flow_graph_inliner.cc:1134
    frame #24: 0x0000000100253c8b dart`dart::CallSiteInliner::TryInlining(this=0x0000700000407c20, function=0x000000010582f560, argument_names=0x0000000102c2ee20, call_data=0x00007000004079d8) + 3707 at flow_graph_inliner.cc:726
    frame #25: 0x0000000100259879 dart`dart::CallSiteInliner::InlineInstanceCalls(this=0x0000700000407c20) + 1785 at flow_graph_inliner.cc:1255
    frame #26: 0x0000000100255624 dart`dart::CallSiteInliner::InlineCalls(this=0x0000700000407c20) + 388 at flow_graph_inliner.cc:584
    frame #27: 0x000000010024ea06 dart`dart::FlowGraphInliner::Inline(this=0x0000700000407ec8) + 294 at flow_graph_inliner.cc:1973
    frame #28: 0x00000001001bc118 dart`dart::CompileParsedFunctionHelper::Compile(this=0x0000700000408888, pipeline=0x00007000004094f8) + 5288 at compiler.cc:855
    frame #29: 0x00000001001bdef5 dart`dart::CompileFunctionHelper(pipeline=0x00007000004094f8, function=0x00007000004098f0, optimized=true, osr_id=-1) + 1973 at compiler.cc:1287
    frame #30: 0x00000001001befc7 dart`dart::Compiler::CompileOptimizedFunction(thread=<unavailable>, function=0x00007000004098f0, osr_id=-1) + 471 at compiler.cc:1466
    frame #31: 0x00000001001c0933 dart`dart::BackgroundCompiler::Run(this=0x0000000107400090) + 643 at compiler.cc:1859
    frame #32: 0x00000001005308fb dart`dart::ThreadPool::Worker::Loop(this=0x0000000104300250) + 139 at thread_pool.cc:388
    frame #33: 0x000000010053072b dart`dart::ThreadPool::Worker::Main(args=4365222480) + 443 at thread_pool.cc:446
    frame #34: 0x00000001003f7ca6 dart`dart::ThreadStart(data_ptr=<unavailable>) + 70 at os_thread_macos.cc:97
    frame #35: 0x00007fff901a199d libsystem_pthread.dylib`_pthread_body + 131
    frame #36: 0x00007fff901a191a libsystem_pthread.dylib`_pthread_start + 168
    frame #37: 0x00007fff9019f351 libsystem_pthread.dylib`thread_start + 13
(lldb) 

@johnmccutchan
Copy link
Contributor Author

johnmccutchan commented May 11, 2016

ICData:

  • Either prohibit the optimizing compiler while reloading or clear ICs early. Alternatively, stop executing Dart code as part of the load.
  • Adjust ICData so it knows whether it's for a static call or not.
  • Use the Code's object pool to find ICData instead of the functions map.

Enums:

  • Move the name into the instance and off of the class.
  • When an enum is removed, don't persist it in the values array.

Loading:

  • Rework how the standalone embedder does script loading so it doesn't invoke Dart code.

Isolate Reload Context:

  • Remove redundant mappings.

Canonicalization:

  • Add a debug pass over the heap which verifies that all canonical objects canonicalize to themselves.

Move from RawClass to class id:

  • Complete replacement of RawClass with class id.
  • Remove 'become' operation.

@johnmccutchan
Copy link
Contributor Author

Related: #26514

@johnmccutchan
Copy link
Contributor Author

Flutter side: flutter/flutter#4113

@johnmccutchan
Copy link
Contributor Author

Lots of work lately:

  • We no longer execute Dart code during loading in the standalone embedder.
  • ICData knows whether or not it is for a static call.
  • We iterate over the code's object pool to find ICDatas to reset.

@johnmccutchan
Copy link
Contributor Author

Also, as a side effect of the above, on stack reloading is now functional in the standalone VM.

@johnmccutchan
Copy link
Contributor Author

A crash:

#0  0x00007fa846d10c37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007fa846d14028 in __GI_abort () at abort.c:89
#2  0x000000000084cc99 in dart::OS::Abort () at runtime/vm/os_linux.cc:424
#3  0x00000000005c041d in dart::DynamicAssertionHelper::Fail (this=this@entry=0x7fa845885e60, 
    format=format@entry=0xba1124 "expected: %s") at runtime/platform/assert.cc:47
#4  0x00000000005add15 in ValueFromRaw (raw_value=17578661999652631539) at runtime/vm/object.h:6261
#5  Value (raw_smi=0xf3f3f3f3f3f3f3f3) at runtime/vm/object.h:6229
#6  Length (this=0x7fa8381f8c00) at runtime/vm/object.h:7258
#7  dart::Array::ObjectAddr (this=0x7fa8381f8c00, index=0) at runtime/vm/object.h:7356
#8  0x000000000077c76e in At (index=0, this=<optimized out>) at runtime/vm/object.h:7269
#9  dart::HashTable<dart::ScriptUrlSetTraits, 0l, 0l>::GetSmiValueAt (this=this@entry=0x7fa845885f10, index=index@entry=0)
    at runtime/vm/hash_table.h:368
#10 0x0000000000773e7b in NumOccupied (this=0x7fa845885f10) at runtime/vm/hash_table.h:275
#11 EnsureLoadFactor<dart::HashSet<dart::UnorderedHashTable<dart::ScriptUrlSetTraits, 0l> > > (table=..., high=0.75, low=0)
    at runtime/vm/hash_table.h:474
#12 EnsureCapacity (this=0x7fa845885f10) at runtime/vm/hash_table.h:687
#13 Insert (key=..., this=0x7fa845885f10) at runtime/vm/hash_table.h:622
#14 dart::IsolateReloadContext::BuildCleanScriptSet (this=this@entry=0x7fa83826a940) at runtime/vm/isolate_reload.cc:501
#15 0x000000000077534f in dart::IsolateReloadContext::Checkpoint (this=this@entry=0x7fa83826a940) at runtime/vm/isolate_reload.cc:566
#16 0x0000000000775442 in dart::IsolateReloadContext::StartReload (this=this@entry=0x7fa83826a940) at runtime/vm/isolate_reload.cc:262
#17 0x00000000007644aa in dart::Isolate::ReloadSources (this=this@entry=0x174f250, test_mode=test_mode@entry=false)
    at runtime/vm/isolate.cc:1084
#18 0x00000000006283c2 in DRT_HelperStackOverflow (zone=<optimized out>, thread=0x1757620, isolate=0x174f250, arguments=...)
    at runtime/vm/code_generator.cc:1305
#19 dart::DRT_StackOverflow (arguments=...) at runtime/vm/code_generator.cc:1217
#20 0x00007fa847f54430 in ?? ()
#21 0x0000000001757620 in ?? ()
#22 0x0000000000000000 in ?? ()

@johnmccutchan johnmccutchan changed the title Reload notes HOT RELOAD: Initial reload notes Jul 8, 2016
@johnmccutchan
Copy link
Contributor Author

I've split off remaining issues. Closing this.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. vm-hot-reload
Projects
None yet
Development

No branches or pull requests

3 participants