summaryrefslogtreecommitdiff
path: root/test/ruby/test_iseq.rb
AgeCommit message (Collapse)Author
2015-11-20* compile.c (iseq_compile_each): add debug information to NODE_STRko1
strings as default. [Feature #11725] * insns.def (freezestring): add new instruction to support adding debug information for dynamically constracted strings. * compile.c (iseq_compile_each): support adding debug information for NODE_DSTR with freezestring instruction. * error.c (rb_error_frozen): change the debug information ID name id_debug_created_info and this field should have a 2 element array containing path and line information. * defs/id.def: ditto. * test/ruby/test_rubyoptions.rb: catch up this fix. * test/ruby/test_iseq.rb: now frozen strings are not same. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-09* compile.c (iseq_compile_each): Dynamic string literals should beshugo
frozen. [ruby-core:57574] [Feature #8976] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-06change DOTQnobu
* defs/id.def (token_ops), parse.y (parser_yylex): change DOTQ from ".?" to "&.". [ruby-core:71363] [Feature #11537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-23compile.c: optimize method chainnobu
* compile.c (iseq_peephole_optimize): optimize lengthy safe navigation method chain. [Feature #11537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-23safe navigation attrsetnobu
* compile.c (iseq_compile_each): support safe navigation of simple attribute assignment. [Feature #11537] * parse.y (mlhs_node, lhs, attrset_gen): ditto. keep mid non-attrset as the sign of safe navigation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-09test_iseq.rb: fix meaningless assertionnobu
* test/ruby/test_iseq.rb (test_frozen_string_literal_compile_option): fix meaningless assertion. object_id of same object is always same. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-09* compile.c (iseq_compile_each): Dynamic string literals (e.g.,shugo
"#{x}") should not be frozen because they don't literally represent strings. https://twitter.com/shugomaeda/status/651937650027401216 https://twitter.com/yukihiro_matz/status/651942882312482817 https://twitter.com/yukihiro_matz/status/651980835181096960 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-10compile.c: register cdhashnobu
* compile.c (iseq_build_from_ary_body): register cdhash to the iseq constant body instead of compile time mark array, not to get GCed. [ruby-core:70708] [Feature #8543] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-21* vm_opts.h, iseq.c, iseq.h: add compile option to force frozenko1
string literals. [Feature #11473] This addition is not specification change, but to try frozen string literal world discussed on [Feature #11473]. You can try frozen string literal world using this magical line: RubyVM::InstructionSequence.compile_option = {frozen_string_literal: true} Note that this is a global compilation option, so that you need to compile another script like that: p 'foo'.frozen? #=> false RubyVM::InstructionSequence.compile_option = {frozen_string_literal: true} p 'foo'.frozen? #=> false, because this line is already compiled. p eval("'foo'.frozen?") #=> true Details: * String literals are deduped by rb_fstring(). * Dynamic string literals ("...#{xyz}...") is now only frozen, not deduped. Maybe you have other ideas. Now, please do not use this option on your productions :) Of course, current specification can be changed. * compile.c: ditto. * test/ruby/test_iseq.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19iseq.c: check srouce typenobu
* iseq.c (rb_iseq_compile_with_option): check srouce type, must be an IO or a String. [ruby-core:69219] [Bug #11159] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-18test/ruby/test_iseq.rb: spelling fix: s/diable/disable/normal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-17* compile.c (iseq_compile_each): checkko1
iseq->compile_data->option->specialized_instruction for opt_* insn. * test/ruby/test_iseq.rb: check no specialized_instructions option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-23iseq.c: preserve encoding at disassemblingnobu
* iseq.c (rb_insn_operand_intern): preserve encoding of method name in CALL_INFO at disassembling. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13* test/lib/envutil.rb: Moved from test/ruby/.akr
* test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-04* test/ruby: get rid of warnings.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13test/ruby: better assertionsnobu
* test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-27* test/ruby/test_eval.rb (class TestEval): Use assert_same instead oftmm1
assert_equal. * test/ruby/test_hash.rb (class TestHash): ditto. * test/ruby/test_iseq.rb (class TestISeq): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-27* test/ruby/test_eval.rb (class TestEval): Add test for shared evaltmm1
filenames via rb_fstring(). * test/ruby/test_iseq.rb (class TestISeq): Add test for shared iseq labels via rb_fstring(). [Bug #9159] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-09test/unit/assertions.rb: return exceptionnobu
* lib/test/unit/assertions.rb (assert_raise_with_message): return raised exception same as assert_raise. * test/ruby, test/-ext-: use assert_raise_with_message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-28* compile.c (iseq_compile_each): remove redundant trace(line)ko1
instruction. for example, at the following script def m() p:xyzzy 1 2 end compiler ignores `1' because there is no effect. However, `trace(line)' instruction remains in bytecode. This modification removes such redundant trace(line) instruction. * test/ruby/test_iseq.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-28* iseq.c (iseq_data_to_ary): fix condition.ko1
r34303 introduces a bug to avoid all line information from a result of ISeq#to_a. This is a regression problem from 2.0.0p0. * test/ruby/test_iseq.rb: add a test of lines after ISeq#to_a. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21* test/ruby/test_iseq.rb: disable a test which checks featuresko1
removed at r38532. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01* iseq.c (rb_iseq_line_trace_each): iterate `line' event only.ko1
* test/ruby/test_iseq.rb: add a test for this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30* iseq.c: add RubyVM::InstructionSequence (ISeq) inspection methods.ko1
* ISeq#path returns path of this ISeq written. * ISeq#absolute_path returns absolute path. * ISeq#label returns label (method name and so on). * ISeq#base_label returns base label (see Thread::Backtrace::Location). * ISeq#first_lineno returns first line number of this ISeq. * ISeq.of(obj) returns ISeq object which obj (Proc or Method) is contains. * test/ruby/test_iseq.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30 [EXPERIMENTAL]ko1
* iseq.c: add following two methods. * ISeq#line_trace_all returns all line traces (line numbers) * ISeq#line_trace_specify(pos, set) set `pos'th line event to specified_line event (if set is true). These features are introduced for debuggers (mainly to make breakpoint). * iseq.h: add decl. of C APIs. * test/ruby/test_iseq.rb: add tests. * vm_trace.c: add `specified_line' event. * include/ruby/ruby.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-21Suppress warningsnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10* test/ruby/test_iseq.rb (TestISeq#test_disasm_encoding): set defaultnobu
encoding not to be affected by environment variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09iseq.c: rb_id2strnobu
* iseq.c (iseq_load, insn_operand_intern, rb_iseq_disasm) (rb_iseq_parameters): use rb_id2str() instead of rb_id2name() to keep encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09iseq.c: fix conversionnobu
* iseq.c (iseq_load): type is a symbol, and invalid as ID in common. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-14* iseq.c (iseq_data_to_ary): check line info table boundary. linenobu
number 0 means no line number info is needed. [ruby-dev:45130] [Bug #5894] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e