Skip to content

Instantly share code, notes, and snippets.

View mgaudet's full-sized avatar

Matthew Gaudet mgaudet

View GitHub Profile
@mgaudet
mgaudet / gist:7947377
Created December 13, 2013 16:55
Bug Report 15656765
Summary:
In iOS6 I could select text, and then open a bookmarklet (like this one for example: https://bitbucket.org/mgaudet/dayonebookmarklet/src/1062388c8320f72ca099f4e684a9d9822d7e905c/dayone.html?at=master) which grabbed the text using window.getSelection().
However, it seems in iOS7, any action to invoke a bookmarklet deselects the text.
Steps to Reproduce:
1. Have a bookmarklet which uses window.getSelection()
2. Select Text
3. Try to invoke bookmarlet
@mgaudet
mgaudet / summary.txt
Created November 10, 2016 14:41
Summary of PVS Studio errors and warning on the OMR project from https://github.com/eclipse/omr/issues/413
Errors: 321
Error code : Number of errors : Summary of error : Additional info
V730 : 111 : Not all members of a class are initialized inside the constructor : Mostly in compiler and gc
V595 : 48 : Pointer was utilized before it was verified against nullptr
V614 : 13 : Potentially uninitialized variable used : Mostly in compiler/ilgen
V542 : 13 : odd type cast: 'short' to 'unsigned char *' : compiler/x/codegen
V522 : 13 : Dereferencing of the null pointer might take place : Mostly in compiler/optimizer
V575 : 12 : Null pointer passed into function : port and /thread (unix)
V501 : 12 : Identical sub-expressions to the left and right of an operator
@mgaudet
mgaudet / 0001-Revert.patch
Created December 5, 2016 14:41
Revert SIGABRT handler in Ruby+OMR Preview
From 595dfc0c2b55e5b5da418c4f80d4922817822b74 Mon Sep 17 00:00:00 2001
From: Matthew Gaudet <magaudet@ca.ibm.com>
Date: Mon, 5 Dec 2016 09:38:57 -0500
Subject: [PATCH] Revert "Register a handler for sigabrt."
---
signal.c | 23 -----------------------
1 file changed, 23 deletions(-)
diff --git a/signal.c b/signal.c
@mgaudet
mgaudet / Trace.log
Created December 15, 2017 02:29
A Testarossa Trace Log for java/lang/String.hashCode()I
<?xml version="1.0" standalone="no"?>
<jitlog>
<!--
MULTIPLE LOG FILES MAY EXIST
Please check for ADDITIONAL log files named: logFile.1 logFile.2 logFile.3 logFile.4 logFile.5 logFile.6
-->
<compile
method="java/lang/String.hashCode()I"
hotness="warm"
isProfilingCompile=0>
@mgaudet
mgaudet / Verbose.log
Created December 15, 2017 15:05
Gathering a Testarossa Verbose Log
$ java -Xjit:traceIlGen,log=logFile,verbose -version
#INFO: _______________________________________
#INFO: Version Information:
#INFO: JIT Level - 292f272
#INFO: JVM Level - 20171027_36
#INFO: GC Level - 292f272
#INFO:
#INFO: Processor Information:
#INFO: Platform Info:X86 Intel P6
@mgaudet
mgaudet / Verbose.log
Created December 15, 2017 15:07
Gathering a Testarossa Verbose Log
$ java -Xjit:traceIlGen,log=logFile,verbose -version
#INFO: _______________________________________
#INFO: Version Information:
#INFO: JIT Level - 292f272
#INFO: JVM Level - 20171027_36
#INFO: GC Level - 292f272
#INFO:
#INFO: Processor Information:
#INFO: Platform Info:X86 Intel P6
0x2b872bbb5456: testl %edx, %edx ; branchTest32 (the test)
0x2b872bbb5458: jne 0x2b872bbb546d ; branchTest32 (the jump to true)
0x2b872bbb545e: movabsq $0x37c1c9d258a0, %rax ; movPtr
0x2b872bbb5468: jmp 0x2b872bbb5477 ; jump done
true: 0x2b872bbb546d: movabsq $0x37c1c9d27480, %rax ; movPtr
done: 0x2b872bbb5477: <unrelated instruction>
@mgaudet
mgaudet / FunctionAllocations.md
Created May 24, 2019 18:39
Where are Functions allocated before the function boxes

FunctionNode* Parser<FullParseHandler, Unit>::standaloneFunction

  • Has a Function argument, Called from
  • FunctionNode* frontend::StandaloneFunctionCompiler<Unit>::parse which has a function argument, called from
  • static bool CompileStandaloneFunction which has a function argument. Called from
    • bool frontend::CompileStandaloneGenerator
    • bool frontend::CompileStandaloneAsyncFunction
    • bool frontend::CompileStandaloneAsyncGenerator
      • All of the above CompileStandAlones, plus the below CompileStandAloneFunction are called from CreateDynamicFunction: the function is allocated there. The above three are -only- called from CreateDynamicFunction.
  • bool frontend::CompileStandaloneFunction which has a function argument. Called from
@mgaudet
mgaudet / Example.md
Created May 22, 2020 21:12
Used Name tracker example

Example 2: Shadowing and closing over.

Remember: Pairs are (ScriptNum, ScopeNum)

// Script 1
// Scope 1
var x = 1;                              // Declared(1) = [x];
function f() // Script 2
{ // Scope 2
$ ../../../mach run run.js # Interpreter, CacheIR, Baseline, Ion: 34252 (3.5x)
$ ../../../mach run --no-ion run.js # Interpreter, CacheIR, Baseline: 9887 (2.0x)
$ ../../../mach run --no-ion --no-baseline --cache-ir-stubs=on run.js # Interpreter, CacheIR: 4890 (6.6x)
$ ../../../mach run --no-ion --no-baseline --cache-ir-stubs=off run.js # Interpreter: 739
MOZCONFIG:
ac_add_options --enable-application=js
ac_add_options --enable-optimize