diff options
Diffstat (limited to '')
-rw-r--r-- | src/lane.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lane.cpp b/src/lane.cpp index 29ad8bb..65cb58d 100644 --- a/src/lane.cpp +++ b/src/lane.cpp | |||
@@ -150,7 +150,7 @@ static LUAG_FUNC(thread_join) | |||
150 | if (_stored == 0) { | 150 | if (_stored == 0) { |
151 | raise_luaL_error(L_, _lane->L ? "First return value must be non-nil when using join()" : "Can't join() more than once or after indexing"); | 151 | raise_luaL_error(L_, _lane->L ? "First return value must be non-nil when using join()" : "Can't join() more than once or after indexing"); |
152 | } | 152 | } |
153 | lua_getiuservalue(L_, StackIndex{ 1 }, 1); // L_: lane {uv} | 153 | lua_getiuservalue(L_, StackIndex{ 1 }, UserValueIndex{ 1 }); // L_: lane {uv} |
154 | for (int _i = 2; _i <= _stored; ++_i) { | 154 | for (int _i = 2; _i <= _stored; ++_i) { |
155 | lua_rawgeti(L_, 2, _i); // L_: lane {uv} results2...N | 155 | lua_rawgeti(L_, 2, _i); // L_: lane {uv} results2...N |
156 | } | 156 | } |
@@ -163,7 +163,7 @@ static LUAG_FUNC(thread_join) | |||
163 | case Lane::Error: | 163 | case Lane::Error: |
164 | { | 164 | { |
165 | LUA_ASSERT(L_, _stored == 2 || _stored == 3); | 165 | LUA_ASSERT(L_, _stored == 2 || _stored == 3); |
166 | lua_getiuservalue(L_, StackIndex{ 1 }, 1); // L_: lane {uv} | 166 | lua_getiuservalue(L_, StackIndex{ 1 }, UserValueIndex{ 1 }); // L_: lane {uv} |
167 | lua_rawgeti(L_, 2, 2); // L_: lane {uv} <error> | 167 | lua_rawgeti(L_, 2, 2); // L_: lane {uv} <error> |
168 | lua_rawgeti(L_, 2, 3); // L_: lane {uv} <error> <trace>|nil | 168 | lua_rawgeti(L_, 2, 3); // L_: lane {uv} <error> <trace>|nil |
169 | if (lua_isnil(L_, -1)) { | 169 | if (lua_isnil(L_, -1)) { |
@@ -178,7 +178,7 @@ static LUAG_FUNC(thread_join) | |||
178 | 178 | ||
179 | case Lane::Cancelled: | 179 | case Lane::Cancelled: |
180 | LUA_ASSERT(L_, _stored == 2); | 180 | LUA_ASSERT(L_, _stored == 2); |
181 | lua_getiuservalue(L_, StackIndex{ 1 }, 1); // L_: lane {uv} | 181 | lua_getiuservalue(L_, StackIndex{ 1 }, UserValueIndex{ 1 }); // L_: lane {uv} |
182 | lua_rawgeti(L_, 2, 2); // L_: lane {uv} cancel_error | 182 | lua_rawgeti(L_, 2, 2); // L_: lane {uv} cancel_error |
183 | lua_rawgeti(L_, 2, 1); // L_: lane {uv} cancel_error nil | 183 | lua_rawgeti(L_, 2, 1); // L_: lane {uv} cancel_error nil |
184 | lua_replace(L_, -3); // L_: lane nil cancel_error | 184 | lua_replace(L_, -3); // L_: lane nil cancel_error |
@@ -828,7 +828,7 @@ static LUAG_FUNC(lane_gc) | |||
828 | Lane* const _lane{ ToLane(L_, StackIndex{ 1 }) }; // L_: ud | 828 | Lane* const _lane{ ToLane(L_, StackIndex{ 1 }) }; // L_: ud |
829 | 829 | ||
830 | // if there a gc callback? | 830 | // if there a gc callback? |
831 | lua_getiuservalue(L_, StackIndex{ 1 }, 1); // L_: ud uservalue | 831 | lua_getiuservalue(L_, StackIndex{ 1 }, UserValueIndex{ 1 }); // L_: ud uservalue |
832 | kLaneGC.pushKey(L_); // L_: ud uservalue __gc | 832 | kLaneGC.pushKey(L_); // L_: ud uservalue __gc |
833 | lua_rawget(L_, -2); // L_: ud uservalue gc_cb|nil | 833 | lua_rawget(L_, -2); // L_: ud uservalue gc_cb|nil |
834 | if (!lua_isnil(L_, -1)) { | 834 | if (!lua_isnil(L_, -1)) { |
@@ -1070,7 +1070,7 @@ void Lane::pushIndexedResult(lua_State* const L_, int const key_) const | |||
1070 | LUA_ASSERT(L_, ToLane(L_, kIdxSelf) == this); // L_: lane ... | 1070 | LUA_ASSERT(L_, ToLane(L_, kIdxSelf) == this); // L_: lane ... |
1071 | STACK_GROW(L_, 3); | 1071 | STACK_GROW(L_, 3); |
1072 | 1072 | ||
1073 | lua_getiuservalue(L_, kIdxSelf, 1); // L_: lane ... {uv} | 1073 | lua_getiuservalue(L_, kIdxSelf, UserValueIndex{ 1 }); // L_: lane ... {uv} |
1074 | if (status != Lane::Error) { | 1074 | if (status != Lane::Error) { |
1075 | lua_rawgeti(L_, -1, key_); // L_: lane ... {uv} uv[i] | 1075 | lua_rawgeti(L_, -1, key_); // L_: lane ... {uv} uv[i] |
1076 | lua_remove(L_, -2); // L_: lane ... uv[i] | 1076 | lua_remove(L_, -2); // L_: lane ... uv[i] |
@@ -1138,7 +1138,7 @@ void Lane::resetResultsStorage(lua_State* const L_, StackIndex const self_idx_) | |||
1138 | // create the new table | 1138 | // create the new table |
1139 | lua_newtable(L_); // L_: ... self ... {} | 1139 | lua_newtable(L_); // L_: ... self ... {} |
1140 | // get the current table | 1140 | // get the current table |
1141 | lua_getiuservalue(L_, _self_idx, 1); // L_: ... self ... {} {uv} | 1141 | lua_getiuservalue(L_, _self_idx, UserValueIndex{ 1 }); // L_: ... self ... {} {uv} |
1142 | LUA_ASSERT(L_, lua_istable(L_, -1)); | 1142 | LUA_ASSERT(L_, lua_istable(L_, -1)); |
1143 | // read gc_cb from the current table | 1143 | // read gc_cb from the current table |
1144 | kLaneGC.pushKey(L_); // L_: ... self ... {} {uv} kLaneGC | 1144 | kLaneGC.pushKey(L_); // L_: ... self ... {} {uv} kLaneGC |
@@ -1149,7 +1149,7 @@ void Lane::resetResultsStorage(lua_State* const L_, StackIndex const self_idx_) | |||
1149 | // we can forget the old table | 1149 | // we can forget the old table |
1150 | lua_pop(L_, 1); // L_: ... self ... {} | 1150 | lua_pop(L_, 1); // L_: ... self ... {} |
1151 | // and store the new one | 1151 | // and store the new one |
1152 | lua_setiuservalue(L_, _self_idx, 1); // L_: ... self ... | 1152 | lua_setiuservalue(L_, _self_idx, UserValueIndex{ 1 }); // L_: ... self ... |
1153 | STACK_CHECK(L_, 0); | 1153 | STACK_CHECK(L_, 0); |
1154 | } | 1154 | } |
1155 | 1155 | ||
@@ -1161,7 +1161,7 @@ void Lane::securizeDebugName(lua_State* const L_) | |||
1161 | STACK_CHECK_START_REL(L_, 0); | 1161 | STACK_CHECK_START_REL(L_, 0); |
1162 | STACK_GROW(L_, 3); | 1162 | STACK_GROW(L_, 3); |
1163 | // a Lane's uservalue should be a table | 1163 | // a Lane's uservalue should be a table |
1164 | lua_getiuservalue(L_, StackIndex{ 1 }, 1); // L_: lane ... {uv} | 1164 | lua_getiuservalue(L_, StackIndex{ 1 }, UserValueIndex{ 1 }); // L_: lane ... {uv} |
1165 | LUA_ASSERT(L_, lua_istable(L_, -1)); | 1165 | LUA_ASSERT(L_, lua_istable(L_, -1)); |
1166 | // we don't care about the actual key, so long as it's unique and can't collide with anything. | 1166 | // we don't care about the actual key, so long as it's unique and can't collide with anything. |
1167 | lua_newtable(L_); // L_: lane ... {uv} {} | 1167 | lua_newtable(L_); // L_: lane ... {uv} {} |
@@ -1195,7 +1195,7 @@ int Lane::storeResults(lua_State* const L_) | |||
1195 | LUA_ASSERT(L_, ToLane(L_, kIdxSelf) == this); | 1195 | LUA_ASSERT(L_, ToLane(L_, kIdxSelf) == this); |
1196 | 1196 | ||
1197 | STACK_CHECK_START_REL(L_, 0); | 1197 | STACK_CHECK_START_REL(L_, 0); |
1198 | lua_getiuservalue(L_, kIdxSelf, 1); // L_: lane ... {uv} | 1198 | lua_getiuservalue(L_, kIdxSelf, UserValueIndex{ 1 }); // L_: lane ... {uv} |
1199 | StackIndex const _tidx{ lua_gettop(L_) }; | 1199 | StackIndex const _tidx{ lua_gettop(L_) }; |
1200 | 1200 | ||
1201 | int _stored{}; | 1201 | int _stored{}; |