Closed Bug 585199 Opened 9 years ago Closed 9 years ago

Implement WebGLActiveInfo, remove NativeJSContext, adapt WebGL code to that

Categories

(Core :: Canvas: WebGL, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- beta5+

People

(Reporter: bjacob, Assigned: bjacob)

References

Details

Attachments

(2 files)

This patch:
 * implements WebGLActiveInfo
 * changes GetActiveAttrib and GetActiveUniform to use it instead of NativeJSContext
 * changes GetVertexAttrib to use nsIVariant instead of NativeJSContext
 * removes the now unused NativeJSContext
 * removes all remaining WebGL functions from the quickstubbing blacklist.


However, the latter point seems to be causing JS crashes! If I leave the quickstubbing blacklist as-is, no crash, but if I do remove webgl functions from the blacklist, boom, I get this backtrace:



(gdb) bt
#0  0x000000381e0a6afd in nanosleep () at ../sysdeps/unix/syscall-template.S:82
#1  0x000000381e0a6970 in __sleep (seconds=0)
    at ../sysdeps/unix/sysv/linux/sleep.c:138
#2  0x00007f9c60dbff4c in ah_crap_handler (signum=6)
    at /home/bjacob/mozilla-central/toolkit/xre/nsSigHandlers.cpp:132
#3  0x00007f9c60dc4ced in nsProfileLock::FatalSignalHandler (signo=6, info=
    0x7fff8a6452b0, context=0x7fff8a645180) at nsProfileLock.cpp:221
#4  <signal handler called>
#5  0x000000381e80f30b in raise (sig=<value optimized out>)
    at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:42
#6  0x00007f9c60438c28 in avmplus::AvmAssertFail ()
    at /home/bjacob/mozilla-central/js/src/nanojit/avmplus.cpp:78
#7  0x00007f9c60433972 in nanojit::ValidateWriter::typeCheckArgs (this=
    0x7f9c47eecd28, op=nanojit::LIR_eqi, nArgs=2, formals=0x7fff8a6456b0, args=
    0x7fff8a6456a0) at /home/bjacob/mozilla-central/js/src/nanojit/LIR.cpp:2822
#8  0x00007f9c6043427f in nanojit::ValidateWriter::ins2 (this=0x7f9c47eecd28, 
    op=nanojit::LIR_eqi, a=0x7f9c476d31a8, b=0x7f9c475e70c0)
    at /home/bjacob/mozilla-central/js/src/nanojit/LIR.cpp:3128
#9  0x00007f9c60377e2d in nanojit::LirWriter::ins2ImmI (this=0x7f9c47eecd28, v=
    nanojit::LIR_eqi, oprnd1=0x7f9c476d31a8, imm=1)
    at /home/bjacob/mozilla-central/js/src/nanojit/LIR.h:1605
#10 0x00007f9c603f766a in js::TraceRecorder::record_JSOP_NOT (this=
    0x7f9c475cd800) at /home/bjacob/mozilla-central/js/src/jstracer.cpp:10838
#11 0x00007f9c603ea924 in js::TraceRecorder::monitorRecording (this=
    0x7f9c475cd800, op=JSOP_NOT)
    at /home/bjacob/mozilla-central/js/src/jsopcode.tbl:151
#12 0x00007f9c602cd69f in js::Interpret (cx=0x7f9c4fa0b000)
    at /home/bjacob/mozilla-central/js/src/jsinterp.cpp:2475
#13 0x00007f9c602f8460 in js::Execute (cx=0x7f9c4fa0b000, chain=
    0x7f9c496637e0, script=0x7f9c47f2e000, down=0x0, flags=0, result=0x0)
    at /home/bjacob/mozilla-central/js/src/jsinterp.cpp:907
#14 0x00007f9c602539a8 in JS_EvaluateUCScriptForPrincipals (cx=0x7f9c4fa0b000, 
    obj=0x7f9c496637e0, principals=0x7f9c495714c8, chars=0x7f9c47d79008, 
    length=8531, filename=
    0x7f9c4956d4c8 "https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/gl-uniform-arrays.html", lineno=40, rval=0x0)
    at /home/bjacob/mozilla-central/js/src/jsapi.cpp:4761
#15 0x00007f9c616b1746 in nsJSContext::EvaluateString (this=0x7f9c4fa80c50, 
    aScript=..., aScopeObject=0x7f9c496637e0, aPrincipal=0x7f9c495714c0, aURL=
    0x7f9c4956d4c8 "https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/gl-uniform-arrays.html", aLineNo=40, aVersion=0, 
    aRetValue=0x0, aIsUndefined=0x7fff8a6473bc)
    at /home/bjacob/mozilla-central/dom/base/nsJSEnvironment.cpp:1811
#16 0x00007f9c6142cb3b in nsScriptLoader::EvaluateScript (this=0x7f9c562e84c0, 
    aRequest=0x7f9c495edce0, aScript=...)
    at /home/bjacob/mozilla-central/content/base/src/nsScriptLoader.cpp:764
---Type <return> to continue, or q <return> to quit---
#17 0x00007f9c6142c509 in nsScriptLoader::ProcessRequest (this=0x7f9c562e84c0, 
    aRequest=0x7f9c495edce0)
    at /home/bjacob/mozilla-central/content/base/src/nsScriptLoader.cpp:674
#18 0x00007f9c6142c0c6 in nsScriptLoader::ProcessScriptElement (this=
    0x7f9c562e84c0, aElement=0x7f9c47d98e48)
    at /home/bjacob/mozilla-central/content/base/src/nsScriptLoader.cpp:614
#19 0x00007f9c61428dfd in nsScriptElement::MaybeProcessScript (this=
    0x7f9c47d98e48)
    at /home/bjacob/mozilla-central/content/base/src/nsScriptElement.cpp:195
#20 0x00007f9c615502c8 in nsHTMLScriptElement::MaybeProcessScript (this=
    0x7f9c47d98de0)
    at /home/bjacob/mozilla-central/content/html/content/src/nsHTMLScriptElement.cpp:551
#21 0x00007f9c6154ff90 in nsHTMLScriptElement::DoneAddingChildren (this=
    0x7f9c47d98de0, aHaveNotified=1)
    at /home/bjacob/mozilla-central/content/html/content/src/nsHTMLScriptElement.cpp:479
#22 0x00007f9c61884832 in nsHtml5TreeOpExecutor::RunScript (this=
    0x7f9c495b6880, aScriptElement=0x7f9c47d98de0)
    at /home/bjacob/mozilla-central/parser/html/nsHtml5TreeOpExecutor.cpp:726
#23 0x00007f9c61883e6e in nsHtml5TreeOpExecutor::RunFlushLoop (this=
    0x7f9c495b6880)
    at /home/bjacob/mozilla-central/parser/html/nsHtml5TreeOpExecutor.cpp:521
#24 0x00007f9c618855fe in nsHtml5ExecutorReflusher::Run (this=0x7f9c47d0dcc0)
    at /home/bjacob/mozilla-central/parser/html/nsHtml5TreeOpExecutor.cpp:90
#25 0x00007f9c623e30c3 in nsThread::ProcessNextEvent (this=0x7f9c5e838d70, 
    mayWait=0, result=0x7fff8a647dac)
    at /home/bjacob/mozilla-central/xpcom/threads/nsThread.cpp:547
#26 0x00007f9c6236fb11 in NS_ProcessNextEvent_P (thread=0x7f9c5e838d70, 
    mayWait=0) at nsThreadUtils.cpp:250
#27 0x00007f9c6220d35a in mozilla::ipc::MessagePump::Run (this=0x7f9c5e8af740, 
    aDelegate=0x7f9c5e8da1c0)
    at /home/bjacob/mozilla-central/ipc/glue/MessagePump.cpp:118
#28 0x00007f9c62451da9 in MessageLoop::RunInternal (this=0x7f9c5e8da1c0)
    at /home/bjacob/mozilla-central/ipc/chromium/src/base/message_loop.cc:219
#29 0x00007f9c62451d2e in MessageLoop::RunHandler (this=0x7f9c5e8da1c0)
    at /home/bjacob/mozilla-central/ipc/chromium/src/base/message_loop.cc:202
#30 0x00007f9c62451cbf in MessageLoop::Run (this=0x7f9c5e8da1c0)
    at /home/bjacob/mozilla-central/ipc/chromium/src/base/message_loop.cc:176
#31 0x00007f9c620b1fb5 in nsBaseAppShell::Run (this=0x7f9c56ee2a20)
    at /home/bjacob/mozilla-central/widget/src/xpwidgets/nsBaseAppShell.cpp:175
#32 0x00007f9c61e06b89 in nsAppStartup::Run (this=0x7f9c547b5560)
    at /home/bjacob/mozilla-central/toolkit/components/startup/src/nsAppStartup.cpp:191
#33 0x00007f9c60db1e2f in XRE_main (argc=4, argv=0x7fff8a648a08, aAppData=
    0x7f9c5e8250f0)


Any idea?
Attachment #463678 - Flags: review?(vladimir)
blocking2.0: --- → ?
blocking2.0: ? → beta5+
Here is the assertion message:

Assertion failure: LIR type error (start of writer pipeline): arg 1 of 'eqi' is 'callq' which has type int64 (expected int32): 0 (/home/bjacob/mozilla-central/js/src/nanojit/LIR.cpp:2834)
Depends on: 585714
Trying to reproduce.  Could you either rebase this patch or tell me which cset to apply it onto?  After removing two trivial conflicts, I still get this compiler error:

/Volumes/Storage/tm/content/canvas/src/WebGLContextGL.cpp: In member function 'virtual nsresult mozilla::WebGLContext::TexParameterf(WebGLenum, WebGLenum, WebGLfloat)':
/Volumes/Storage/tm/content/canvas/src/WebGLContextGL.cpp:1766: error: 'NativeJSContext' was not declared in this scope
Right, I forgot to mention, this applies on top of the patch in bug 584840. Anyway, don't bother about this: I am attaching to bug 585714 a combined patch against TM.
This variant of the patch keeps the webgl quickstubbing blacklist, so we don't crash because of bug 585714.
Attachment #465436 - Flags: review?(vladimir)
http://hg.mozilla.org/mozilla-central/rev/33a6231b3e80
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Depends on: 621809
You need to log in before you can comment on or make changes to this bug.