Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 308186831fd1
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0c19e517deda
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Jul 23, 2016

  1. Copy the full SHA
    7cdeae9 View commit details
  2. Copy the full SHA
    859479f View commit details
  3. Copy the full SHA
    0c19e51 View commit details
Showing with 90 additions and 3 deletions.
  1. +81 −0 lib/ruby/truffle/cext/ruby.h
  2. +3 −3 tool/jt.rb
  3. +6 −0 truffle/src/main/c/cext/ruby.c
81 changes: 81 additions & 0 deletions lib/ruby/truffle/cext/ruby.h
Original file line number Diff line number Diff line change
@@ -43,6 +43,87 @@ typedef void* VALUE;

#define NORETURN(X) __attribute__((__noreturn__)) X

// Types

enum ruby_value_type {
RUBY_T_NONE = 0x00,

RUBY_T_OBJECT = 0x01,
RUBY_T_CLASS = 0x02,
RUBY_T_MODULE = 0x03,
RUBY_T_FLOAT = 0x04,
RUBY_T_STRING = 0x05,
RUBY_T_REGEXP = 0x06,
RUBY_T_ARRAY = 0x07,
RUBY_T_HASH = 0x08,
RUBY_T_STRUCT = 0x09,
RUBY_T_BIGNUM = 0x0a,
RUBY_T_FILE = 0x0b,
RUBY_T_DATA = 0x0c,
RUBY_T_MATCH = 0x0d,
RUBY_T_COMPLEX = 0x0e,
RUBY_T_RATIONAL = 0x0f,

RUBY_T_NIL = 0x11,
RUBY_T_TRUE = 0x12,
RUBY_T_FALSE = 0x13,
RUBY_T_SYMBOL = 0x14,
RUBY_T_FIXNUM = 0x15,
RUBY_T_UNDEF = 0x16,

RUBY_T_IMEMO = 0x1a,
RUBY_T_NODE = 0x1b,
RUBY_T_ICLASS = 0x1c,
RUBY_T_ZOMBIE = 0x1d,

RUBY_T_MASK = 0x1f
};

#define T_NONE RUBY_T_NONE
#define T_NIL RUBY_T_NIL
#define T_OBJECT RUBY_T_OBJECT
#define T_CLASS RUBY_T_CLASS
#define T_ICLASS RUBY_T_ICLASS
#define T_MODULE RUBY_T_MODULE
#define T_FLOAT RUBY_T_FLOAT
#define T_STRING RUBY_T_STRING
#define T_REGEXP RUBY_T_REGEXP
#define T_ARRAY RUBY_T_ARRAY
#define T_HASH RUBY_T_HASH
#define T_STRUCT RUBY_T_STRUCT
#define T_BIGNUM RUBY_T_BIGNUM
#define T_FILE RUBY_T_FILE
#define T_FIXNUM RUBY_T_FIXNUM
#define T_TRUE RUBY_T_TRUE
#define T_FALSE RUBY_T_FALSE
#define T_DATA RUBY_T_DATA
#define T_MATCH RUBY_T_MATCH
#define T_SYMBOL RUBY_T_SYMBOL
#define T_RATIONAL RUBY_T_RATIONAL
#define T_COMPLEX RUBY_T_COMPLEX
#define T_IMEMO RUBY_T_IMEMO
#define T_UNDEF RUBY_T_UNDEF
#define T_NODE RUBY_T_NODE
#define T_ZOMBIE RUBY_T_ZOMBIE
#define T_MASK RUBY_T_MASK

typedef struct rb_data_type_struct rb_data_type_t;

struct rb_data_type_struct {
const char *wrap_struct_name;

struct {
void (*dmark)(void *);
void (*dfree)(void *);
size_t (*dsize)(const void *);
void *reserved[2];
} function;

const rb_data_type_t *parent;
void *data;
VALUE flags;
};

// Constants

VALUE get_Qfalse(void);
6 changes: 3 additions & 3 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -502,9 +502,9 @@ def build(*options)
openssl_home = ENV['OPENSSL_HOME'] || '/usr'

unless no_openssl
#cextc "#{JRUBY_DIR}/truffle/src/main/c/openssl",
# '-DRUBY_EXTCONF_H="extconf.h"',
# '-Werror=implicit-function-declaration'
cextc "#{JRUBY_DIR}/truffle/src/main/c/openssl",
'-DRUBY_EXTCONF_H="extconf.h"',
'-Werror=implicit-function-declaration'
end
when nil
mvn env, *maven_options, 'package'
6 changes: 6 additions & 0 deletions truffle/src/main/c/cext/ruby.c
Original file line number Diff line number Diff line change
@@ -18,6 +18,12 @@

#define RUBY_CEXT truffle_import_cached("ruby_cext")

// Types

void rb_check_type(VALUE value, int type) {

}

// Constants

VALUE get_Qfalse() {