Wasm: update comments on lowlevels

This commit is contained in:
Brian Carroll 2022-01-16 08:25:20 +00:00
parent cff861ddd4
commit 05a6a9c7ce

View file

@ -40,11 +40,12 @@ pub fn dispatch_low_level<'a>(
StrStartsWithCodePt => return BuiltinCall(bitcode::STR_STARTS_WITH_CODE_PT), StrStartsWithCodePt => return BuiltinCall(bitcode::STR_STARTS_WITH_CODE_PT),
StrEndsWith => return BuiltinCall(bitcode::STR_ENDS_WITH), StrEndsWith => return BuiltinCall(bitcode::STR_ENDS_WITH),
StrSplit => { StrSplit => {
// Roughly we need to: // LLVM implementation (build_str.rs) does the following
// 1. count segments // 1. Call bitcode::STR_COUNT_SEGMENTS
// 2. make a new pointer // 2. Allocate a `List Str`
// 3. split that pointer in place // 3. Call bitcode::STR_STR_SPLIT_IN_PLACE
// see: build_str.rs line 31 // 4. Write the elements and length of the List
// To do this here, we need full access to WasmBackend, or we could make a Zig wrapper
return NotImplemented; return NotImplemented;
} }
StrCountGraphemes => return BuiltinCall(bitcode::STR_COUNT_GRAPEHEME_CLUSTERS), StrCountGraphemes => return BuiltinCall(bitcode::STR_COUNT_GRAPEHEME_CLUSTERS),
@ -78,8 +79,8 @@ pub fn dispatch_low_level<'a>(
StrFromUtf8 => return BuiltinCall(bitcode::STR_FROM_UTF8), StrFromUtf8 => return BuiltinCall(bitcode::STR_FROM_UTF8),
StrTrimLeft => return BuiltinCall(bitcode::STR_TRIM_LEFT), StrTrimLeft => return BuiltinCall(bitcode::STR_TRIM_LEFT),
StrTrimRight => return BuiltinCall(bitcode::STR_TRIM_RIGHT), StrTrimRight => return BuiltinCall(bitcode::STR_TRIM_RIGHT),
StrFromUtf8Range => return BuiltinCall(bitcode::STR_FROM_UTF8_RANGE), // refcounting errors StrFromUtf8Range => return BuiltinCall(bitcode::STR_FROM_UTF8_RANGE),
StrToUtf8 => return BuiltinCall(bitcode::STR_TO_UTF8), // refcounting errors StrToUtf8 => return BuiltinCall(bitcode::STR_TO_UTF8),
StrRepeat => return BuiltinCall(bitcode::STR_REPEAT), StrRepeat => return BuiltinCall(bitcode::STR_REPEAT),
StrTrim => return BuiltinCall(bitcode::STR_TRIM), StrTrim => return BuiltinCall(bitcode::STR_TRIM),