diff options
author | mniip <mniip@mniip.com> | 2016-08-30 16:57:47 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-08-30 17:50:51 -0400 |
commit | a25bf2673d0f6db5f454619ddf91f974cace4e8b (patch) | |
tree | 7b56d2ecef4a88999c8743d1ddc97a3b02c6933a /rts | |
parent | 83b326cda759cfd4c538595cf38ee23eb81a4c76 (diff) | |
download | haskell-a25bf2673d0f6db5f454619ddf91f974cace4e8b.tar.gz |
Tag pointers in interpreted constructors
Instead of stg_interp_constr_entry there are now 7 functions (one for
each value of the tag bits) that tag the constructor pointer before
returning. This is consistent with compiled constructors' entry code,
and expectations that compiled code places on compiled constructors. The
iserv protocol is extended with an extra field that explains what
pointer tag the constructor should use.
Test Plan: Added tests for #12523
Reviewers: erikd, bgamari, hvr, austin, simonmar
Reviewed By: simonmar
Subscribers: osa1, thomie, rwbarton
Differential Revision: https://phabricator.haskell.org/D2473
GHC Trac Issues: #12523
Diffstat (limited to 'rts')
-rw-r--r-- | rts/RtsSymbols.c | 8 | ||||
-rw-r--r-- | rts/StgMiscClosures.cmm | 13 |
2 files changed, 15 insertions, 6 deletions
diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c index cc26ecbddf..605a669c21 100644 --- a/rts/RtsSymbols.c +++ b/rts/RtsSymbols.c @@ -714,7 +714,13 @@ SymI_HasProto(stg_waitWritezh) \ SymI_HasProto(stg_writeTVarzh) \ SymI_HasProto(stg_yieldzh) \ - SymI_NeedsProto(stg_interp_constr_entry) \ + SymI_NeedsProto(stg_interp_constr1_entry) \ + SymI_NeedsProto(stg_interp_constr2_entry) \ + SymI_NeedsProto(stg_interp_constr3_entry) \ + SymI_NeedsProto(stg_interp_constr4_entry) \ + SymI_NeedsProto(stg_interp_constr5_entry) \ + SymI_NeedsProto(stg_interp_constr6_entry) \ + SymI_NeedsProto(stg_interp_constr7_entry) \ SymI_HasProto(stg_arg_bitmaps) \ SymI_HasProto(large_alloc_lim) \ SymI_HasProto(g0) \ diff --git a/rts/StgMiscClosures.cmm b/rts/StgMiscClosures.cmm index 6c1edf70b5..320816bfbf 100644 --- a/rts/StgMiscClosures.cmm +++ b/rts/StgMiscClosures.cmm @@ -59,11 +59,14 @@ INFO_TABLE_RET (stg_restore_cccs, RET_SMALL, W_ info_ptr, W_ cccs) Support for the bytecode interpreter. ------------------------------------------------------------------------- */ -/* 9 bits of return code for constructors created by the interpreter. */ -stg_interp_constr_entry (P_ ret) -{ - return (ret); -} +/* 7 bits of return code for constructors created by the interpreter. */ +stg_interp_constr1_entry (P_ ret) { return (ret + 1); } +stg_interp_constr2_entry (P_ ret) { return (ret + 2); } +stg_interp_constr3_entry (P_ ret) { return (ret + 3); } +stg_interp_constr4_entry (P_ ret) { return (ret + 4); } +stg_interp_constr5_entry (P_ ret) { return (ret + 5); } +stg_interp_constr6_entry (P_ ret) { return (ret + 6); } +stg_interp_constr7_entry (P_ ret) { return (ret + 7); } /* Some info tables to be used when compiled code returns a value to the interpreter, i.e. the interpreter pushes one of these onto the |