stringref icon indicating copy to clipboard operation
stringref copied to clipboard

New instruction `string.from_code_point`

Open Liedtke opened this issue 2 years ago • 7 comments

Following up on https://github.com/WebAssembly/stringref/issues/5#issuecomment-1312572737 we decided to implement string.from_code_point for performance evaluations in V8 (see also #58):

  • string.from_code_point(codepoint: i32) -> ref string, opcode 0xfba9
  • returns a string consisting of the provided codepoint
  • the instruction traps if the argument is not a valid unicode codepoint

Liedtke avatar Jan 26 '23 13:01 Liedtke

Shouldn't this be returning ref string instead? @Liedtke @jakobkummerow

gkdn avatar Feb 15 '23 07:02 gkdn

BTW, I think also binaryen mismatches Chrome here and assumes the instruction returns ref string which results in code rejected by V8. Adding @kripken to verify.

gkdn avatar Feb 15 '23 08:02 gkdn

@gkdn Yeah, the returned value is never null. I'll adapt the return type in v8 and in my comment above.

Liedtke avatar Feb 15 '23 09:02 Liedtke

What should happen for invalid code points? Like 0x110000 and above. In JavaScript this leads to an exception. At least for String.fromCodePoint

MaxGraey avatar Feb 16 '23 16:02 MaxGraey

@MaxGraey The instruction traps for invalid codepoints.

Liedtke avatar Feb 16 '23 16:02 Liedtke

@Liedtke do you have link to the dashboard to track the release? or if you know dev-channel version to get the fix that would work as well.

gkdn avatar Feb 23 '23 20:02 gkdn

@gkdn It's in Dev 112.0.5612, see https://chromiumdash.appspot.com/commit/54b016989406901e819d3090a92739e7bc1c98b9.

jakobkummerow avatar Feb 23 '23 21:02 jakobkummerow