SkSL interpreter performance improvements
Bug: skia:
Change-Id: Ib7aff4a5b159d8ec3b4b8bb96cee62ed5d277a04
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211641
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/sksl/SkSLByteCodeGenerator.h b/src/sksl/SkSLByteCodeGenerator.h
index d89d578..497d462 100644
--- a/src/sksl/SkSLByteCodeGenerator.h
+++ b/src/sksl/SkSLByteCodeGenerator.h
@@ -83,6 +83,8 @@
bool generateCode() override;
+ void align(int divisor, int remainder);
+
void write8(uint8_t b);
void write16(uint16_t b);
@@ -122,8 +124,8 @@
void set() {
int target = fGenerator.fCode->size();
SkASSERT(target <= 65535);
- (*fGenerator.fCode)[fOffset] = target >> 8;
- (*fGenerator.fCode)[fOffset + 1] = target;
+ (*fGenerator.fCode)[fOffset] = target;
+ (*fGenerator.fCode)[fOffset + 1] = target >> 8;
#ifdef SK_DEBUG
fSet = true;
#endif