Closed Bug 627246 Opened 15 years ago Closed 14 years ago

Remove "AvmObject" etc from nativegen and NativeFunction

Categories

(Tamarin Graveyard :: Virtual Machine, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: stejohns, Assigned: stejohns)

Details

Attachments

(2 files)

These typedef serve no purpose and just cloud our namespace with junk; we should use the real types directly, since the usages are machine generated.
Attached patch PatchSplinter Review
Assignee: nobody → stejohns
Attachment #505268 - Flags: review?(edwsmith)
Comment on attachment 505268 [details] [diff] [review] Patch +1, this will just make life easier in a lot of ways. I didn't see anything of substance but here's what came to mind, reviewing the patch. > // bools are passed in as int32_t, but returned as bool, for historic reasons Needs an explanation of what the historic reasons are, and caps/punctuation. IIRC, this isn't the same issue as nanojit's lack of support for C++ 'bool' in native call ABI's. > inline time to normalize with REALLY_INLINE? fine if its a different patch. > AvmThunkBox_ScriptObject(r), etc It looks like 1:1 correspondence with SlotStorageType, should we normalize names and capitalization? i.e. SST_int32, AvmThunkUnbox_int32, etc. > AvmAssert(sizeof(Atom) == sizeof(double)); This and others could be MMGC_STATIC_ASSERT > AvmThunkCoerce_Atom_double() I know its nothing to do with this patch, but looking at these macros out of context, I have *no* idea what they do. the name implies coersion, but all they do is return null or NaN. Add Some comments? > nativegen.py:744 > val = "AvmThunkGetConstantString("+str(i)+")/* \""+self.strings[i]+"\" */"; Nit, but python's printf-style formatting is easier to grok: val = 'AvmThunkGetConstantString(%s)/* "%s" */' % (i, self.strings[i]) Reading on in the patch, it looks like you did switch a few other formatting expressions to be printf style (cool). Oh, and I bet that one would cause a C++ syntax error if the string constant contained */. Not exactly a big deal for now. I only skimmed the rest of the nativegen.py changes. Testing is more likely to catch bugs here than review.
Attachment #505268 - Flags: review?(edwsmith) → review+
pushed with minor changes as 5813:66b34035e6ce
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
(In reply to comment #3) > pushed with minor changes as 5813:66b34035e6ce This patch is causing compilation errors on windows debugger builds (seen using x-plat build script) core\builtin.cpp(970) : error C2220: warning treated as error - no 'object' file generated core\builtin.cpp(970) : warning C4800: 'uint32_t' : forcing value to bool 'true' or 'false' (performance warning) core\builtin.cpp(995) : warning C4800: 'uint32_t' : forcing value to bool 'true' or 'false' (performance warning) core\builtin.cpp(1020) : warning C4800: 'uint32_t' : forcing value to bool 'true' or 'false' (performance warning) core\builtin.cpp(1045) : warning C4800: 'uint32_t' : forcing value to bool 'true' or 'false' (performance warning)
There are still issues with compiling windows debugger builds that are not addressed: core\avmpluslist-impl.h(367) : warning C4738: storing 32-bit float result in memory, possible loss of performance core\bytearrayglue.cpp(710) : warning C4738: storing 32-bit float result in memory, possible loss of performance core\dataio.cpp(255) : warning C4738: storing 32-bit float result in memory, possible loss of performance
Attachment #505421 - Flags: review?(stejohns)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment on attachment 505421 [details] [diff] [review] workaround vs warning C4800 I can't tell where the bug is. 1. is the bug that the native getter for (e.g.) XML.ignoreComments() returns uint32_t instead of C++ bool? if so, then the native getters/setters should be changed, and the warning goes away. 2. or, if native functions returning AS3 bool should return C++ uint32_t, then the bug is the generated code, and this patch looks okay. (but maybe isn't enough, see the next comment from Brent)
(In reply to comment #5) > There are still issues with compiling windows debugger builds that are not > addressed: > > core\avmpluslist-impl.h(367) : warning C4738: storing 32-bit float result in > memory, possible loss of performance > > core\bytearrayglue.cpp(710) : warning C4738: storing 32-bit float result in > memory, possible loss of performance > > core\dataio.cpp(255) : warning C4738: storing 32-bit float result in memory, > possible loss of performance Its not at all clear whats causing these warnings. were they injections from Steven's patch?
(In reply to comment #7) > (In reply to comment #5) > > > There are still issues with compiling windows debugger builds that are not > > addressed: > > > > core\avmpluslist-impl.h(367) : warning C4738: storing 32-bit float result in > > memory, possible loss of performance > > > > core\bytearrayglue.cpp(710) : warning C4738: storing 32-bit float result in > > memory, possible loss of performance > > > > core\dataio.cpp(255) : warning C4738: storing 32-bit float result in memory, > > possible loss of performance > > Its not at all clear whats causing these warnings. were they injections from > Steven's patch? These errors occur because of the original patch. These errors were not visible in the build system, te appeared to have stopped at the first error, however if built in VS then the boolean warning (commment #4) and the 32-bit float error (comment #5) happen during a debugger compilation.
The bug is that the old thunks would cast the result more aggressively, so a native function returning uint32_t for a "bool" would get it explicitly cast. This cast is now removed; I'm going to fix the XML native functions to be declared as they should have been in the first place.
The 32-bit float warning is a bit baffling though; it's appearing in code that doesn't appear to be obviously related to my change... investigating
changeset: 5816:bd2097c9f785 user: Steven Johnson <stejohns@adobe.com> summary: Bug 627246 followup: fix cast warning for XMLClass on windows (r=stejohns) http://hg.mozilla.org/tamarin-redux/rev/bd2097c9f785
I pushed a fix for the XMLClass casts... but the 'float' warnings predate my change, looking for injection point now
Comment on attachment 505421 [details] [diff] [review] workaround vs warning C4800 rejecting because I chose to fix it in an alternate way, namely correcting the glue code to have correct declarations
Attachment #505421 - Flags: review?(stejohns) → review-
Status: REOPENED → RESOLVED
Closed: 15 years ago14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: