Closed Bug 845226 Opened 7 years ago Closed 7 years ago

jsalloc.cpp triggers "jsobj.h:972:17: warning: inline function ‘bool JSObject::isFunction() const’ used but never defined" and similar for ObjectImpl.h's inline function ‘static void js::ObjectImpl::writeBarrierPost(js::ObjectImpl*, void*)’"

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

When building mozilla-inbound, I now get:
{
In file included from js/src/vm/Shape.h:14:0,
                 from js/src/jsscript.h:19,
                 from js/src/vm/SPSProfiler.h:18,
                 from js/src/jscntxt.h:37,
                 from js/src/jsalloc.cpp:9:
js/src/jsobj.h:972:17: warning: inline function ‘bool JSObject::isFunction() const’ used but never defined [enabled by default]


In file included from js/src/jsobj.h:27:0,
                 from js/src/vm/Shape.h:14,
                 from js/src/jsscript.h:19,
                 from js/src/vm/SPSProfiler.h:18,
                 from js/src/jscntxt.h:37,
                 from js/src/jsalloc.cpp:9:
js/src/vm/ObjectImpl.h:1350:24: warning: inline function ‘static void js::ObjectImpl::writeBarrierPost(js::ObjectImpl*, void*)’ used but never defined [enabled by default]
}

Pretty sure this only started happening in the last few days.
I get these same warnings repeated for multiple .cpp files -- jsalloc.cpp,  jscrashreport.cpp, and ThreadPool.cpp so far in my (currently building) local build.
Looks like:
 - jsobjinlines.h provides the impl of isFunction()
 - ObjectImpl-inl.h provides the impl of writeBarrierPost()
hg bisect says this started happening on this cset:
{
changeset:   122775:a04dde344d24
user:        Nicholas D. Matsakis <nmatsakis@mozilla.com>
date:        Tue Feb 19 10:49:33 2013 -0500
summary:     Bug 843656 - move clone-at-callsite to the script r=bhackett
}
Blocks: 843656
I can confirm that the attached patch fixes the build warnings on my machine. (using GCC 4.7)
Attachment #718359 - Flags: review? → review?(wmccloskey)
Comment on attachment 718359 [details] [diff] [review]
Move inline functions into jsscriptinlines.h

Review of attachment 718359 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsscriptinlines.h
@@ +206,5 @@
>      return compartment()->principals;
>  }
>  
> +inline JSFunction *
> +JSScript::originalFunction() const {

The brace should go on its own line.

@@ +213,5 @@
> +    return enclosingScopeOrOriginalFunction_->toFunction();
> +}
> +
> +inline void
> +JSScript::setOriginalFunctionObject(JSObject *fun) {

Same here.
Attachment #718359 - Flags: review?(wmccloskey) → review+
https://hg.mozilla.org/mozilla-central/rev/f246412bcadb
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.