Building V8 for ARMv6 (Raspberry Pi), got illegal instruction (movw)

585 views
Skip to first unread message

Dirk Grabbert

unread,
Jul 17, 2014, 12:04:08 PM7/17/14
to v8-u...@googlegroups.com
I'm trying to build V8 for the Raspberry Pi (toolchain from the archlinuxarm website, nodejs works fine). Buildprocess works without any errors, but trying to execute the shell or d8 brings up an illegal instruction. GDB shows that it's "movw".

To build I've exported CC, CXX, LINK, AR and LD and then run "make snapshot=off i18nsupport=off armv7=false armfpu=vfp2 arm.release -j5" (or armfpu=vfp, there is no change in the output).

Ross McIlroy

unread,
Jul 18, 2014, 11:37:13 AM7/18/14
to v8-u...@googlegroups.com, dirk.g...@gmail.com
I don't have an armv6 device to test on here, but I tried with a simulator build with added asserts in Assembler::movw/movt to ensure that they aren't emitted when targeting armv6 and these asserts didn't trigger, so I'm not sure where the movw instruction is being emitted.

Could you let me know the exact version / revision of V8 you are building and the stack trace generated by gdb?

Cheers,
Ross
 
On 17 July 2014 17:04, Dirk Grabbert <dirk.g...@gmail.com> wrote:
I'm trying to build V8 for the Raspberry Pi (toolchain from the archlinuxarm website, nodejs works fine). Buildprocess works without any errors, but trying to execute the shell or d8 brings up an illegal instruction. GDB shows that it's "movw".
To build I've exported CC, CXX, LINK, AR and LD and then run "make snapshot=off i18nsupport=off armv7=false armfpu=vfp2 arm.release -j5" (or armfpu=vfp, there is no change in the output).
-- 
-- 
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout

Dirk Grabbert

unread,
Jul 19, 2014, 1:45:14 PM7/19/14
to v8-u...@googlegroups.com, dirk.g...@gmail.com
Great thx for your respond.

I'm using the version from git (currently "9ac5e7f"), but I've also tried older versions. I've dumped the shell and all the other created object files, didn't find any movw instruction there. I don't know why it crashs caused by this instruction neither where it comes from. Maybe it is generated by some javascript code for the v8 example shell?

I'm not at home / work at the moment, so I'm going to post the stack trace tomorrow evening or monday morning.

Dirk Grabbert

unread,
Jul 21, 2014, 3:12:34 AM7/21/14
to v8-u...@googlegroups.com, dirk.g...@gmail.com
Here is a screenshot of gdb.

Cheers,
Dirk.

Am Freitag, 18. Juli 2014 17:37:13 UTC+2 schrieb Ross McIlroy:

Dirk Grabbert

unread,
Jul 21, 2014, 5:00:46 AM7/21/14
to v8-u...@googlegroups.com, dirk.g...@gmail.com
This is the line I'm using to find any "movw" in the objdump of the shell:

arm-unknown-linux-gnueabihf-objdump -d out/arm.release/shell | grep -i movw

Got this output:

0006e738 <_ZNK2v88internal11Instruction18ImmedMovwMovtValueEv>:
   6eba4: eb09774c bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
   6f060: eb09761d bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
   6f1e4: eb0975bc bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
   6f28c: eb097592 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
   6f2cc: eb097582 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
   6f39c: eb09754e bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
   6f45c: eb09751e bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
   6f7ec: eb09743a bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
   6f82c: eb09742a bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
   76854: eb095820 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
   76868: ebffdfb2 bl 6e738 <_ZNK2v88internal11Instruction18ImmedMovwMovtValueEv>
   76874: ebffdfaf bl 6e738 <_ZNK2v88internal11Instruction18ImmedMovwMovtValueEv>
   76894: eb095810 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
   768a8: ebffdfa2 bl 6e738 <_ZNK2v88internal11Instruction18ImmedMovwMovtValueEv>
   768b4: ebffdf9f bl 6e738 <_ZNK2v88internal11Instruction18ImmedMovwMovtValueEv>
   769dc: eb0957be bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
   769ec: ebffdf51 bl 6e738 <_ZNK2v88internal11Instruction18ImmedMovwMovtValueEv>
   769f8: ebffdf4e bl 6e738 <_ZNK2v88internal11Instruction18ImmedMovwMovtValueEv>
   7724c: eb0955a2 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
   77260: ebffdd34 bl 6e738 <_ZNK2v88internal11Instruction18ImmedMovwMovtValueEv>
   77274: ebffdd2f bl 6e738 <_ZNK2v88internal11Instruction18ImmedMovwMovtValueEv>
   77590: eb0954d1 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
   775a8: ebffdc62 bl 6e738 <_ZNK2v88internal11Instruction18ImmedMovwMovtValueEv>
   775bc: ebffdc5d bl 6e738 <_ZNK2v88internal11Instruction18ImmedMovwMovtValueEv>
  151b70: eb05eb59 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  151df4: eb05eab8 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  152c44: eb05e724 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  152c80: eb05e715 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  152dd4: eb05e6c0 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  152e10: eb05e6b1 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  152ef0: eb05e679 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  153128: eb05e5eb bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  153164: eb05e5dc bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1533b0: eb05e549 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1533ec: eb05e53a bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  153750: eb05e461 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1537a8: eb05e44b bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  15385c: eb05e41e bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  153898: eb05e40f bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1539d4: eb05e3c0 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  153a10: eb05e3b1 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  153b4c: eb05e362 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  153b88: eb05e353 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  153cb4: eb05e308 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  153cf0: eb05e2f9 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1541c0: eb05e1c5 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1541fc: eb05e1b6 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1559f4: eb05dbb8 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  155a30: eb05dba9 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  155b10: eb05db71 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1587d8: eb05d03f bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  159a98: eb05cb8f bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  159ad4: eb05cb80 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  159c08: eb05cb33 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  159fc4: eb05ca44 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  15a000: eb05ca35 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  15a44c: eb05c922 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  15a488: eb05c913 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  15b91c: eb05c3ee bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  15b958: eb05c3df bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  16b2e8: eb05857b bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  16b3d8: eb05853f bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  16b6d8: eb05847f bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  195408: eb04dd33 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  19545c: eb04dd1e bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  19b1ec: eb04c5ba bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  19b23c: eb04c5a6 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1af014: eb047630 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1af078: eb047617 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1af174: eb0475d8 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1af1e0: eb0475bd bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1c65e0: eb0418bd bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1c66e8: eb04187b bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1c6aa4: eb04178c bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1cf698: eb03f48f bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1cf6d4: eb03f480 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1cf754: eb03f460 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1cf884: eb03f414 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1da4dc: eb03c8fe bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1da7e8: eb03c83b bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1da82c: eb03c82a bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1da894: eb03c810 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1da8d8: eb03c7ff bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1da928: eb03c7eb bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1da968: eb03c7db bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1da9b0: eb03c7c9 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1dac94: eb03c710 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1dad9c: eb03c6ce bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1dadd0: eb03c6c1 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1daf38: eb03c667 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1db0b0: eb03c609 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1db160: eb03c5dd bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1db2b0: eb03c589 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1db410: eb03c531 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1dbd20: eb03c2ed bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  1dbda8: eb03c2cb bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  296d94: eb00d6d0 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  2977e8: eb00d43b bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  297824: eb00d42c bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  2978d0: eb00d401 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  2978f8: eb00d3f7 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  29928c: eb00cd92 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  29934c: eb00cd62 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  2995e8: eb00ccbb bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  2996a8: eb00cc8b bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  2b3d28: eb0062eb bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
002cc8dc <_ZN2v88internal9Assembler6IsMovWEi>:
002d2eac <_ZN2v88internal9Assembler4movwENS0_8RegisterEjNS0_9ConditionE>:
  2d2ed4: 0a000009 beq 2d2f00 <_ZN2v88internal9Assembler4movwENS0_8RegisterEjNS0_9ConditionE+0x54>
  2d2ed8: e59f2038 ldr r2, [pc, #56] ; 2d2f18 <_ZN2v88internal9Assembler4movwENS0_8RegisterEjNS0_9ConditionE+0x6c>
  2d2f14: eaffffef b 2d2ed8 <_ZN2v88internal9Assembler4movwENS0_8RegisterEjNS0_9ConditionE+0x2c>
002f3534 <_ZN2v88internal7Decoder13PrintMovwMovtEPNS0_11InstructionE>:
  2f357c: 0a00000b beq 2f35b0 <_ZN2v88internal7Decoder13PrintMovwMovtEPNS0_11InstructionE+0x7c>
  2f3590: da000007 ble 2f35b4 <_ZN2v88internal7Decoder13PrintMovwMovtEPNS0_11InstructionE+0x80>
  2f35ac: 1a000011 bne 2f35f8 <_ZN2v88internal7Decoder13PrintMovwMovtEPNS0_11InstructionE+0xc4>
  2f35d8: e59f2030 ldr r2, [pc, #48] ; 2f3610 <_ZN2v88internal7Decoder13PrintMovwMovtEPNS0_11InstructionE+0xdc>
  2f3608: baffffe1 blt 2f3594 <_ZN2v88internal7Decoder13PrintMovwMovtEPNS0_11InstructionE+0x60>
  2f360c: eaffffe8 b 2f35b4 <_ZN2v88internal7Decoder13PrintMovwMovtEPNS0_11InstructionE+0x80>
  2f3e18: ebfffdc5 bl 2f3534 <_ZN2v88internal7Decoder13PrintMovwMovtEPNS0_11InstructionE>
  30e140: ebfef9e5 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  30f18c: ebfef5d2 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  3330a8: ebfe7f7f bl 2d2eac <_ZN2v88internal9Assembler4movwENS0_8RegisterEjNS0_9ConditionE>
  3671bc: ebfd95c6 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  37ed6c: ebfd36da bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  37edf0: ebfd36b9 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  37ee38: ebfd36a7 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  37ee80: ebfd3695 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  37eedc: ebfd367e bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  37eff4: ebfd3638 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>
  37f130: ebfd35e9 bl 2cc8dc <_ZN2v88internal9Assembler6IsMovWEi>


 

Ross McIlroy

unread,
Jul 21, 2014, 12:30:51 PM7/21/14
to v8-u...@googlegroups.com, dirk.g...@gmail.com
Hi Dirk,

The stack trace looks like the movw is being emitted in generated code.  Could you try again with a debug build of V8 which includes r22512 (https://codereview.chromium.org/402923002/) - this should fail with an ASSERT error if V8 tries to emit a movw instruction on an armv6 target.

If this doesn't throw an assert, then it looks like the runtime probing is incorrectly concluding that the device is capable of running armv7 code even although V8 was only compiled for armv6.  Could you send the output of running the following commands in gdb at the point of the crash:
  p v8::internal::CpuFeatures::PrintFeatures()
and
  p v8::internal::CpuFeatures::PrintTarget()

Cheers,
Ross



--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ross McIlroy

unread,
Jul 21, 2014, 12:34:08 PM7/21/14
to Ross McIlroy, v8-u...@googlegroups.com, Dirk Grabbert
Actually, Rodolph just pointed out that running: d8 --help | head -n 2 will output the same information as v8::internal::CpuFeatures::PrintFeatures/PrintTarget, so you should be able to do this instead of the gdb commands I suggested in the last message.

Cheers,
Ross

Dirk Grabbert

unread,
Jul 22, 2014, 3:35:36 AM7/22/14
to v8-u...@googlegroups.com, rmci...@chromium.org, dirk.g...@gmail.com
I'm on the "master" now. Don't get an assert.

This is the output of ./d8 --help | head -n 2:

target arm v6 vfp2 hard
ARMv7=1 VFP3=0 VFP32DREGS=0 NEON=0 SUDIV=0 UNALIGNED_ACCESSES=1 MOVW_MOVT_IMMEDIATE_LOADS=0 USE_EABI_HARDFLOAT=1

But I've already done this with branch "9ac5e7f" and got this output:

target arm v6 vfp2 hard
ARMv7=0 VFP3=0 VFP32DREGS=0 NEON=0 SUDIV=0 UNALIGNED_ACCESSES=0 MOVW_MOVT_IMMEDIATE_LOADS=0 USE_EABI_HARDFLOAT=1
 

Rodolph Perfetta

unread,
Jul 22, 2014, 3:47:01 AM7/22/14
to v8-u...@googlegroups.com
Raspberry Pi wrongly report itself as an ARMv7 core but V8 has some code to correct that. Could you give us your /proc/cpuinfo ?

Dirk Grabbert

unread,
Jul 22, 2014, 3:53:09 AM7/22/14
to v8-u...@googlegroups.com
[root@alarmpi ~]# cat /proc/cpuinfo 
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
Features        : swp half thumb fastmult vfp edsp java tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2708
Revision        : 000e
Serial          : 
...

Rodolph Perfetta

unread,
Jul 22, 2014, 3:59:28 AM7/22/14
to v8-u...@googlegroups.com
So V8 is looking for v6l in the "processor" field and here is is in the "model name" entry. Which kernel version is this?

In the mean time adding --noenable-armv7 to your command line should allow you to run your code.


--

Dirk Grabbert

unread,
Jul 22, 2014, 4:03:42 AM7/22/14
to v8-u...@googlegroups.com
Great, it works with this command line, thx.

Kernel is:
Linux alarmpi 3.12.24-1-ARCH #1 PREEMPT Thu Jul 10 23:57:15 MDT 2014 armv6l GNU/Linux
...

Dirk Grabbert

unread,
Jul 22, 2014, 5:52:44 AM7/22/14
to v8-u...@googlegroups.com
I've tried that with raspbian as well. It seems to be a change in /proc/cpuinfo after a kernelupdate.

With kernel 3.6.11+ I got this output:

Processor       : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 697.95
Features        : swp half thumb fastmult vfp edsp java tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2708
Revision        : 000e
Serial          :


After updating the kernel it looks like the previous posted output.


Am Dienstag, 22. Juli 2014 09:59:28 UTC+2 schrieb Rodolph Perfetta:
...

Dirk Grabbert

unread,
Jul 22, 2014, 10:08:58 AM7/22/14
to v8-u...@googlegroups.com
Ok, I'm able to start the example shell right now. But I got the next problem.

Trying to run a js-script brings up an illegal instruction caused by "mls". I think it's generated by the JIT, right?

The script I'm trying to run is a "port" of the dhrystone test (source: http://jsperf.com/pystone-js):

var LOOPS = 500000;

var Ident1 = 1,
    Ident2 = 2,
    Ident3 = 3,
    Ident4 = 4,
    Ident5 = 5;

var TRUE = 1,
FALSE = 0;

var IntGlob = 0;
var BoolGlob = FALSE;
var Char1Glob = '\0';
var Char2Glob = '\0';
var Array1Glob = new Array(51);

for (var i = 0; i < Array1Glob.length; ++i) {
  Array1Glob[i] = 0
}

var Array2Glob = Array1Glob.map(function(n) {
return Array1Glob.slice();
});

var PtrGlb = null;
var PtrGlbNext = null;

var strings = {
someString:"DHRYSTONE PROGRAM, SOME STRING",
fstString:"DHRYSTONE PROGRAM, 1'ST STRING",
sndString:"DHRYSTONE PROGRAM, 2'ND STRING"
};

function main(){
Proc0();
}

function Record(PtrComp, Discr, EnumComp, IntComp, StringComp) {
  this.PtrComp = PtrComp || null;
  this.Discr = Discr || 0;
  this.EnumComp = EnumComp || 0;
  this.IntComp = IntComp || 0;
  this.StringComp = StringComp || 0;
}

function structassign(d,s){
d.PtrComp = s.PtrComp;
d.Discr = s.Discr;
d.EnumComp = s.EnumComp;
d.IntComp = s.IntComp;
d.StringComp = s.StringComp;
}

function clock(){
return new Date().valueOf() / 1000.0
}

function Proc0(){
var CharIndex;
var starttime, benchtime, nulltime;

var starttime = clock();
for(var i = 0; i < LOOPS; ++i);
nulltime = clock() - starttime;

PtrGlbNext = new Record();
PtrGlb = new Record();
PtrGlb.PtrComp = PtrGlbNext;
PtrGlb.Discr = Ident1;
PtrGlb.EnumComp = Ident3;
PtrGlb.IntComp = 40;
PtrGlb.StringComp = "DHRYSTONE PROGRAM, SOME STRING"; // im Original wird hier ein strcpy angewandt
var String1Loc = "DHRYSTONE PROGRAM, 1'ST STRING"; 

Array2Glob[8][7] = 10;

/* start timer */
starttime = clock();
for(var i = 0; i < LOOPS; ++i){
Proc5();
Proc4();
IntLoc1 = 2;
IntLoc2 = 3;
var String2Loc = "DHRYSTONE PROGRAM, 2'ND STRING";  // im Original wird hier ein strcpy angewandt
var EnumLoc = Ident2;
BoolGlob = !Func2(String1Loc, String2Loc);

while(IntLoc1 < IntLoc2){
IntLoc3 = 5 * IntLoc1 - IntLoc2;
Proc7(IntLoc1, IntLoc2, IntLoc3);
++IntLoc1;
}

Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3);
Proc1(PtrGlb);

   for (CharIndex = 'A'; CharIndex <= Char2Glob; CharIndex = String.fromCharCode(CharIndex.charCodeAt(0) + 1)){ // string to int to string convertion required by js
if (EnumLoc == Func1(CharIndex, 'C'))
EnumLoc = Proc6(Ident1);
}

   IntLoc3 = IntLoc2 * IntLoc1;
   IntLoc2 = IntLoc3 / IntLoc1;
   IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1;
   IntLoc1 = Proc2(IntLoc1); // nicht by-reference ?
}

benchtime = clock() - starttime - nulltime;
print("JsPystone() time for " + LOOPS + " passes = " + benchtime);
print("This machine benchmarks at " +  (LOOPS / benchtime) + " pystones/second");
// console.log("JsPystone() time for " + LOOPS + " passes = " + benchtime);
// console.log("This machine benchmarks at " +  (LOOPS / benchtime) + " pystones/second");
}

function Proc1(PtrParIn){
var NextRecord = PtrParIn.PtrComp;

structassign(NextRecord, PtrGlb);
PtrParIn.IntComp = 5;
  NextRecord.IntComp = PtrParIn.IntComp;
  NextRecord.PtrComp = PtrParIn.PtrComp;
  Proc3(NextRecord.PtrComp);

  if(NextRecord.PtrComp == Ident1){
  NextRecord.IntComp = 6;
  NextRecord.EnumComp = Proc6(PtrParIn.EnumComp);
  NextRecord.PtrComp = PtrGlb.PtrComp;
  NextRecord.IntComp = Proc7(NextRecord.IntComp, 10);
  } else structassign(PtrParIn, NextRecord);
 
  NextRecord.PtrComp = null;
 
  return PtrParIn;
}

function Proc2(IntParIO){
var IntLoc, EnumLoc;

IntLoc = IntParIO + 10;
for(;;){
if (Char1Glob == 'A'){
--IntLoc;
IntParIO = IntLoc - IntGlob;
EnumLoc = Ident1;
}
if (EnumLoc == Ident1)
break;
}
}

function Proc3(PtrParOut){
if (PtrGlb !== null) {
    PtrParOut = PtrGlb.PtrComp;
  } else {
    IntGlob = 100;
  }
  PtrGlb.IntComp = Proc7(10, IntGlob);
  return PtrParOut;
}

function Proc4(){
var BoolLoc = Char1Glob == 'A';
BoolLoc |= BoolGlob;
Char2Glob = 'B';
}

function Proc5(){
Char1Glob = 'A';
BoolGlob = FALSE;
}

function Proc6(EnumParIn, EnumParOut){
var EnumParOut = EnumParIn;
if(!Func3(EnumParIn))
EnumParOut = Ident4;
switch (EnumParIn){
case Ident1:
EnumParOut = Ident1;
break;
case Ident2:
if (IntGlob > 100){
EnumParOut = Ident1;
} else EnumParOut = Ident4;
break;
case Ident3:
EnumParOut = Ident2;
break;
case Ident4:
break;
case Ident5:
EnumParOut = Ident3;
}
return EnumParOut;
}

function Proc7(IntParI1, IntParI2, IntParOut){
var IntLoc = IntParI1 + 2;
IntParOut = IntParI2 + IntLoc;

return IntParOut;
}

function Proc8(Array1Par, Array2Par, IntParI1, IntParI2) {
  var IntLoc = IntParI1 + 5;
  Array1Par[IntLoc] = IntParI2;
  Array1Par[IntLoc + 1] = Array1Par[IntLoc];
  Array1Par[IntLoc + 30] = IntLoc;
  // for IntIndex in range(IntLoc, IntLoc+2):
  for (var IntIndex = IntLoc; IntIndex < IntLoc + 2; ++IntIndex) {
    Array2Par[IntLoc][IntIndex] = IntLoc;
  }
  Array2Par[IntLoc][IntLoc - 1] = Array2Par[IntLoc][IntLoc - 1] + 1;
  Array2Par[IntLoc + 20][IntLoc] = Array1Par[IntLoc];
  IntGlob = 5;
}

function Func1(CharPar1, CharPar2) {
  var CharLoc1 = CharPar1;
  var CharLoc2 = CharLoc1;
  if (CharLoc2 != CharPar2) {
    return Ident1;
  } else {
    return Ident2;
  }
}

function Func2(StrParI1, StrParI2) {
  var IntLoc = 1;
  while (IntLoc <= 1) {
    if (Func1(StrParI1[IntLoc], StrParI2[IntLoc + 1]) == Ident1) {
      var CharLoc = 'A';
      IntLoc = IntLoc + 1;
    }
  }
  if (CharLoc >= 'W' && CharLoc <= 'Z') {
    IntLoc = 7;
  }
  if (CharLoc == 'X') {
    return TRUE;
  } else {
    if (StrParI1 > StrParI2) {
      IntLoc = IntLoc + 7
      return TRUE;
    } else {
      return FALSE;
    }
  }
}

function Func3(EnumParIn) {
  var EnumLoc = EnumParIn;
  if (EnumLoc == Ident3) return TRUE;
  return FALSE;
}

main();


Rodolph Perfetta

unread,
Jul 22, 2014, 10:34:18 AM7/22/14
to v8-u...@googlegroups.com
I sounds like auto detection is failing again, override it: --noenable-mls should do it.

I can't push a patch right now so keep reporting any issues.

Thanks,
Rodolph.


Dirk Grabbert

unread,
Jul 28, 2014, 4:31:36 AM7/28/14
to v8-u...@googlegroups.com
Thanks for help again. I didn't run into more problems until now.

It seems, that /proc/cpuinfo changed since kernel 3.9.3 for the ARM.
Reply all
Reply to author
Forward
0 new messages