diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-11-14 14:15:53 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-11-14 14:15:53 -0200 |
| commit | 41fd639cab8e2835ad2860442c19eb78fbc777be (patch) | |
| tree | 4ae644a4612561537169d070a90fdfd826024b26 /lvm.c | |
| parent | a845a46cc883a76cb5175c0755805ba44a37d909 (diff) | |
| download | lua-41fd639cab8e2835ad2860442c19eb78fbc777be.tar.gz lua-41fd639cab8e2835ad2860442c19eb78fbc777be.tar.bz2 lua-41fd639cab8e2835ad2860442c19eb78fbc777be.zip | |
documentation for write barriers
Diffstat (limited to '')
| -rw-r--r-- | lvm.c | 12 |
1 files changed, 6 insertions, 6 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lvm.c,v 1.259 2002/11/06 19:08:00 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 1.260 2002/11/07 15:37:10 roberto Exp roberto $ |
| 3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -57,13 +57,13 @@ const TObject *luaV_tonumber (const TObject *obj, TObject *n) { | |||
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | 59 | ||
| 60 | int luaV_tostring (lua_State *L, TObject *obj) { | 60 | int luaV_tostring (lua_State *L, StkId obj) { |
| 61 | if (!ttisnumber(obj)) | 61 | if (!ttisnumber(obj)) |
| 62 | return 0; | 62 | return 0; |
| 63 | else { | 63 | else { |
| 64 | char s[32]; /* 16 digits, sign, point and \0 (+ some extra...) */ | 64 | char s[32]; /* 16 digits, sign, point and \0 (+ some extra...) */ |
| 65 | lua_number2str(s, nvalue(obj)); | 65 | lua_number2str(s, nvalue(obj)); |
| 66 | setsvalue(obj, luaS_new(L, s)); | 66 | setsvalue2s(obj, luaS_new(L, s)); |
| 67 | return 1; | 67 | return 1; |
| 68 | } | 68 | } |
| 69 | } | 69 | } |
| @@ -176,7 +176,7 @@ void luaV_settable (lua_State *L, const TObject *t, TObject *key, StkId val) { | |||
| 176 | TObject *oldval = luaH_set(L, h, key); /* do a primitive set */ | 176 | TObject *oldval = luaH_set(L, h, key); /* do a primitive set */ |
| 177 | if (!ttisnil(oldval) || /* result is no nil? */ | 177 | if (!ttisnil(oldval) || /* result is no nil? */ |
| 178 | (tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */ | 178 | (tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */ |
| 179 | setobj2t(oldval, val); | 179 | setobj2t(oldval, val); /* write barrier */ |
| 180 | return; | 180 | return; |
| 181 | } | 181 | } |
| 182 | /* else will try the tag method */ | 182 | /* else will try the tag method */ |
| @@ -453,7 +453,7 @@ StkId luaV_execute (lua_State *L) { | |||
| 453 | } | 453 | } |
| 454 | case OP_SETUPVAL: { | 454 | case OP_SETUPVAL: { |
| 455 | int b = GETARG_B(i); | 455 | int b = GETARG_B(i); |
| 456 | setobj(cl->upvals[b]->v, ra); | 456 | setobj(cl->upvals[b]->v, ra); /* write barrier */ |
| 457 | break; | 457 | break; |
| 458 | } | 458 | } |
| 459 | case OP_SETTABLE: { | 459 | case OP_SETTABLE: { |
| @@ -696,7 +696,7 @@ StkId luaV_execute (lua_State *L) { | |||
| 696 | } | 696 | } |
| 697 | bc &= ~(LFIELDS_PER_FLUSH-1); /* bc = bc - bc%FPF */ | 697 | bc &= ~(LFIELDS_PER_FLUSH-1); /* bc = bc - bc%FPF */ |
| 698 | for (; n > 0; n--) | 698 | for (; n > 0; n--) |
| 699 | setobj2t(luaH_setnum(L, h, bc+n), ra+n); | 699 | setobj2t(luaH_setnum(L, h, bc+n), ra+n); /* write barrier */ |
| 700 | break; | 700 | break; |
| 701 | } | 701 | } |
| 702 | case OP_CLOSE: { | 702 | case OP_CLOSE: { |
