Skip to content

Convert upcalls to core Rust functions #2861

Closed

Description

@brson

The main motivation is that the new failure code is written in Rust so calling it directly makes more sense than indirecting through native runtime code.

This also lets us to have fewer stack-switching mechanisms as upcalls are dealt with differently than other foreign functions.

Activity

  1. brson commented on Jul 10, 2012

    @brson
    ContributorAuthor

    Probably upcall_call_on_c_stack/call_on_rust_stack needs to remain a native function, same for upcall_new_stack/del_stack (which are not called by generated code but my __morestack).

  2. brson commented on Jul 10, 2012

    @brson
    ContributorAuthor

    Actually, upcall_call_on_x_stack should be fine as a rust functions. it should just be the upcalls called by __morestack that need to be special.

  3. elliottslaughter commented on Jul 23, 2012

    @elliottslaughter
    Contributor

    This has been (partially) completed for fail in de82a9b and malloc/free in d257382. The current implementation is a very thin wrapper around the C runtime, but in the future it should be possible to move more functionality over to rust.

  4. graydon commented on Jun 6, 2013

    @graydon
    Contributor

    Agree, properly tagged and milestoned as of 2013-06-05.

  5. emberian commented on Aug 5, 2013

    @emberian
    Contributor

    @brson is this still relevant?

  6. brson commented on Oct 10, 2013

    @brson
    ContributorAuthor

    @cmr Pretty much obsolete.

  7. added 2 commits that reference this issue on May 30, 2026
  8. added a commit that references this issue on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions