Skip to content

Commit 3fddeaa

Browse files
committed
Merge remote-tracking branch 'origin/trunk' into 2.1
2 parents e72a5e0 + 661cf78 commit 3fddeaa

24 files changed

+304
-107
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
.ppack
2424
.svn
2525
Makefile
26+
Makefile.old
2627
extconf.h
2728
y.output
2829
y.tab.c
@@ -36,6 +37,7 @@ y.tab.c
3637
/ChangeLog.pre1_1
3738
/Doxyfile
3839
/GNUmakefile
40+
/GNUmakefile.old
3941
/README.atheos
4042
/README.fat-patch
4143
/README.v6

ChangeLog

+64
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,67 @@
1+
Wed Dec 18 17:03:00 2013 Koichi Sasada <ko1@atdot.net>
2+
3+
* gc.c (gc_profile_record_get): should return an empty array
4+
when profiling is active.
5+
6+
Wed Dec 18 16:49:40 2013 Koichi Sasada <ko1@atdot.net>
7+
8+
* gc.c (gc_profile_clear, gc_profile_enable): remove rest_sweep().
9+
10+
* gc.c: check objspace->profile.current_record before inserting
11+
profiling record by new macro gc_prof_enabled().
12+
13+
Wed Dec 18 14:32:06 2013 Koichi Sasada <ko1@atdot.net>
14+
15+
* vm_exec.h (VM_DEBUG_STACKOVERFLOW): added.
16+
disable stack overflow check for every stack pushing as default.
17+
18+
* vm_exec.c (vm_stack_overflow_for_insn): ditto.
19+
20+
Wed Dec 18 10:00:22 2013 Eric Hodel <drbrain@segment7.net>
21+
22+
* lib/rubygems: Update to RubyGems master d8f12e2. This increases the
23+
speed of `gem install --ignore-dependencies` which helps bundler
24+
tests.
25+
* test/rubygems: ditto.
26+
27+
Wed Dec 18 09:00:17 2013 Koichi Sasada <ko1@atdot.net>
28+
29+
* test/ruby/test_gc.rb (test_expand_heap): allow +/-1 diff.
30+
31+
Tue Dec 17 23:44:15 2013 Kazuki Tsujimoto <kazuki@callcc.net>
32+
33+
* test/ruby/test_io.rb: fix duplicated test name.
34+
35+
Tue Dec 17 20:15:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
36+
37+
* hash.c (rb_hash_reject): revert to deprecated behavior, with
38+
warnings, due to compatibility for HashWithDifferentAccess.
39+
[ruby-core:59154] [Bug #9223]
40+
41+
Tue Dec 17 17:30:56 2013 Akinori MUSHA <knu@iDaemons.org>
42+
43+
* misc/ruby-electric.el: Import version 2.1.1 from
44+
https://github.com/knu/ruby-electric.el.
45+
46+
* ruby-electric-delete-backward-char: Enable support for number
47+
prefix.
48+
49+
* ruby-electric-curlies: Fix electric operation after an open
50+
curly.
51+
52+
Tue Dec 17 16:19:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
53+
54+
* vm_trace.c (rb_postponed_job_flush): isolate exceptions in
55+
postponed jobs and restore outer ones. based on a patch by
56+
tarui. [ruby-core:58652] [Bug #9168]
57+
58+
Tue Dec 17 10:48:04 2013 Aman Gupta <ruby@tmm1.net>
59+
60+
* configure.in (RUBY_DTRACE_POSTPROCESS): Fix compatibility with
61+
systemtap on linux. stap requires `dtrace -G` post-processing, but
62+
the dtrace compatibility wrapper is very strict about probes.d
63+
syntax.
64+
165
Tue Dec 17 05:18:17 2013 Eric Hodel <drbrain@segment7.net>
266

367
* lib/rubygems: Update to RubyGems master 1c5f4b3. Allows rubygems

Makefile.in

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ cflags = @cflags@
6262
optflags = @optflags@
6363
debugflags = @debugflags@
6464
warnflags = @warnflags@ @strict_warnflags@
65+
cppflags = @cppflags@
6566
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir)
6667
XCFLAGS = @XCFLAGS@
6768
CPPFLAGS = @CPPFLAGS@ $(INCFLAGS)

NEWS

+4-3
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,10 @@ with all sufficient information, see the ChangeLog file.
135135

136136
* Hash
137137
* incompatible changes:
138-
* Hash#reject now returns plain Hash object, that is the original object's
139-
subclass, instance variables, default value, and taintedness are no longer
140-
copied.
138+
* Hash#reject will return plain Hash object in the future versions, that
139+
is the original object's subclass, instance variables, default value,
140+
and taintedness will be no longer copied, so now warnings are emitted
141+
when called with such Hash.
141142

142143
* IO
143144
* incompatible changes:

configure.in

+27-22
Original file line numberDiff line numberDiff line change
@@ -584,13 +584,17 @@ AC_DEFUN([RUBY_DTRACE_POSTPROCESS],
584584
[AC_CACHE_CHECK(whether $DTRACE needs post processing, rb_cv_prog_dtrace_g,
585585
[
586586
if {
587-
echo "provider conftest{ probe fire(); };" > conftest_provider.d &&
588-
dtrace -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null &&
587+
cat >conftest_provider.d <<_PROBES &&
588+
provider conftest {
589+
probe fire();
590+
};
591+
_PROBES
592+
$DTRACE -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null &&
589593
cat >conftest.c <<_CONF &&
590594
@%:@include "conftest_provider.h"
591595
int main(void){ CONFTEST_FIRE(); return 0; }
592596
_CONF
593-
$CC $CFLAGS -c -o conftest.o conftest.c &&
597+
$CC $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c &&
594598
$DTRACE -G -s conftest_provider.d conftest.o 2>/dev/null
595599
}; then
596600
rb_cv_prog_dtrace_g=yes
@@ -852,6 +856,25 @@ if test "$GCC" = yes; then
852856
done
853857
fi
854858

859+
AC_ARG_WITH(opt-dir,
860+
AS_HELP_STRING([--with-opt-dir=DIR-LIST],
861+
[add optional headers and libraries directories separated by $PATH_SEPARATOR]),
862+
[
863+
withval="$1"
864+
val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -I\1/include|g;s/^ //"`
865+
CPPFLAGS="$CPPFLAGS $val"
866+
val=`IFS="$PATH_SEPARATOR"
867+
for dir in $withval; do
868+
echo x ${LIBPATHFLAG} ${RPATHFLAG} |
869+
sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${dir}/lib${IFS}g;s${IFS}%s${IFS}${dir}/lib${IFS}g"
870+
done | tr '\012' ' '`
871+
LDFLAGS_OPTDIR="$val"
872+
test x"${LDFLAGS}" = x || LDFLAGS="$LDFLAGS "
873+
LDFLAGS="$LDFLAGS$val"
874+
test x"${DLDFLAGS}" = x || DLDFLAGS="$DLDFLAGS "
875+
DLDFLAGS="$DLDFLAGS$val"
876+
])
877+
855878
test -z "${ac_env_CFLAGS_set}" -a -n "${cflags+set}" && eval CFLAGS="\"$cflags $ARCH_FLAG\""
856879
test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cxxflags $ARCH_FLAG\""
857880

@@ -2732,24 +2755,6 @@ AC_SUBST(RPATHFLAG)
27322755
AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}")
27332756
AC_SUBST(TRY_LINK)
27342757

2735-
AC_ARG_WITH(opt-dir,
2736-
AS_HELP_STRING([--with-opt-dir=DIR-LIST],
2737-
[add optional headers and libraries directories separated by $PATH_SEPARATOR]),
2738-
[
2739-
val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -I\1/include|g;s/^ //"`
2740-
CPPFLAGS="$CPPFLAGS $val"
2741-
val=`IFS="$PATH_SEPARATOR"
2742-
for dir in $withval; do
2743-
echo x ${LIBPATHFLAG} ${RPATHFLAG} |
2744-
sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${dir}/lib${IFS}g;s${IFS}%s${IFS}${dir}/lib${IFS}g"
2745-
done | tr '\012' ' '`
2746-
LDFLAGS_OPTDIR="$val"
2747-
test x"${LDFLAGS}" = x || LDFLAGS="$LDFLAGS "
2748-
LDFLAGS="$LDFLAGS$val"
2749-
test x"${DLDFLAGS}" = x || DLDFLAGS="$DLDFLAGS "
2750-
DLDFLAGS="$DLDFLAGS$val"
2751-
])
2752-
27532758
AS_CASE(["$target_cpu-$target_os"],
27542759
[*-darwin*], [
27552760
AC_CHECK_HEADERS([execinfo.h])
@@ -3551,7 +3556,7 @@ if test "${ARCH_FLAG}"; then
35513556
LDFLAGS=`echo "$LDFLAGS" | sed "s| *$archflagpat"'||'`
35523557
fi
35533558
warnflags="$rb_cv_warnflags"
3554-
AC_SUBST(cppflags, [])dnl
3559+
AC_SUBST(cppflags)dnl
35553560
AC_SUBST(cflags, ["$orig_cflags "'${optflags} ${debugflags} ${warnflags}'])dnl
35563561
AC_SUBST(cxxflags, ["$orig_cxxflags "'${optflags} ${debugflags} ${warnflags}'])dnl
35573562
AC_SUBST(optflags)dnl

ext/objspace/object_tracing.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ trace_object_allocations(VALUE self)
274274
}
275275

276276
int rb_bug_reporter_add(void (*func)(FILE *, void *), void *data);
277-
static int object_allocations_reporter_registerd = 0;
277+
static int object_allocations_reporter_registered = 0;
278278

279279
static int
280280
object_allocations_reporter_i(st_data_t key, st_data_t val, st_data_t ptr)
@@ -307,8 +307,8 @@ static VALUE
307307
trace_object_allocations_debug_start(VALUE self)
308308
{
309309
tmp_keep_remains = 1;
310-
if (object_allocations_reporter_registerd == 0) {
311-
object_allocations_reporter_registerd = 1;
310+
if (object_allocations_reporter_registered == 0) {
311+
object_allocations_reporter_registered = 1;
312312
rb_bug_reporter_add(object_allocations_reporter, 0);
313313
}
314314

gc.c

+12-17
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,7 @@ static inline void gc_prof_set_malloc_info(rb_objspace_t *);
680680
static inline void gc_prof_set_heap_info(rb_objspace_t *);
681681

682682
#define gc_prof_record(objspace) (objspace)->profile.current_record
683+
#define gc_prof_enabled(objspace) ((objspace)->profile.run && (objspace)->profile.current_record)
683684

684685
#define rgengc_report if (RGENGC_DEBUG) rgengc_report_body
685686
static void rgengc_report_body(int level, rb_objspace_t *objspace, const char *fmt, ...);
@@ -2101,7 +2102,7 @@ rb_gc_finalize_deferred(void)
21012102
}
21022103

21032104
static void
2104-
gc_finalize_deferred_register()
2105+
gc_finalize_deferred_register(void)
21052106
{
21062107
if (rb_postponed_job_register_one(0, gc_finalize_deferred, 0) == 0) {
21072108
rb_bug("gc_finalize_deferred_register: can't register finalizer.");
@@ -2758,7 +2759,7 @@ gc_page_sweep(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_
27582759
gc_setup_mark_bits(sweep_page);
27592760

27602761
#if GC_PROFILE_MORE_DETAIL
2761-
if (objspace->profile.run) {
2762+
if (gc_prof_enabled(objspace)) {
27622763
gc_profile_record *record = gc_prof_record(objspace);
27632764
record->removing_objects += final_slots + freed_slots;
27642765
record->empty_objects += empty_slots;
@@ -6782,7 +6783,7 @@ gc_prof_setup_new_record(rb_objspace_t *objspace, int reason)
67826783
static inline void
67836784
gc_prof_timer_start(rb_objspace_t *objspace)
67846785
{
6785-
if (objspace->profile.run) {
6786+
if (gc_prof_enabled(objspace)) {
67866787
gc_profile_record *record = gc_prof_record(objspace);
67876788
#if GC_PROFILE_MORE_DETAIL
67886789
record->prepare_time = objspace->profile.prepare_time;
@@ -6807,7 +6808,7 @@ elapsed_time_from(double time)
68076808
static inline void
68086809
gc_prof_timer_stop(rb_objspace_t *objspace)
68096810
{
6810-
if (objspace->profile.run) {
6811+
if (gc_prof_enabled(objspace)) {
68116812
gc_profile_record *record = gc_prof_record(objspace);
68126813
record->gc_time = elapsed_time_from(record->gc_invoke_time);
68136814
record->gc_invoke_time -= objspace->profile.invoke_time;
@@ -6821,7 +6822,7 @@ gc_prof_mark_timer_start(rb_objspace_t *objspace)
68216822
RUBY_DTRACE_GC_MARK_BEGIN();
68226823
}
68236824
#if GC_PROFILE_MORE_DETAIL
6824-
if (objspace->profile.run) {
6825+
if (gc_prof_enabled(objspace)) {
68256826
gc_prof_record(objspace)->gc_mark_time = getrusage_time();
68266827
}
68276828
#endif
@@ -6834,7 +6835,7 @@ gc_prof_mark_timer_stop(rb_objspace_t *objspace)
68346835
RUBY_DTRACE_GC_MARK_END();
68356836
}
68366837
#if GC_PROFILE_MORE_DETAIL
6837-
if (objspace->profile.run) {
6838+
if (gc_prof_enabled(objspace)) {
68386839
gc_profile_record *record = gc_prof_record(objspace);
68396840
record->gc_mark_time = elapsed_time_from(record->gc_mark_time);
68406841
}
@@ -6847,7 +6848,7 @@ gc_prof_sweep_timer_start(rb_objspace_t *objspace)
68476848
if (RUBY_DTRACE_GC_SWEEP_BEGIN_ENABLED()) {
68486849
RUBY_DTRACE_GC_SWEEP_BEGIN();
68496850
}
6850-
if (objspace->profile.run) {
6851+
if (gc_prof_enabled(objspace)) {
68516852
gc_profile_record *record = gc_prof_record(objspace);
68526853

68536854
if (record->gc_time > 0 || GC_PROFILE_MORE_DETAIL) {
@@ -6863,7 +6864,7 @@ gc_prof_sweep_timer_stop(rb_objspace_t *objspace)
68636864
RUBY_DTRACE_GC_SWEEP_END();
68646865
}
68656866

6866-
if (objspace->profile.run) {
6867+
if (gc_prof_enabled(objspace)) {
68676868
double sweep_time;
68686869
gc_profile_record *record = gc_prof_record(objspace);
68696870

@@ -6888,7 +6889,7 @@ static inline void
68886889
gc_prof_set_malloc_info(rb_objspace_t *objspace)
68896890
{
68906891
#if GC_PROFILE_MORE_DETAIL
6891-
if (objspace->profile.run) {
6892+
if (gc_prof_enabled(objspace)) {
68926893
gc_profile_record *record = gc_prof_record(objspace);
68936894
record->allocate_increase = malloc_increase;
68946895
record->allocate_limit = malloc_limit;
@@ -6899,7 +6900,7 @@ gc_prof_set_malloc_info(rb_objspace_t *objspace)
68996900
static inline void
69006901
gc_prof_set_heap_info(rb_objspace_t *objspace)
69016902
{
6902-
if (objspace->profile.run) {
6903+
if (gc_prof_enabled(objspace)) {
69036904
gc_profile_record *record = gc_prof_record(objspace);
69046905
size_t live = objspace->profile.total_allocated_object_num_at_gc_start - objspace->profile.total_freed_object_num;
69056906
size_t total = objspace->profile.heap_used_at_gc_start * HEAP_OBJ_LIMIT;
@@ -6928,12 +6929,6 @@ static VALUE
69286929
gc_profile_clear(void)
69296930
{
69306931
rb_objspace_t *objspace = &rb_objspace;
6931-
6932-
/* This method doesn't change profile.run status.
6933-
* While lazy sweeping, it is possible to touch zero-cleared profile.current_record.
6934-
*/
6935-
gc_rest_sweep(objspace);
6936-
69376932
if (GC_PROFILE_RECORD_DEFAULT_SIZE * 2 < objspace->profile.size) {
69386933
objspace->profile.size = GC_PROFILE_RECORD_DEFAULT_SIZE * 2;
69396934
objspace->profile.records = realloc(objspace->profile.records, sizeof(gc_profile_record) * objspace->profile.size);
@@ -7254,8 +7249,8 @@ static VALUE
72547249
gc_profile_enable(void)
72557250
{
72567251
rb_objspace_t *objspace = &rb_objspace;
7257-
gc_rest_sweep(objspace);
72587252
objspace->profile.run = TRUE;
7253+
objspace->profile.current_record = 0;
72597254
return Qnil;
72607255
}
72617256

hash.c

+32-13
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@
2727
# endif
2828
#endif
2929

30-
#define HAS_MISC_ATTRIBUTES(hash) \
31-
(FL_TEST((hash), FL_EXIVAR|FL_TAINT|HASH_PROC_DEFAULT) || \
32-
!NIL_P(RHASH_IFNONE(hash)))
33-
#define HASH_REJECT_COPY_MISC_ATTRIBUTES 0
30+
#define HAS_MISC_ATTRIBUTES(hash, klass) ( \
31+
(klass = rb_obj_class(hash)) != rb_cHash || \
32+
(klass = 0, \
33+
FL_TEST((hash), FL_EXIVAR|FL_TAINT|HASH_PROC_DEFAULT) || \
34+
!NIL_P(RHASH_IFNONE(hash))))
35+
#define HASH_REJECT_COPY_MISC_ATTRIBUTES 1
3436

3537
static VALUE rb_hash_s_try_convert(VALUE, VALUE);
3638

@@ -1129,19 +1131,36 @@ rb_hash_reject(VALUE hash)
11291131
VALUE result;
11301132

11311133
RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
1134+
if (RTEST(ruby_verbose)) {
1135+
VALUE klass;
1136+
if (HAS_MISC_ATTRIBUTES(hash, klass)) {
11321137
#if HASH_REJECT_COPY_MISC_ATTRIBUTES
1133-
# if 0
1134-
if (HAS_MISC_ATTRIBUTES(has)) {
1135-
rb_warn("copying unguaranteed attributes")
1138+
rb_warn("copying unguaranteed attributes: %+"PRIsVALUE, hash);
1139+
rb_warn("following atributes will not be copied in the future version:");
1140+
if (klass != rb_cHash) {
1141+
rb_warn(" subclass: %+"PRIsVALUE, klass);
1142+
}
1143+
if (FL_TEST(hash, FL_EXIVAR)) {
1144+
rb_warn(" instance variables: %+"PRIsVALUE,
1145+
rb_obj_instance_variables(hash));
1146+
}
1147+
if (FL_TEST(hash, FL_TAINT)) {
1148+
rb_warn(" taintedness");
1149+
}
1150+
if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
1151+
rb_warn(" default proc: %+"PRIsVALUE, RHASH_IFNONE(hash));
1152+
}
1153+
else if (!NIL_P(RHASH_IFNONE(hash)))
1154+
rb_warn(" default value: %+"PRIsVALUE, RHASH_IFNONE(hash));
1155+
#else
1156+
rb_warn("unguaranteed attributes are not copied: %+"PRIsVALUE, hash);
1157+
rb_warn("following atributes are ignored now:");
1158+
#endif
1159+
}
11361160
}
1137-
# endif
1161+
#if HASH_REJECT_COPY_MISC_ATTRIBUTES
11381162
result = rb_hash_dup_empty(hash);
11391163
#else
1140-
# if 0
1141-
if (HAS_MISC_ATTRIBUTES(has)) {
1142-
rb_warn("unguaranteed attributes are not copied")
1143-
}
1144-
# endif
11451164
result = rb_hash_new();
11461165
#endif
11471166
if (!RHASH_EMPTY_P(hash)) {

lib/e2mmap.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class << self
170170

171171
E2MM.def_exception(E2MM,
172172
:ErrNotRegisteredException,
173-
"not registerd exception(%s)")
173+
"not registered exception(%s)")
174174
end
175175

176176

0 commit comments

Comments
 (0)