Closed Bug 519856 Opened 15 years ago Closed 15 years ago

NJ merge: move VMPI stuff from avmplus

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: graydon, Assigned: graydon)

References

Details

Attachments

(1 file, 2 obsolete files)

Attached patch move stuff around (obsolete) — Splinter Review
Some portions of Adobe code reference "VMPI.h", and it seems like it'd be good for keeping the stub-code relationships simple to match the layout of their portability layers. This patch moves some of the avmplus-resident "VMPI" code to a separate VMPI.h / VMPI.cpp pair.

There's no new code here, just movement.

Will need to try-server it a bit to make sure various platforms are ok with it, but it seems to work here.

This is prerequisite for getting nanojit-central running.
Attachment #403910 - Flags: review?(nnethercote)
Comment on attachment 403910 [details] [diff] [review]
move stuff around

r=me if it passes try server.
Attachment #403910 - Flags: review?(nnethercote) → review+
Attached patch update (obsolete) — Splinter Review
This patch has grown just a little bit of hair that escapes the nanojit/ subdirectory; namely the definition of _STDINT_H in the end of jsstdint.h. This is a lame but workable way of communicating between the two insulation layers here (jsstdint.h and VMPI.h) that the former has been seen, and not to include the stdint bits of the latter.

r?'ing brendan for approval in this mess. It ain't pretty but I can't think of a nicer way that doesn't pollute the VMPI.h with JS stuff, and I'm trying to get all JS stuff out of nanojit/
Attachment #403910 - Attachment is obsolete: true
Attachment #404139 - Flags: review?
Attachment #404139 - Flags: review? → review?(brendan)
Comment on attachment 404139 [details] [diff] [review]
update

Gonna defer to jimb, otherwise rs=me.

/be
Attachment #404139 - Flags: review?(brendan) → review?(jim)
Blocks: 520099
Comment on attachment 404139 [details] [diff] [review]
update

There are two things I don't understand about this patch:

- Why do we check HAVE_CONFIG_H and #include "config.h" in avmplus.h?  avmplus.h is our shim between nanojit and SM, isn't it?  Whose config.h would that be?

- Why did the WinCE AllocCodeChunk and FreeCodeChunk cases disappear in avmplus.cpp?
The config.h bit is actually ... used in nanojit-central, not here. The idea with this merge is to at least sync up tracemonkey's avmplus.h with the avmplus.h that exists in nanojit-central. We can't be identical to the avmplus.h that's in tamarin-redux, at least not at the moment, because it actually *does* pull in heaps of tamarin-specific code. But I figured identity with *one* side of the merge would be better than none. Maybe at some point we can edit out dependency on avmplus.h entirely.

I suppose I can guard that bit with #define NANOJIT_CENTRAL as well, if you like? This is all sort of a stop-gap. I figure once we have an established rhythm of patch-flow between repositories, coordinating further incremental cleanup in the shims and include-dependencies will be a bit easier, as we'll have many eyes focused on the task of deciding the best arrangement.

The loss of the WinCE bits was accidental during code movement, I'll restore them.
You mean #ifdef NANOJIT_CENTRAL?  That might make it clearer; a comment would be fine.
I mean:

-#ifdef HAVE_CONFIG_H
+#if defined(HAVE_CONFIG_H) && defined(NANOJIT_CENTRAL)

But can just conditional on NANOJIT_CENTRAL as well. Figured I'd keep the autoconf @DEFS@-based mechanism of switching between a config.h file and a list of -D flags functioning as-is, just conditionalize the *whole thing* on NANOJIT_CENTRAL.

Either way, I don't care much.
This variant incorporates the described changes.
Attachment #404139 - Attachment is obsolete: true
Attachment #404373 - Flags: review?
Attachment #404139 - Flags: review?(jim)
Comment on attachment 404373 [details] [diff] [review]
refresh the patch

Looks good.  My only thought is, since <stdint.h> and "jsstdint.h" both define INT8_MAX, etc., would it make sense to test for that macro's definedness instead of introducing a new one that is a shared secret between jsstdint.h and avmplus.h?

Either way, r+.
Attachment #404373 - Flags: review? → review+
http://hg.mozilla.org/tracemonkey/rev/9c18491c7b39
Whiteboard: fixed-in-tracemonkey
Fun and games. INT8_MAX might work too, sure, but those in turn are only active in a C++ include environment that happens to have defined(__STDC_LIMIT_MACROS). Overall I think the approach in the patch is plausibly the least gnarly. For now.
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/9c18491c7b39
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Flags: in-testsuite-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: