mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix GCC warnings
Mostly unused and uninitialized warnings here and there
This commit is contained in:
parent
9911f486a7
commit
d03b7f77d4
5 changed files with 13 additions and 8 deletions
6
mjit.h
6
mjit.h
|
@ -141,12 +141,10 @@ mjit_exec_slowpath(rb_execution_context_t *ec, const rb_iseq_t *iseq, struct rb_
|
||||||
static inline VALUE
|
static inline VALUE
|
||||||
mjit_exec(rb_execution_context_t *ec)
|
mjit_exec(rb_execution_context_t *ec)
|
||||||
{
|
{
|
||||||
const rb_iseq_t *iseq;
|
const rb_iseq_t *iseq = ec->cfp->iseq;
|
||||||
struct rb_iseq_constant_body *body;
|
struct rb_iseq_constant_body *body = iseq->body;
|
||||||
|
|
||||||
if (mjit_call_p || rb_yjit_enabled_p()) {
|
if (mjit_call_p || rb_yjit_enabled_p()) {
|
||||||
iseq = ec->cfp->iseq;
|
|
||||||
body = iseq->body;
|
|
||||||
body->total_calls++;
|
body->total_calls++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ void cb_align_pos(codeblock_t* cb, uint32_t multiple)
|
||||||
{
|
{
|
||||||
// Compute the pointer modulo the given alignment boundary
|
// Compute the pointer modulo the given alignment boundary
|
||||||
uint8_t* ptr = &cb->mem_block[cb->write_pos];
|
uint8_t* ptr = &cb->mem_block[cb->write_pos];
|
||||||
uint32_t rem = ((uint32_t)ptr) % multiple;
|
uint32_t rem = ((uint32_t)(uintptr_t)ptr) % multiple;
|
||||||
|
|
||||||
// If the pointer is already aligned, stop
|
// If the pointer is already aligned, stop
|
||||||
if (rem == 0)
|
if (rem == 0)
|
||||||
|
|
|
@ -36,7 +36,7 @@ jit_print_loc(jitstate_t* jit, const char* msg)
|
||||||
long len;
|
long len;
|
||||||
VALUE path = rb_iseq_path(jit->iseq);
|
VALUE path = rb_iseq_path(jit->iseq);
|
||||||
RSTRING_GETMEM(path, ptr, len);
|
RSTRING_GETMEM(path, ptr, len);
|
||||||
fprintf(stderr, "%s %s:%u\n", msg, ptr, rb_iseq_line_no(jit->iseq, jit->insn_idx));
|
fprintf(stderr, "%s %.*s:%u\n", msg, (int)len, ptr, rb_iseq_line_no(jit->iseq, jit->insn_idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the current instruction's opcode
|
// Get the current instruction's opcode
|
||||||
|
@ -1825,6 +1825,8 @@ gen_opt_send_without_block(jitstate_t* jit, ctx_t* ctx)
|
||||||
return YJIT_CANT_COMPILE;
|
return YJIT_CANT_COMPILE;
|
||||||
// no default case so compiler issues a warning if this is not exhaustive
|
// no default case so compiler issues a warning if this is not exhaustive
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return YJIT_CANT_COMPILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static codegen_status_t
|
static codegen_status_t
|
||||||
|
|
|
@ -18,12 +18,12 @@
|
||||||
|
|
||||||
#if HAVE_LIBCAPSTONE
|
#if HAVE_LIBCAPSTONE
|
||||||
#include <capstone/capstone.h>
|
#include <capstone/capstone.h>
|
||||||
|
static VALUE cYjitDisasm;
|
||||||
|
static VALUE cYjitDisasmInsn;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static VALUE mYjit;
|
static VALUE mYjit;
|
||||||
static VALUE cYjitBlock;
|
static VALUE cYjitBlock;
|
||||||
static VALUE cYjitDisasm;
|
|
||||||
static VALUE cYjitDisasmInsn;
|
|
||||||
|
|
||||||
#if RUBY_DEBUG
|
#if RUBY_DEBUG
|
||||||
static int64_t vm_insns_count = 0;
|
static int64_t vm_insns_count = 0;
|
||||||
|
|
|
@ -7,9 +7,12 @@
|
||||||
#define YJIT_IFACE_H 1
|
#define YJIT_IFACE_H 1
|
||||||
|
|
||||||
#include "ruby/ruby.h"
|
#include "ruby/ruby.h"
|
||||||
|
#include "ruby/assert.h" // for RUBY_DEBUG
|
||||||
#include "vm_core.h"
|
#include "vm_core.h"
|
||||||
#include "yjit_core.h"
|
#include "yjit_core.h"
|
||||||
|
|
||||||
|
#if RUBY_DEBUG
|
||||||
|
|
||||||
#define YJIT_DECLARE_COUNTERS(...) struct rb_yjit_runtime_counters { \
|
#define YJIT_DECLARE_COUNTERS(...) struct rb_yjit_runtime_counters { \
|
||||||
int64_t __VA_ARGS__; \
|
int64_t __VA_ARGS__; \
|
||||||
}; \
|
}; \
|
||||||
|
@ -61,6 +64,8 @@ YJIT_DECLARE_COUNTERS(
|
||||||
|
|
||||||
#undef YJIT_DECLARE_COUNTERS
|
#undef YJIT_DECLARE_COUNTERS
|
||||||
|
|
||||||
|
#endif // if RUBY_DEBUG
|
||||||
|
|
||||||
RUBY_EXTERN struct rb_yjit_options rb_yjit_opts;
|
RUBY_EXTERN struct rb_yjit_options rb_yjit_opts;
|
||||||
RUBY_EXTERN int64_t rb_compiled_iseq_count;
|
RUBY_EXTERN int64_t rb_compiled_iseq_count;
|
||||||
RUBY_EXTERN struct rb_yjit_runtime_counters yjit_runtime_counters;
|
RUBY_EXTERN struct rb_yjit_runtime_counters yjit_runtime_counters;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue