Skip to content

Instantly share code, notes, and snippets.

@rednaxelafx
rednaxelafx / .hotspot_compiler
Created March 6, 2012 13:18
Example (XS) of adding an intrinsic method to HotSpot C2. Patch against HS20-b12
exclude Main main
dontinline Main doTest
compileonly Main doTest
compileonly FxIntrinsics *
diff --git a/Source/JavaScriptCore/runtime/ArrayPrototype.cpp b/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
index 818895c..4b1278a 100644
--- a/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
@@ -383,7 +383,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncJoin(ExecState* exec)
UString separator;
if (!exec->argument(0).isUndefined())
- separator = exec->argument(0).toString(exec)->value(exec);
+ separator = fastJSValuetoUString(exec->argument(0), exec);
@rednaxelafx
rednaxelafx / StackOverflowCrashDemo.h
Created May 2, 2012 06:27
demo of a Java-level stack overflow causing a native crash
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class StackOverflowCrashDemo */
#ifndef _Included_StackOverflowCrashDemo
#define _Included_StackOverflowCrashDemo
#ifdef __cplusplus
extern "C" {
#endif
/*
@rednaxelafx
rednaxelafx / java_error_28522.short.extra.log
Created May 3, 2012 09:05
A HotSpot crash log example of a crash caused by a bug in the C2 compiler (7070134)
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00002aaf0d11c031, pid=28522, tid=1104951616
#
# JRE version: 6.0_23-b05
# Java VM: Java HotSpot(TM) 64-Bit Server VM (19.0-b09 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x593031]
#