Closed Bug 508040 Opened 16 years ago Closed 13 years ago

lirasm - Provide global data section support

Categories

(Core :: JavaScript Engine, enhancement)

x86
All
enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: contactparitosh, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.2pre) Gecko/20090729 Ubuntu/9.04 (jaunty) Shiretoko/3.5.2pre Build Identifier: A global storage section for data can be defined at the beginning of a LIR program. This global section can be used to share data amongst fragments, and adds support for storing string data elements directly using usual string syntax. Reproducible: Always
(Aside: Paritosh, I added canconfirm and editbugs to your Bugzilla account as most of the bugs you've filed are in lirasm code whose primary maintainer is you -- so they're almost by definition valid bugs. :-) Should save a little time for the rest of us to not have to confirm them...)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch v1 (obsolete) — Splinter Review
Attachment #392516 - Flags: review?(jorendorff)
Attachment #392516 - Attachment is obsolete: true
Attachment #392517 - Flags: review?(jorendorff)
Attachment #392516 - Flags: review?(jorendorff)
I'm sorry I took so long to get around to this review! It's silly that "x y" parses as a three-character string, even though there are two spaces. The LirTokenStream should be responsible for parsing strings. Add a new LirTokenType (STRING), and add parsing code to LirTokenStream::get(): > } else if (strchr(":,=[]()", c)) { > token.type = PUNCT; > token.data = c; > mLine.erase(0, 1); >+ } else if (c == '"') { >+ token.type = STRING; >+ ??? >+ mLine.erase(0, ???); > } else if (c == ';' || c == '\n') { > token.type = NEWLINE; > token.data.clear(); > mLine.clear(); Ideally that code would handle JS-like syntax for strings, so if the LIR file contains s = .ascii "\n" then for the token '"\n"', the token.data string would be just one character, (char) 10. initGlobals should be renamed handleData or handleDataSection. It seems like this would probably accept many silly input files that it should reject. .data x = z " .end "s = " " .end Please make sure every path through initGlobals either does something useful or calls bad(). Instead of the first line here: >+ if(!isalpha(mTokens[0][0])) { >+ ins = mLir->insImm(imm(mTokens[0])); >+ } else { write this: >+ if (mTokens[0].type == NUMBER) { The memory for globals is allocated using malloc() but never free()d. Go ahead and free it, even though the process is about to exit.
Attachment #392517 - Flags: review?(jorendorff)
lirasm is gone (from Mozilla, at least).
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: