Closed Bug 944946 Opened 12 years ago Closed 12 years ago

Use accessor methods for script->code and script->length

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: bhackett1024, Assigned: bhackett1024)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

Attached patch patchSplinter Review
To mark script->code and script->length accesses as threadsafe when used during Ion compilation, these members need to be accessed only via methods. The attached patch makes this change, and also adds some helper methods to capture the great majority of uses of these members: script->codeEnd(), script->containsPC(pc), script->pcToOffset(pc) and script->offsetToPC(offset).
Attachment #8340707 - Flags: review?(jdemooij)
Comment on attachment 8340707 [details] [diff] [review] patch Review of attachment 8340707 [details] [diff] [review]: ----------------------------------------------------------------- Nice! ::: js/src/jit/CompileInfo.h @@ +100,3 @@ > } > jsbytecode *limitPC() const { > + return script_->code() + script_->length(); Nit: script_->codeEnd()
Attachment #8340707 - Flags: review?(jdemooij) → review+
Comment on attachment 8340707 [details] [diff] [review] patch Review of attachment 8340707 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jsopcode.cpp @@ +288,2 @@ > JSOp op = JSOp(*pc); > + jsbytecode *next = GetNextPc(pc); I just ran into a problem with GetNextPc and it made me think of this line. Unlike GetBytecodeLength, GetNextPc doesn't handle variable-length ops. So change it from return pc + js_CodeSpec[JSOp(*pc)].length; to return pc + GetBytecodeLength(pc); So that it doesn't iloop when there's a TABLESWITCH or something (CodeSpec length == -1).
Assignee: nobody → bhackett1024
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: