Closed Bug 1388005 Opened 7 years ago Closed 7 years ago

js/src/jit/CodeGenerator.cpp:11146:18: error: no member named 'writeCodePointer' in 'js::jit::MacroAssembler'

Categories

(Core :: JavaScript Engine: JIT, defect)

57 Branch
Other
Unspecified
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox-esr52 --- unaffected
firefox55 --- unaffected
firefox56 --- fixed
firefox57 --- fixed

People

(Reporter: black.balamut, Assigned: arai)

References

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36

Steps to reproduce:

Mac OS X 10.12.5, Xcode 8.0, branch: latest default from hg (sha: bb8de16ce00c).

I'm trying to build SpiderMonkey as library for iOS (without jit, I want to use it my game as js engine). 
I do:

CXXFLAGS+=-std=gnu++11 ../configure --target=armv7-apple-darwin --with-ios-sdk=iphoneos10.0 --enable-optimize=-O0 --disable-ion
make



Actual results:

In file included from /Users/idenys/work/Nekki/mozilla-central/js/src/build_ios_OPT.OBJ/js/src/Unified_cpp_js_src11.cpp:47:
/Users/idenys/work/Nekki/mozilla-central/js/src/jit/CodeGenerator.cpp:11146:18: error: no member named 'writeCodePointer' in 'js::jit::MacroAssembler'
            masm.writeCodePointer(cl.patchAt());
            ~~~~ ^
/Users/idenys/work/Nekki/mozilla-central/js/src/jit/CodeGenerator.cpp:11172:14: error: no member named 'use' in 'js::jit::MacroAssembler'
        masm.use(jumpTable->start()->target());
        ~~~~ ^
2 errors generated.


Expected results:

Has no errors.
The same issue when building on sparc:

$ /usr/bin/g++ -std=gnu++11 -o Unified_cpp_js_src11.o -c  -I/scratch/firefox/obj-sparc64-sun-solaris2.12/dist/system_wrappers -include /scratch/firefox/config/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DENABLE_BINARYDATA -DENABLE_SIMD -DJS_CACHEIR_SPEW -DENABLE_SHARED_ARRAY_BUFFER -DEXPORT_JS_API -DJS_HAS_CTYPES '-DDLL_PREFIX="lib"' '-DDLL_SUFFIX=".so"' -DMOZ_HAS_MOZGLUE -I/scratch/firefox/js/src -I/scratch/firefox/obj-sparc64-sun-solaris2.12/js/src  -I/scratch/firefox/obj-sparc64-sun-solaris2.12/dist/include  -I/scratch/firefox/obj-sparc64-sun-solaris2.12/dist/include/nspr        -fPIC  -DMOZILLA_CLIENT -include /scratch/firefox/obj-sparc64-sun-solaris2.12/js/src/js-confdefs.h -MD -MP -MF .deps/Unified_cpp_js_src11.o.pp  -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++14-compat -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wformat -fno-rtti -fno-exceptions -fno-math-errno -pthread -pipe  -g -O -fno-omit-frame-pointer   -DFFI_NO_RAW_API -I/usr/lib/sparcv9/libffi-3.2.1/include -Wno-shadow -Werror=format -fno-strict-aliasing  /scratch/firefox/obj-sparc64-sun-solaris2.12/js/src/Unified_cpp_js_src11.cpp

In file included from /scratch/firefox/obj-sparc64-sun-solaris2.12/js/src/Unified_cpp_js_src11.cpp:38:0:
/scratch/firefox/js/src/jit/CodeGenerator.cpp: In member function 'void js::jit::OutOfLineSwitch<tableType>::addTableEntry(js::jit::MacroAssembler&)':
/scratch/firefox/js/src/jit/CodeGenerator.cpp:11113:18: error: 'class js::jit::MacroAssembler' has no member named 'writeCodePointer'
             masm.writeCodePointer(cl.patchAt());
                  ^
/scratch/firefox/js/src/jit/CodeGenerator.cpp: In member function 'void js::jit::CodeGenerator::visitOutOfLineSwitch(js::jit::OutOfLineSwitch<tableType>*)':
/scratch/firefox/js/src/jit/CodeGenerator.cpp:11139:14: error: 'class js::jit::MacroAssembler' has no member named 'use'
         masm.use(jumpTable->start()->target());
              ^
Assignee: nobody → arai.unmht
Status: UNCONFIRMED → ASSIGNED
Component: JavaScript Engine → JavaScript Engine: JIT
Ever confirmed: true
Hardware: Unspecified → Other
Version: Other Branch → 57 Branch
* added definition for writeCodePointer.
 * added |defined(JS_CODEGEN_NONE)| branch to CodeGenerator::visitOutOfLineSwitch that just crashes (where arm also crashes)
 * added |#include "jit/BaselineIC.h"| to IonCacheIRCompiler.cpp,
   for EmitICUnboxedPreBarrier and StoreToTypedArray declaration.
 * enclosed ContextToSP definition with |#ifndef JS_CODEGEN_NONE| in WasmSignalHandlers.cpp, since it's not used and causes warning
 * added |(void) priorOffset| to suppress unused variabe warning

now it compiles with |--enable-warnings-as-errors --disable-ion| options
Attachment #8894836 - Flags: review?(nicolas.b.pierron)
Previous error is gone but I got next one:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk -miphoneos-version-min=8.0 -o Unified_cpp_js_src39.o -c  -fvisibility=hidden -fvisibility-inlines-hidden -DNDEBUG=1 -DTRIMMED=1 -DENABLE_BINARYDATA -DENABLE_SIMD -DJS_CACHEIR_SPEW -DENABLE_SHARED_ARRAY_BUFFER -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/mozilla-central/js/src -I/mozilla-central/js/src/build_ios_OPT.OBJ/js/src  -I/mozilla-central/js/src/build_ios_OPT.OBJ/dist/include          -fPIC  -DMOZILLA_CLIENT -include /mozilla-central/js/src/build_ios_OPT.OBJ/js/src/js-confdefs.h -MD -MP -MF .deps/Unified_cpp_js_src39.o.pp -Qunused-arguments  -Qunused-arguments -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wloop-analysis -Wc++11-compat-pedantic -Wc++14-compat -Wc++14-compat-pedantic -Wc++1z-compat -Wcomma -Wimplicit-fallthrough -Werror=non-literal-null-conversion -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wformat -Wno-gnu-zero-variadic-macro-arguments -Wformat-security -Wno-unknown-warning-option -Wno-return-type-c-linkage -std=gnu++11 -fno-common -stdlib=libc++ -fno-rtti -fno-exceptions -fno-math-errno -pthread -pipe  -g -O0  -Werror -Wno-shadow -Werror=format -fno-strict-aliasing  /mozilla-central/js/src/build_ios_OPT.OBJ/js/src/Unified_cpp_js_src39.cpp
In file included from /mozilla-central/js/src/build_ios_OPT.OBJ/js/src/Unified_cpp_js_src39.cpp:38:
/mozilla-central/js/src/wasm/WasmSignalHandlers.cpp:452:39: error: use of undeclared identifier 'R14_sig'
    return reinterpret_cast<uint8_t*>(LR_sig(context));
                                      ^
/mozilla-central/js/src/wasm/WasmSignalHandlers.cpp:408:20: note: expanded from macro 'LR_sig'
# define LR_sig(p) R14_sig(p)
                   ^
/mozilla-central/js/src/wasm/WasmSignalHandlers.cpp:486:38: error: no member named '__fp' in '__darwin_arm_thread_state'; did you mean '__sp'?
    return (uint8_t*)context->thread.__fp;
                                     ^~~~
                                     __sp
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/mach/arm/_structs.h:51:13: note: '__sp' declared here
        __uint32_t      __sp;           /* Stack pointer r13 */
                        ^
2 errors generated.
looks like it's using unexpected branch in
  https://dxr.mozilla.org/mozilla-central/rev/47248637eafa9a38dade8dc3aa6c4736177c8d8d/js/src/wasm/WasmSignalHandlers.cpp#70-261

also, arm branch in ContextToFP supposes the existence of __fp.
  https://dxr.mozilla.org/mozilla-central/rev/47248637eafa9a38dade8dc3aa6c4736177c8d8d/js/src/wasm/WasmSignalHandlers.cpp#480-492

__fp is presented only in "struct __darwin_arm_thread_state64", but not in "struct __darwin_arm_thread_state"

I cannot build with the way mentioned in comment #0 (ERROR: Don't know how to translate armv7-apple-darwin for rustc).

anyway, I think it's better separating bug, since they are totally different issue than one in the summary
I can confirm that the patch resolves original issue on sparc too.
Original issue is resolved for me too. About second issue I reported new bug #1388338
Comment on attachment 8894836 [details] [diff] [review]
Fix build without Ion.

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

Thanks arai for looking into this issue :)
Attachment #8894836 - Flags: review?(nicolas.b.pierron) → review+
https://hg.mozilla.org/mozilla-central/rev/6fccb118ee9b
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Comment on attachment 8894836 [details] [diff] [review]
Fix build without Ion.

Approval Request Comment
[Feature/Bug causing the regression]: bug 1364908 regression
[User impact if declined]: Broken build on non-JIT architectures e.g., powerpc*, sparc*, s390x
[Is this code covered by automated tests?]: Yes but all archs on automation have JIT enabled. NPOTB otherwise.
[Has the fix been verified in Nightly?]: Yes
[Needs manual test from QE? If yes, steps to reproduce]: No
[List of other uplifts needed for the feature/fix]: None
[Is the change risky?]: No
[Why is the change risky/not risky?]: Can only break build.
[String changes made/needed]: None
Attachment #8894836 - Flags: approval-mozilla-beta?
Comment on attachment 8894836 [details] [diff] [review]
Fix build without Ion.

Fix for a build issue, let's take this for beta 3.
Attachment #8894836 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.