@@ -1904,7 +1904,9 @@ class ExpressionRunner : public OverriddenVisitor<SubType, Flow> {
19041904 }
19051905 Flow visitStringMeasure (StringMeasure* curr) {
19061906 // For now we only support JS-style strings.
1907- assert (curr->op == StringMeasureWTF16View);
1907+ if (curr->op != StringMeasureWTF16View) {
1908+ return Flow (NONCONSTANT_FLOW);
1909+ }
19081910
19091911 Flow flow = visit (curr->ref );
19101912 if (flow.breaking ()) {
@@ -1917,8 +1919,8 @@ class ExpressionRunner : public OverriddenVisitor<SubType, Flow> {
19171919 }
19181920 return Literal (int32_t (data->values .size ()));
19191921 }
1920- Flow visitStringEncode (StringEncode* curr) { WASM_UNREACHABLE ( " unimp " ); }
1921- Flow visitStringConcat (StringConcat* curr) { WASM_UNREACHABLE ( " unimp " ); }
1922+ Flow visitStringEncode (StringEncode* curr) { return Flow (NONCONSTANT_FLOW ); }
1923+ Flow visitStringConcat (StringConcat* curr) { return Flow (NONCONSTANT_FLOW ); }
19221924 Flow visitStringEq (StringEq* curr) {
19231925 NOTE_ENTER (" StringEq" );
19241926 Flow flow = visit (curr->left );
@@ -1987,7 +1989,9 @@ class ExpressionRunner : public OverriddenVisitor<SubType, Flow> {
19871989 }
19881990 Flow visitStringAs (StringAs* curr) {
19891991 // For now we only support JS-style strings.
1990- assert (curr->op == StringAsWTF16);
1992+ if (curr->op != StringAsWTF16) {
1993+ return Flow (NONCONSTANT_FLOW);
1994+ }
19911995
19921996 Flow flow = visit (curr->ref );
19931997 if (flow.breaking ()) {
@@ -2004,10 +2008,10 @@ class ExpressionRunner : public OverriddenVisitor<SubType, Flow> {
20042008 return Literal (data, curr->type .getHeapType ());
20052009 }
20062010 Flow visitStringWTF8Advance (StringWTF8Advance* curr) {
2007- WASM_UNREACHABLE ( " unimp " );
2011+ return Flow (NONCONSTANT_FLOW );
20082012 }
20092013 Flow visitStringWTF16Get (StringWTF16Get* curr) {
2010- NOTE_ENTER (" StringEq " );
2014+ NOTE_ENTER (" StringWTF16Get " );
20112015 Flow ref = visit (curr->ref );
20122016 if (ref.breaking ()) {
20132017 return ref;
@@ -2028,11 +2032,17 @@ class ExpressionRunner : public OverriddenVisitor<SubType, Flow> {
20282032 }
20292033 return Literal (values[i].geti32 ());
20302034 }
2031- Flow visitStringIterNext (StringIterNext* curr) { WASM_UNREACHABLE (" unimp" ); }
2032- Flow visitStringIterMove (StringIterMove* curr) { WASM_UNREACHABLE (" unimp" ); }
2033- Flow visitStringSliceWTF (StringSliceWTF* curr) { WASM_UNREACHABLE (" unimp" ); }
2035+ Flow visitStringIterNext (StringIterNext* curr) {
2036+ return Flow (NONCONSTANT_FLOW);
2037+ }
2038+ Flow visitStringIterMove (StringIterMove* curr) {
2039+ return Flow (NONCONSTANT_FLOW);
2040+ }
2041+ Flow visitStringSliceWTF (StringSliceWTF* curr) {
2042+ return Flow (NONCONSTANT_FLOW);
2043+ }
20342044 Flow visitStringSliceIter (StringSliceIter* curr) {
2035- WASM_UNREACHABLE ( " unimp " );
2045+ return Flow (NONCONSTANT_FLOW );
20362046 }
20372047
20382048 virtual void trap (const char * why) { WASM_UNREACHABLE (" unimp" ); }
@@ -2369,31 +2379,6 @@ class ConstantExpressionRunner : public ExpressionRunner<SubType> {
23692379 NOTE_ENTER (" Rethrow" );
23702380 return Flow (NONCONSTANT_FLOW);
23712381 }
2372- Flow visitStringMeasure (StringMeasure* curr) {
2373- return Flow (NONCONSTANT_FLOW);
2374- }
2375- Flow visitStringEncode (StringEncode* curr) { return Flow (NONCONSTANT_FLOW); }
2376- Flow visitStringConcat (StringConcat* curr) { return Flow (NONCONSTANT_FLOW); }
2377- Flow visitStringEq (StringEq* curr) { return Flow (NONCONSTANT_FLOW); }
2378- Flow visitStringAs (StringAs* curr) { return Flow (NONCONSTANT_FLOW); }
2379- Flow visitStringWTF8Advance (StringWTF8Advance* curr) {
2380- return Flow (NONCONSTANT_FLOW);
2381- }
2382- Flow visitStringWTF16Get (StringWTF16Get* curr) {
2383- return Flow (NONCONSTANT_FLOW);
2384- }
2385- Flow visitStringIterNext (StringIterNext* curr) {
2386- return Flow (NONCONSTANT_FLOW);
2387- }
2388- Flow visitStringIterMove (StringIterMove* curr) {
2389- return Flow (NONCONSTANT_FLOW);
2390- }
2391- Flow visitStringSliceWTF (StringSliceWTF* curr) {
2392- return Flow (NONCONSTANT_FLOW);
2393- }
2394- Flow visitStringSliceIter (StringSliceIter* curr) {
2395- return Flow (NONCONSTANT_FLOW);
2396- }
23972382 Flow visitRefAs (RefAs* curr) {
23982383 // TODO: Remove this once interpretation is implemented.
23992384 if (curr->op == ExternInternalize || curr->op == ExternExternalize) {
0 commit comments