summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-01-15__builtin_assume_aligned for *(foo *) castsshyouhei
These casts are guarded. Must be safe to assume alignments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15__alignof__ to take alignment of a typeshyouhei
C11 and C++11 has this feature so why not use it when available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15__attibute__((__aligned__)) for RSTRING_PTR()shyouhei
For instance array.c:rb_ary_product() uses RSTRING_PTR() as an array of int. So to avoid misaligned memory access RSTRING_PTR() must at least be sizeof(int)-aligned. However the type of RSTRING_PTR() is char*, which of course can expect alignment as much as 1. This is a problem. The reality is, there is no misaligned memory access because the memory region behind RSTRING_PTR() is allocated using malloc(). Memory regions returned from malloc() are always aligned appropriately. So let's tell the compiler about this information. It seems GCC, clang, and MSVC have such feature. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15more ytab.sed fixesnobu
* tool/ytab.sed: `p` is too short to distinguish alone from other names. fix for more old bison which does not support %lex-param at yydestruct. add `p` argument to non-prototype declaration of yy_stack_print. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15* 2018-01-15svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15tool/ytab.sed: Support some old bison implementationsmame
At least, I confirmed bison 2.3 (because macOS uses the version). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-14parse.y (parser_heredoc_dedent): Removedmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-14parse.y: yydebugnobu
* parse.y (yydebug): define to disable a global variable and get rid of linker error when static linked ext. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-14parse.y: Remove unused a macro "FIXME"mame
I don't know what it was, but seems that it has been already fixed since r12117. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-14parse.y: ripper no longer uses rb_discard_nodenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-14parse.y: Remove a code for old yaccmame
The current parse.y won't compile with yacc since it depends on many bison's extensions. Also, configure.ac does not have a check for yacc, so the macro OLD_YACC is no longer used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-14parse.y: Remove almost all *_gen macros by passing parser_params explicitlymame
In parse.y many functions were suffixed "_gen" and had companion macros to pass struct parser_params implicitly, which made parse.c bigger and more obscure. This change expands and removes almost all "*_gen" macros. This requires explicit passing of struct parser_params, i.e., we need to write "foo(p, ..)" instead of "foo(..)". However, it is just extra three letters. I believe that this is easier to understand. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-14parse.y: Expand global-like accessor macros for struct parser_paramsmame
For example, `lex_strterm` is expanded to `p->lex.strterm`. I believe that this expansion make the code straightforward. They look not so annoying because "parser" was renamed to "p". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-14parse.y: Use "p" for the variable of struct parser_params consistentlymame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-14parse.y: Avoid "p" as a variable namemame
Because I want to use the name "p" for struct parser_params through parse.c. This change renames "p" to "ptr", "paren", etc. depending upon the context. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-14exclude flexible array size with old compilersnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-14* 2018-01-14svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-14net/http: use writev for HTTP chunked request bodiesnormal
This reduces both user and system CPU time for large uploads with dynamically-generated request bodies. user system total real before: 0.393334 1.580000 1.973334 ( 1.971066) after: 0.223334 0.976666 1.200000 ( 1.198514) ------ require 'socket' require 'net/http' require 'benchmark' nr = 1024 * 1024 * 1024 s = TCPServer.new('127.0.0.1', 0) addr = s.addr at_exit { Process.waitall } fork do c = s.accept # not exactly accurate but fast IO.copy_stream(c, '/dev/null', nr + 500000) begin buf = c.readpartial(16384) tmp = '' until buf.end_with?(-"0\r\n\r\n") buf << c.readpartial(16384, tmp) end rescue EOFError end c.write "HTTP/1.1 201 Created\r\nConnection:close\r\n\r\n" c.close end r, w = IO.pipe fork do r.close IO.copy_stream('/dev/zero', w, nr) w.close end w.close Net::HTTP.start(addr[3], addr[1]) do |http| put = Net::HTTP::Put.new('/dev0/foo') put['Content-Type'] = 'application/content-type' put['Transfer-Encoding'] = 'chunked' put.body_stream = r puts(Benchmark.measure { http.request(put) }) end ------ * lib/net/http/generic_request.rb (write): use multi-arg write * lib/net/protocol.rb (write): support multi-arg (write0): ditto [ruby-core:84845] [Feature #14339] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-13string.c (struct mapping_buffer): Use FLEX_ARY_LENmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-13compile.c (struct ibf_object_*): Use FLEX_ARY_LENmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-13compile.c (struct ibf_id_entry): Just removed.mame
It looked unused. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-13iseq.h (struct iseq_catch_table_entry, iseq_compile_data_storage): Use ↵mame
FLEX_ARY_LEN git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-13file.c (struct apply_arg): Use FLEX_ARY_LENmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-13variable.c (struct gen_ivtbl): Use FLEX_ARY_LEN.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-13node.c (node_buffer_elem_t): Use FLEX_ARY_LENmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-13internal.h (FLEX_ARY_LEN): Add a macro to define a flexible arraymame
Also, use it in iseq.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-13Fix a typo.hsbt
configure.ac: delcares -> declares. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-13__VA_ARGS__ is a C99ismshyouhei
give up CALL_ATTRIBUTE macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-13flexible array member is a C99ismshyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-13Update dependenciesnobu
* common.mk: enc/unicode.$(OBJEXT) depends on onigmo.h via oniguruma.h. * common.mk: dependencies of *prelude.$(OBJEXT) are defined for each generated C sources. * enc/depend: casefold.h and name2ctype.h are located under $(UNICODE_HDR_DIR). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-13Update dependencies using `tool/update-deps`kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12* 2018-01-13svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12parse.y: Remove meaningless ifndef guardsmame
Because the part of the code is already within `#ifndef RIPPER`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12parse.y (token_info_push, token_info_pop): Refactoringmame
* remove unused argument len * factor out initialization code of token_info * make the condition of "mismatched indentations" warning easy to understand git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12parse.y (token_info_push, token_info_pop): Use code_locationmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12suppress warning for VC12shyouhei
It says "warning C4146: unary minus operator applied to unsigned type, result still unsigned" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12parse.y: Remove unneeded dependence on pointer representatinmame
A simple comparison is enough in this case git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12merge revision: 61746shyouhei
`signed` is required for Rasbian (x86_64). * tool/ruby_vm/views/_insn_stack_increase.erb: specify `signed` explicitly for systems which use `unsigned` for `char` type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12Fix a typo.hsbt
* template/unicode_norm_gen.tmpl: ouput -> output git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12sample/iseq_loader: use File.open instead of Kernel#opennormal
This makes auditing for inadvertant command execution easier. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12sample/iseq_loader.rb: spelling fixnormal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12Fixed typos.hsbt
* sample/trick2013/kinaba/remarks.markdown: algorthim -> algorithm * sample/trick2015/ksk_1/remarks.markdown: Limination -> Limitation git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12tool/ruby_vm support for pre-2.0 BASERUBYshyouhei
This was not requested :) but actually easier than the previous so I just did it anyway. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12tool/ruby_vm support for pre-2.1 BASERUBYshyouhei
as requested by devs, support for BASERUBY prior to 2.1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12tool/ruby_vm support for pre-2.3 BASERUBYshyouhei
as requested by devs, support for BASERUBY prior to 2.3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12delete tool/instruction.rb (2nd try)shyouhei
Previous commit changed insns.def format. Now is the time for its generators. In doing so I chose to modernize the system, not just patch. My attempt includes - extensive use of Onigumo regular expressions - split from one big file (instruction.rb) into separated MVC - partial view Also, let me take this opportunity to kill old unused features such as - stack caching - minsns / yasmdata which are never seriously used - yarvarch document generation (moved to doc/) - vast majority of unused arguments to insns2vm.rb This commit generates VM source codes that cleanly compile, and the generated binary passes tests. At least for me. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12[ci skip] add comments about file format (2nd try)shyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12new insns.def format (2nd try)shyouhei
- Gave up @j comments - Room for sp_inc to be a proper grammer element git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12Add `103 Early Hints` to `Net::HTTP::STATUS_CODES` [ci skip]kazu
Update by `ruby lib/net/http/status.rb | sponge lib/net/http/status.rb` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12doc/NEWS-2.5.0: `step` is not `Integer#step` but `Numeric#step` [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e