Skip to content

Instantly share code, notes, and snippets.

View evilpie's full-sized avatar

Tom Schuster evilpie

View GitHub Profile
diff --git a/js/src/ion/CodeGenerator.cpp b/js/src/ion/CodeGenerator.cpp
--- a/js/src/ion/CodeGenerator.cpp
+++ b/js/src/ion/CodeGenerator.cpp
@@ -133,16 +133,24 @@ CodeGenerator::visitValueToDouble(LValue
bool
CodeGenerator::visitInt32ToDouble(LInt32ToDouble *lir)
{
masm.convertInt32ToDouble(ToRegister(lir->input()), ToFloatRegister(lir->output()));
return true;
function test (array) {
var i = 0;
for (var a = 0; a < 10; a++) {
for (var x in array) {
i = i + array[x];
}
}
}
var a = new Array(1000);
import hgapi
from bugzilla.agents import BMOAgent
import re
from optparse import OptionParser
# Use this like:
# python hgbzlog.py -c "JavaScript Engine" -r /home/tom/inbound -s 357da346ceb7
parser = OptionParser()
parser.add_option('-c', '--component', help='Limit bugs to certain component.')
<html>
<head>
<link rel="stylesheet" type="text/css" href="test3.php">
</head>
<body>
<span>This is a test</span>
</body>
</html>
@evilpie
evilpie / disassembler.js
Created April 4, 2012 11:51
Disassembler for Notch's 'DCPU-16'
/* See: http://0x10c.com/doc/dcpu-16.txt */
function hex(n) {
return '0x' + n.toString(16);
}
function disassemble (code) {
var PC = 0;
var operand = function (bits) {
@evilpie
evilpie / parser.py
Created January 16, 2012 14:30
Tokenizer, Parser, AST based interpreter
class Token:
ASSIGN = 'assign'
NAME = 'name'
NUMBER = 'number'
PLUS = 'plus'
MINUS = 'minus'
LPARENS = 'lparens'
RPARENS = 'rparens'
DOUBLEDOT = 'doubledot'
@evilpie
evilpie / sort
Created December 12, 2011 19:50
school
/* insertion sort */
function insertion_sort(a) {
for (var i = 1; i < a.length; i++) {
var key = a[i];
var j = i - 1;
while (j >= 0 && a[j] > key) {
a[j + 1] = a[j];
j = j - 1;
@evilpie
evilpie / gist:1179203
Created August 29, 2011 19:43
Boolean vs Int in Javascript
; JavaScript Code : "!a"
movabsq $0xfff9800000000000, %r11 ; type tag of boolean (SpiderMonkey uses a trait of NaN-boxing)
cmpq %r11, %r9 ; compare with type tag of a
jne ((165)) ; if not equal jump to stub
xorl 1, %r15d ; xor value of a with 1, true is value 1 so 1^1 = 0, false is 0 so 1^0 = 1
; JavaScript Code: "a - 1"
movabsq $0xfff8800000000000, %r11 ; type tag of int
cmpq %r11, %r15
jne ((73)) ; jump if not int
@evilpie
evilpie / gist:1149041
Created August 16, 2011 13:12
blabla
so well
var f = function () {};
var bound = f.bind({});
(new bound) instanceof bound;
V = new bound;
bound[[HasInstance]](V);
@evilpie
evilpie / patch.py
Created July 30, 2011 13:43
Filter JavaScript commits from mozilla-inbound
""" Patch utility to apply unified diffs
Brute-force line-by-line non-recursive parsing
Copyright (c) 2008-2011 anatoly techtonik
Available under the terms of MIT license
Project home: http://code.google.com/p/python-patch/