Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@chinmaygarde
Copy link
Member

No description provided.

@chinmaygarde
Copy link
Member Author

Will land on red to unblock LUCI which is red on a goma flake.

@chinmaygarde
Copy link
Member Author

TBR

@chinmaygarde chinmaygarde merged commit 31c4727 into flutter:master Mar 22, 2020
@chinmaygarde chinmaygarde deleted the document_rc branch March 22, 2020 05:12
/// normal operation, a single instance of this object is owned by the engine
/// per shell. This object may only be created, used, and collected on the UI
/// task runner. Window state queried by the root isolate is stored by this
/// object. In cold-restart scenarios, the engine may collect this collect
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cold-restart is used in other places, but I think it's a bit incongruent with our more typical terminology at this point of hot reload/hot restart.

Also - collect this collect - just collect this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cold-restart is used in other places, but I think it's a bit incongruent with our more typical terminology at this point of hot reload/hot restart.

I didn't know we settled on that terminology already. When did we do that? I'll change all references to cold-restart in a subsequent patch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also - collect this collect - just collect this?

Patching.

Comment on lines +77 to +87
/// @param[in] advisory_script_uri The advisory script URI (only used
/// for debugging). This does not
/// affect the code being run in the
/// isolate in any way.
/// @param[in] advisory_script_entrypoint The advisory script entrypoint
/// (only used for debugging). This
/// does not affect the code being run
/// in the isolate in any way. The
/// isolate must be transitioned to
/// the running state explicitly by
/// the caller.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding at this point is that these don't actually do anything at all, and don't show up anywhere meaningfully for debuggers. Is that correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these still show up when you use the debugger from the observatory. It might be a good idea to just remove these from the engine and see what breaks really.

/// isolate to collect resources that
/// may reference resources on the
/// GPU.
/// @param[in] image_decoder The image decoder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be helpful to explain why this is here and not on the io_manager, or how it's different.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IO manager does more than just aid in image decode. I think the difference will become clearer once I document that.

/// code in isolate scope when the VM
/// is about to be notified that the
/// engine is going to be idle.
/// @param[in] window_data The window data (if exists).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's window data? :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe even just a link to the WindowData struct would do.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/// @brief Clone the the runtime controller. This re-creates the root
/// isolate with the same snapshots and copies all window data to
/// the new instance. This is usually only used in the debug
/// runtime mode to support the cold-restart scenario.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same nit about cold-restart.

Comment on lines +270 to +272
/// NotifyIdle is advisory and not making the same or making it with
/// insufficient deadlines does not mean that the VM will keep consuming
/// memory indefinitely. Even if the engine made absolutely no calls to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a little clearer if phrased without the double negative... something like

NotifyIdle is advisory. The VM may or may not run a garbage collection when this is called, and will eventually perform garbage collections even if it is not called or it is called with insufficient deadlines.

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patching.

/// The garbage collection mechanism and its thresholds are internal
/// implementation details and absolutely no guarantees are made about the
/// threshold discussed below. This discussion is also an oversimplification
/// but hopefully serves to calibrate expectations about GC behavior:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there Dart documentation we could link to here instead of all of this?

People who read this will probably think it's more precise than it is, and it seems likely that this could drift out of sync with actual implementation details it's trying to capture.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, would it make sense to move some of this to somewhere in //dart/runtime/vm where it could be maintained by the VM team? It is a really helpful description.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there Dart documentation we could link to here instead of all of this?

No. It's not documented anywhere. And probably for the same reasons we hesitate to document it here. It's implementation details and may change.

People who read this will probably think it's more precise than it is, and it seems likely that this could drift out of sync with actual implementation details it's trying to capture.

Fair point. But the caveats (stuff like "are implementation details and absolutely no guarantees ... oversimplification" ) I believe are sufficient for reasonable readers to not make assumptions of stability.

Dart_Port GetMainPort();

//----------------------------------------------------------------------------
/// @brief Gets the debug name of the root isolate. But default, the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This answers my question(s) above about advisory*

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe link to this from there?

Comment on lines +409 to +412
/// @brief Returns if the root isolate has any live receive ports.
///
/// @return True if there are live receive ports, False otherwise. Return
/// False is the root isolate is not running as well.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be helpful to state why this matters here - e.g. this effectively tells you if the isolate is running or not, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A running isolate can have no receive ports.... right?

bool HasLivePorts();

//----------------------------------------------------------------------------
/// @brief Get the last error encountered by the microtask queue.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be helpful to explain that this doesn't get actual details of errors thrown in Dart code, but basically exit codes from the VM... right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that implied from the return type of DartErrorHandleType?

chinmaygarde added a commit to chinmaygarde/flutter_engine that referenced this pull request Mar 22, 2020
Based on feedback gather in flutter#17250 after it landed.
@chinmaygarde
Copy link
Member Author

Patches based on feedback here applied in #17256

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants