Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthew Gaudet mgaudet

View GitHub Profile
@mgaudet
mgaudet / Example.md
Created May 22, 2020
Used Name tracker example
View Example.md

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
@mgaudet
mgaudet / FunctionAllocations.md
Created May 24, 2019
Where are Functions allocated before the function boxes
View FunctionAllocations.md

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
View disassembly
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 / Verbose.log
Created Dec 15, 2017
Gathering a Testarossa Verbose Log
View 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 Dec 15, 2017
Gathering a Testarossa Verbose Log
View 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 / Trace.log
Created Dec 15, 2017
A Testarossa Trace Log for java/lang/String.hashCode()I
View Trace.log
<?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 / 0001-Revert.patch
Created Dec 5, 2016
Revert SIGABRT handler in Ruby+OMR Preview
View 0001-Revert.patch
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 / summary.txt
Created Nov 10, 2016
Summary of PVS Studio errors and warning on the OMR project from https://github.com/eclipse/omr/issues/413
View summary.txt
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 / gist:7947377
Created Dec 13, 2013
Bug Report 15656765
View gist:7947377
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
You can’t perform that action at this time.