aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_iseq.rb
Commit message (Collapse)AuthorAgeFilesLines
* Raise when loading unprovided builtin function [Bug #17192]Nobuyoshi Nakada2020-11-301-0/+15
|
* Added assertionsNobuyoshi Nakada2020-11-191-7/+7
|
* Make RubyVM::InstructionSequence.compile_file use same encoding as loadJeremy Evans2020-11-191-0/+16
| | | | | | | | This switches the internal function from rb_parser_compile_file_path to rb_parser_load_file, which is the same internal method that Kernel#load uses. Fixes [Bug #17308]
* Unfreeze string-literal-only interpolated string-literalNobuyoshi Nakada2020-09-301-1/+1
| | | | [Feature #17104]
* Interpolated strings are no longer frozen with frozen-string-literal: trueBenoit Daloze2020-09-151-2/+2
| | | | | * Remove freezestring instruction since this was the only usage for it. * [Feature #17104]
* Fix a random test failure by TracePointTakashi Kokubun2020-06-241-2/+4
| | | | | | | A test worker process may already be enabling TracePoint, which results in changing the insn name in this test. http://ci.rvm.jp/results/trunk-random0@phosphorus-docker/3022750
* Added test for `debug_level:` option of `RubyVM::InstructionSequence.compile`Nobuyoshi Nakada2020-04-151-0/+8
|
* support multi-run for test/ruby/test_iseq.rbKoichi Sasada2020-01-281-0/+5
| | | | need to remove a Constant.
* catch up last commit.Koichi Sasada2019-11-181-1/+1
| | | | Array#pack uses `opt_invokebuiltin_delegate_leave` now.
* Support RB_BUILTIN in ISeq#to_aTakashi Kokubun2019-11-091-0/+7
|
* Iseq#to_binary: dump flag for **nil (#2508)Alan Wu2019-10-021-0/+11
| | | | RUBY_ISEQ_DUMP_DEBUG=to_binary and the attached test case was failing. Dump the flag to make sure `**nil` can round-trip properly.
* [EXPERIMENTAL] Expression with modifier `in`Nobuyoshi Nakada2019-09-261-1/+1
| | | | [Feature #15865]
* Iseq#to_binary: Add support for NoMatchingPatternError and TypeErrorAlan Wu2019-08-091-0/+10
| | | | | | | | | | Binary dumping the iseq for `case foo in []; end` used to crash as there was no handling for these exception classes. Pattern matching generates these classes as operands to `putobject`. [Bug #16088] Closes: https://github.com/ruby/ruby/pull/2325
* Suppress method redefinition warningsNobuyoshi Nakada2019-06-301-1/+2
|
* Suppress unused variable warningsNobuyoshi Nakada2019-06-301-1/+1
|
* Use assigned local variableNobuyoshi Nakada2019-06-281-1/+1
|
* Ignore warnings about ambiguous first argument of regexp with assert match.Hiroshi SHIBATA2019-06-011-2/+2
|
* Fix scanner event at invalid syntaxNobuyoshi Nakada2019-05-261-3/+6
| | | | | | * parse.y (parser_yyerror, parser_compile_error): revert r67224 (e5d10cda07b23682e5e4e64d1324e4d3247d4785) "Flush erred token".
* Show the source line at an invalid class/instance variablenobu2019-03-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_iseq.rb: update expected error messagenobu2019-01-311-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_iseq.rb: enablednobu2019-01-311-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Return same ISeq object for one src.ko12018-12-061-0/+23
| | | | | | | | | | | | | | | | | | | | | * iseq.c: before this patch, RubyVM::InstructionSequence.of(src) (ISeq in short) returns different ISeq (wrapper) objects point to one ISeq internal object. This patch changes this behavior to cache created ISeq (wrapper) objects and return same ISeq object for an internal ISeq object. * iseq.h (ISEQ_EXECUTABLE_P): introduced to check executable ISeq objects. * iseq.h (ISEQ_COMPILE_DATA_ALLOC): reordr setting flag line to avoid ISEQ_USE_COMPILE_DATA but compiled_data == NULL case. * vm_core.h (rb_iseq_t): introduce `rb_iseq_t::wrapper` and `rb_iseq_t::aux::exec`. Move `rb_iseq_t::local_hooks` to `rb_iseq_t::aux::exec::local_hooks`. * test/ruby/test_iseq.rb: add ISeq.of() tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parser: improve error messagesnobu2018-11-251-1/+1
| | | | | | | | [Fix GH-2011] From: Akim Demaille <akim.demaille@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix TracePoint for nested iseq loaded from binary [Bug#14702]ko12018-11-061-8/+69
| | | | | | | | | | | | | | | | | | | When loading iseq from binary while a TracePoint is on, we need to recompile instructions to their "trace_" variant. Before this commit we only recompiled instructions in the top level iseq, which meant that TracePoint was malfunctioning for code inside module/class/method definitions. * compile.c: Move rb_iseq_init_trace to rb_ibf_load_iseq_complete. It is called on all iseqs during loading. * test_iseq.rb: Test that tracepoints fire within children iseq when using load_from_binary. This patch is from: Alan Wu <XrXr@users.noreply.github.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* check trace flags at loading [Bug #14702]ko12018-08-231-0/+14
| | | | | | | | | | | | * iseq.c (iseq_init_trace): at ISeq loading time, we need to check `ruby_vm_event_enabled_flags` to turn on trace instructions. Seprate this checking code from `finish_iseq_build()` and make new function. `iseq_ibf_load()` calls this funcation after loading. * test/ruby/test_iseq.rb: add a test for this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: align rangenobu2018-04-161-0/+1
| | | | | | | * compile.c (ibf_dump_object_struct): align range elements. [ruby-core:86548] [Bug #14689] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: align IBF dumped datanobu2018-04-081-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_iseq.rb: hexdump to diffnobu2018-04-071-2/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: fix positions encodenobu2018-04-051-5/+24
| | | | | | | * compile.c (ibf_load_iseq_each): iseq_size necessary to encode positions is set in ibf_load_code(). [Bug #14660] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_iseq.rb: disable load_from_binarynobu2018-03-211-1/+1
| | | | | | | | * test/ruby/test_iseq.rb (test_to_binary_with_objects): disable load_from_binary right now, r62851 seems having a trouble around get_insn_info_succinct_bitvector() yet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: fix ibf_load_codenobu2018-03-201-1/+2
| | | | | | | | | | | * compile.c (ibf_load_iseq_each): manage iseq_size to point loaded objects in iseq_encoded. now marking iseq scans iseq_encoded directly. * test/ruby/test_iseq.rb (test_to_binary_with_objects): skip for now, but fix argument order of assert_equal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* IBF works only on x86 platforms nownobu2018-03-181-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_iseq.rb: skip iseq with coveragenobu2018-03-161-1/+6
| | | | | | | * test/ruby/test_iseq.rb (test_to_binary_with_objects): #to_binary does not support iseq compiled with coverage, just skip. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: fix load_from_binarynobu2018-03-161-5/+4
| | | | | | | | | * compile.c (ibf_load_iseq_each): realpath may be nil. follow up r59709. [fix https://github.com/Shopify/bootsnap/issues/132] From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r62617 "compile.c: fix load_from_binary"naruse2018-03-151-4/+5
| | | | | | | It breaks Solaris: http://rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20180301T012502Z.diff.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: fix load_from_binarynobu2018-03-011-5/+4
| | | | | | | * compile.c (ibf_load_iseq_each): realpath may be nil. follow up r59709. [fix https://github.com/Shopify/bootsnap/issues/132] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r61936 "compile.c: use ALLOCV_N"nobu2018-02-281-0/+9
| | | | | | | | * compile.c (ibf_dump_object_list): `dump->obj_list` is not fixed yet, as new objects are pushed by lbf_dump_object_object. fixes crash by buffer overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: child iseq encodingnobu2018-01-111-0/+5
| | | | | | * iseq.c (iseq_inspect): preserve the encoding of child iseqs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Set first line numbers for empty iseqs.ko12017-12-251-0/+33
| | | | | | | | | | | | | * compile.c (iseq_compile_each): for empty method, block and so on, `last_line` is not set so that line number of `putnil` instruction will be zero. This patch set `first_lineno` for such `putnil`. Problem is reported by deivid-rodriguez via Yuichiro Kaneko. * test/ruby/test_iseq.rb: add a test for this spec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* RubyVM::InstructionSequence#trace_points.ko12017-12-231-20/+56
| | | | | | | | | | * iseq.c (iseqw_trace_points): add `RubyVM::InstructionSequence#trace_points` method for tools which want to manipulate ISeq (and traces). * test/ruby/test_iseq.rb: add a test for this method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* RubyVM::InstructionSequence#each_child.ko12017-12-231-0/+41
| | | | | | | | | | * iseq.c (iseqw_each_child): add RubyVM::InstructionSequence#each_child method for tools which want to manipulate ISeq. * test/ruby/test_iseq.rb: add a test for this method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_iseq.rb: Skip test_safe_call_chain if Coverage is running.yui-knk2017-09-251-1/+3
| | | | | | | | | | | Follow up to r59990. When Coverage is running, trace2 instructions are inserted to take branch coverages for safe method invocations. This insertion makes safe call chains unable to be optimized and breaks this test case. So we test it only when Coverage is not running. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: preserve encodingnobu2017-06-121-0/+8
| | | | | | * iseq.c (iseqw_inspect): preserve path encoding in the result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: syntax error in compile_filenobu2016-09-271-0/+18
| | | | | | | * iseq.c (iseqw_s_compile_file): deal with syntax error as well as compile, and should not abort when rescued. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: undef allocatornobu2016-08-221-0/+4
| | | | | | | * iseq.c (Init_ISeq): undefine allocator of InstructionSequence, to get rid of segfaults at method call on uninitialized object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: fix newline in syntax errornobu2016-08-121-0/+3
| | | | | | | | * error.c (rb_syntax_error_append): fix newline in syntax error message to the beginning, not after file name and line number. [Feature #11951] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (Init_ISeq): undef ISeq.translate and ISeq.load_iseqko12016-07-131-0/+10
| | | | | | | | | | | | | | | | to prevent calling super classes' methods. Without this patch, you can write workaround like: class << RubyVM::InstructionSequence def translate; end undef translate end * test/ruby/test_iseq.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use Integer instead of Fixnum and Bignum.akr2016-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * object.c, numeric.c, enum.c, ext/-test-/bignum/mul.c, lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rexml/xpath_parser.rb, lib/rubygems/specification.rb, lib/uri/generic.rb, bootstraptest/test_eval.rb, basictest/test.rb, test/-ext-/bignum/test_big2str.rb, test/-ext-/bignum/test_div.rb, test/-ext-/bignum/test_mul.rb, test/-ext-/bignum/test_str2big.rb, test/csv/test_data_converters.rb, test/date/test_date.rb, test/json/test_json_generate.rb, test/minitest/test_minitest_mock.rb, test/openssl/test_cipher.rb, test/rexml/test_jaxen.rb, test/ruby/test_array.rb, test/ruby/test_basicinstructions.rb, test/ruby/test_bignum.rb, test/ruby/test_case.rb, test/ruby/test_class.rb, test/ruby/test_complex.rb, test/ruby/test_enum.rb, test/ruby/test_eval.rb, test/ruby/test_iseq.rb, test/ruby/test_literal.rb, test/ruby/test_math.rb, test/ruby/test_module.rb, test/ruby/test_numeric.rb, test/ruby/test_range.rb, test/ruby/test_rational.rb, test/ruby/test_refinement.rb, test/ruby/test_rubyvm.rb, test/ruby/test_struct.rb, test/ruby/test_variable.rb, test/rubygems/test_gem_specification.rb, test/thread/test_queue.rb: Use Integer instead of Fixnum and Bignum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* SyntaxError message at iseq compilenobu2016-03-191-0/+21
| | | | | | | | | | | | * iseq.c (rb_iseq_compile_with_option): make the parser in mild error. * load.c (rb_load_internal0): ditto. * parse.y (yycompile0): return the error message within the error to be raised. [Feature #11951] * parse.y (parser_compile_error): accumulate error messages in the error_buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_iseq.rb: shortennobu2016-03-191-7/+7
| | | | | | | * test/ruby/test_iseq.rb (TestISeq): use the utility method to get rid of warnings and the alias to shorten. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e