Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Move PushRemoteElement to Rust #2

Merged

Conversation

tomdale
Copy link

@tomdale tomdale commented Feb 7, 2018

To move PushRemoteElement into Rust, this PR primarily introduces two new abstractions.

  1. To allow wasm to implement the existing logic around optimizing ConstReferences, we extend the GBox bitfield to add an additional bit for references that have a CONSTANT_TAG tag.
  2. We add an UpdateWithReference instruction to InstructionList that takes a reference as the first op and generates a ReferenceCache as well as emitting an updating program opcode that asserts on the cached reference.

@@ -130,12 +143,12 @@ export class Context {
private encodeObject(a: any): number {
const idx = this.stack.length;
this.stack.push(a);
return this.encodeNumberAndTag(idx, Tag.ANY);
return this.encodeNumberAndTag(idx, Tag.ANY, isConst(a));
Copy link
Owner

Choose a reason for hiding this comment

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

Oh here I think you'll want to run through the generic encode method again with a.value(), right?

@tomdale tomdale changed the title WIP on ConstReference encoding in GBox Move PushRemoteElement to Rust Feb 7, 2018
@alexcrichton alexcrichton merged commit 5fe1e09 into alexcrichton:more-rust Feb 7, 2018
@tomdale tomdale deleted the more-rust-const-ref-gbox branch February 8, 2018 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants