[TraceMonkey] Implement Jaegermonkey Sparc back-end.

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: Leon Sha, Assigned: Leon Sha)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(3 attachments, 3 obsolete attachments)

(Assignee)

Description

7 years ago
Created attachment 488819 [details] [diff] [review]
patch

Need to implement Jaegermonkey Sparc back-end.
(Assignee)

Updated

7 years ago
Attachment #488819 - Attachment is patch: true
Attachment #488819 - Attachment mime type: application/octet-stream → text/plain
Attachment #488819 - Flags: review?(dvander)
(Assignee)

Updated

7 years ago
Assignee: general → leon.sha
Status: NEW → ASSIGNED
(Assignee)

Comment 1

7 years ago
Created attachment 491082 [details] [diff] [review]
Patch to add PolyIC support
Attachment #488819 - Attachment is obsolete: true
Attachment #491082 - Flags: review?
Attachment #488819 - Flags: review?(dvander)
(Assignee)

Updated

7 years ago
Attachment #491082 - Flags: review? → review?(dvander)
Comment on attachment 491082 [details] [diff] [review]
Patch to add PolyIC support

Not done reviewing yet, but here's some initial comments...

>+    static void cacheFlush(void* code, size_t size)
>+    {
>+		  	caddr_t v = (caddr_t)code;
>+		  	caddr_t end = v + size;
>+				caddr_t p = v;
>+				while (p < end) {
>+					  asm("flush %0" : : "r" (p));
>+						p += 32;
>+				}
>+		}

Not sure what happened with spacing here.

>+#if WTF_CPU_BIG_ENDIAN
>+    static const uint32 PAYLOAD_OFFSET = 4;
>+    static const uint32 TAG_OFFSET     = 0;
>+#else
>     static const uint32 PAYLOAD_OFFSET = 0;
>     static const uint32 TAG_OFFSET     = 4;
>+#endif

Use IS_BIG_ENDIAN here to avoid WTF_* leaking outside of assembler.

>+#if defined JS_CPU_X86 || defined JS_CPU_ARM || defined JS_CPU_SPARC
>         static const int CanonicalNaNType = 0x7FF80000;
>         masm.setPtr(oppositeCond, treg, Imm32(CanonicalNaNType), result);
> #elif defined JS_CPU_X64
>         static const void *CanonicalNaNType = (void *)0x7FF8000000000000; 
>         masm.move(ImmPtr(CanonicalNaNType), JSC::X86Registers::r11);
>         masm.setPtr(oppositeCond, treg, JSC::X86Registers::r11, result);
> #endif

#ifndef JS_64BIT ... #else should be good enough here. Bonus points if you change that r11 to be scratchRegister.

>+#if WTF_CPU_BIG_ENDIAN
>+    static const uint32 POLY_PAYLOAD_OFFSET = 4;
>+    static const uint32 POLY_TAG_OFFSET     = 0;
>+#else
>+    static const uint32 POLY_PAYLOAD_OFFSET = 0;
>+    static const uint32 POLY_TAG_OFFSET     = 4;

Why do we need to dupliate this from BaseAssembler?

CC'ing Chris Leary for the regex changes.
Attachment #491082 - Flags: review?(cdleary)
(Assignee)

Comment 3

7 years ago
Created attachment 494895 [details] [diff] [review]
Patch v2 with David's comments.

Make some changes according to David's Comments. Also I changed some bit value type from int to int32. Also I expand the size of "secondShapeGuard" to 11 bits since 8 bits is not enough for Sparc.
Attachment #491082 - Attachment is obsolete: true
Attachment #494895 - Flags: review?(dvander)
Attachment #491082 - Flags: review?(dvander)
Attachment #491082 - Flags: review?(cdleary)
(Assignee)

Updated

7 years ago
Attachment #494895 - Flags: review?(cdleary)

Comment 4

7 years ago
I know it's not my bug but -- review ping?

I'd like to see this get merged in with the mainline before it rots. According to these SunSpiders numbers, it's already shipping as a contrib build:

Both:           1653
TM Only:        2012
JM Only:        1769
Interp Only:    7015

(SunFire v240, lightly loaded, 2x1503MHz cores, 4096MB physmem, 5.10 in a sparse-root zone)
(Assignee)

Comment 5

7 years ago
Created attachment 522932 [details] [diff] [review]
New file to be added.
Attachment #494895 - Attachment is obsolete: true
Attachment #494895 - Flags: review?(dvander)
Attachment #494895 - Flags: review?(cdleary)
(Assignee)

Comment 6

7 years ago
Created attachment 522933 [details] [diff] [review]
Patch part 2
(Assignee)

Updated

7 years ago
Attachment #522932 - Flags: review?(dvander)
(Assignee)

Updated

7 years ago
Attachment #522933 - Flags: review?(dvander)
Attachment #522932 - Flags: review?(dvander) → review+
Comment on attachment 522933 [details] [diff] [review]
Patch part 2

Sorry about the delay, and thanks for fixing all the payloadOf() misuses!

>             // obj->getFlatClosureUpvars()
>             masm.loadPtr(Address(reg, offsetof(JSObject, slots)), reg);
>             Address upvarAddress(reg, JSObject::JSSLOT_FLAT_CLOSURE_UPVARS * sizeof(Value));
>-            masm.loadPrivate(upvarAddress, reg);
>+            masm.loadPrivate(masm.payloadOf(upvarAddress), reg);

loadPrivate() always takes a Value*, so I would move the payloadOf() call into loadPrivate().

r=me with that
Attachment #522933 - Flags: review?(dvander) → review+
(Assignee)

Comment 8

6 years ago
Created attachment 526677 [details] [diff] [review]
patch part 2 v2

I put the payloadof inside loadprivate. Also I change the cacheFlush to be the same as flushICache in nanojit.
(Assignee)

Updated

6 years ago
Attachment #526677 - Flags: review?(dvander)
Attachment #526677 - Flags: review?(dvander) → review+
(Assignee)

Comment 9

6 years ago
http://hg.mozilla.org/tracemonkey/rev/87ee79acccc5
http://hg.mozilla.org/tracemonkey/rev/96c70f2aae85
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/87ee79acccc5
http://hg.mozilla.org/mozilla-central/rev/96c70f2aae85
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.