Commit Graph

1020 Commits

Author SHA1 Message Date
Masaaki Goshima 600ebf03a8
Merge pull request #58 from zchee/fix-resolve-conflict
Fix resolve conflict to #55
2020-11-16 23:47:48 +09:00
Koichi Shiraishi 96528cbae4
Fix resolve conflict to #55 2020-11-16 23:39:33 +09:00
Masaaki Goshima bfa3640e2b
Merge pull request #55 from cuonglm/cuonglm/do-not-use-reflect-SliceHeader
Make "go test -gcflags=-d=checkptr" passes
2020-11-16 22:55:17 +09:00
Cuong Manh Le 6b1d701387
Fix all invalid usages of unsafe.Pointer
Most of the invalid usages due to the conversion from uintptr to
unsafe.Pointer. In general, unsafe.Pointer(p) where p of type uintptr is
considered unsafe.

To fix that, use &p instead of p, then introduce another dereference.
Example, the invalid usage:

	*(*int)(unsafe.Pointer(p)) = int(v)

wil become:

	**(**int)(unsafe.Pointer(&p)) = int(v)

Closes #53
2020-11-16 20:37:12 +07:00
Cuong Manh Le e58b1eabaf
Remove all usages of reflect.SliceHeader
There're some problem with current usage of reflect.SliceHeader.

First, it violates the unsafe pointer conversion (rule 6th), that said,
reflect.SliceHeader must not used as plain struct.

Second, the lowest version that go-json supports, go1.12, reflect
package did not use SliceHeader in typedslicecopy, but use the safety
version. There's no reason that go-json continue using them.

See:

 - https://golang.org/pkg/unsafe/#Pointer
 - https://github.com/golang/go/blob/release-branch.go1.12/src/reflect/value.go#L2702
2020-11-16 20:33:49 +07:00
Masaaki Goshima 71cddb3168
Merge pull request #57 from goccy/feature/fix-anonymous-fields
Fix recursive anonymous field
2020-11-16 21:34:34 +09:00
Masaaki Goshima 3e1a1ac1ad Fix recursive anonymous field 2020-11-16 21:28:33 +09:00
Masaaki Goshima fda849e8f0
Merge pull request #56 from goccy/feature/fix-handling-of-delimiter
Fix handling of comma as delimiter
2020-11-16 21:22:11 +09:00
Masaaki Goshima 4994bc5d04 Fix handling of comma as delimiter
Conflicts:
	encode_vm.go
2020-11-16 19:16:45 +09:00
Masaaki Goshima 897345da64
Merge pull request #54 from zchee/format-opcode
Format opcode
2020-11-13 13:31:47 +09:00
Koichi Shiraishi 0f18f3fed2
Generate 2020-11-13 00:27:11 +09:00
Koichi Shiraishi 740b951cb5
cmd/generator: format output source 2020-11-13 00:25:57 +09:00
Masaaki Goshima 09fe33f8f0
Merge pull request #51 from goccy/feature/improve-performance
Improve performance of encodeEscapedString
2020-09-26 23:20:32 +09:00
Masaaki Goshima 2840955164 Improve performance of encodeEscapedString 2020-09-26 23:18:33 +09:00
Masaaki Goshima d373a4b7d7
Merge pull request #50 from goccy/feature/fix-pointer-fields
Fix encoding of pointer fields ( primitive type )
2020-09-17 21:54:03 +09:00
Masaaki Goshima 9351afdb88 Fix pointer fields 2020-09-17 21:50:27 +09:00
Masaaki Goshima 66b8cb792a Keep reference of interface value 2020-09-17 21:48:39 +09:00
Masaaki Goshima 024abcd29d
Merge pull request #49 from goccy/feature/fix-stream-encoding
Fix stream encoding
2020-09-17 10:55:39 +09:00
Masaaki Goshima 067d4c541c Fix test case 2020-09-17 10:53:39 +09:00
Masaaki Goshima d76012422a Fix stream encoding 2020-09-17 01:26:39 +09:00
Masaaki Goshima 043377d3df
Merge pull request #48 from goccy/feature/remove-unused-operation
Remove unused operation ( RootMap )
2020-09-16 18:52:36 +09:00
Masaaki Goshima 2b5effab31 Remove unused operation ( RootMap ) 2020-09-16 18:49:47 +09:00
Masaaki Goshima c4078a9525
Merge pull request #47 from goccy/feature/support-sorted-map
Support sorted map and change default behavior encoding for map type
2020-09-16 18:39:24 +09:00
Masaaki Goshima 40448a1cfe Add option.go 2020-09-16 18:23:43 +09:00
Masaaki Goshima e1240f02fb Remove unused variable ( headPos ) 2020-09-16 18:17:17 +09:00
Masaaki Goshima aaea586778 Enable switch map processing at runtime 2020-09-16 18:15:47 +09:00
Masaaki Goshima 898d58b8b8 Supported sorted map 2020-09-16 14:51:37 +09:00
Masaaki Goshima 5c3efd11af Add opcode for sorted map 2020-09-16 01:23:36 +09:00
Masaaki Goshima fd37152010
Merge pull request #46 from goccy/feature/fix-recursive-call
Fix encoding for recursive struct
2020-09-15 23:44:22 +09:00
Masaaki Goshima 11e88dc8d0 Add benchmark 2020-09-15 23:40:31 +09:00
Masaaki Goshima 92fb386db5 Optimize encoding for byteSlice type 2020-09-15 23:22:35 +09:00
Masaaki Goshima 6cac23acc3 Remove unused condition 2020-09-15 20:48:32 +09:00
Masaaki Goshima e9e9aa8874 Use next code index for recursive call 2020-09-15 20:48:16 +09:00
Masaaki Goshima acee1ef8ba Refactor errUnsupportedValue 2020-09-15 20:48:02 +09:00
Masaaki Goshima 2e7a990bbb Copy original opcode before caching 2020-09-15 20:47:41 +09:00
Masaaki Goshima 836dec04e6
Update README.md 2020-09-09 17:11:28 +09:00
Masaaki Goshima eb088b8b76
Merge pull request #45 from goccy/feature/update-encode-engine
Upgrade encoding engine to the 2nd generation
2020-09-04 21:53:15 +09:00
Masaaki Goshima 91a2768d1a Revert json_test.go 2020-09-04 21:46:16 +09:00
Masaaki Goshima 02e04238a2 Add keepRefs field 2020-09-04 20:28:27 +09:00
Masaaki Goshima 3e4e83bf34 Save iter value 2020-09-04 19:33:46 +09:00
Masaaki Goshima f297c99af1 Remove unused arguments 2020-09-04 13:53:25 +09:00
Masaaki Goshima 3a3122c286 Add opStructFieldRecursiveEnd 2020-09-04 13:48:21 +09:00
Masaaki Goshima efcf2dec06 Refactor 2020-09-03 22:05:46 +09:00
Masaaki Goshima 34b662b98e Add InterfaceEnd operation 2020-09-03 15:36:11 +09:00
Masaaki Goshima 4f4060f808 Fix index number 2020-09-01 23:23:07 +09:00
Masaaki Goshima 18a6e4cffe Remove codePool 2020-09-01 22:39:20 +09:00
Masaaki Goshima 3aa921e884 Fix encoding engine 2020-09-01 22:26:26 +09:00
Masaaki Goshima 72bc598dd4 Remove state variables from opcode 2020-08-31 21:59:22 +09:00
Masaaki Goshima a6276c4d8e Optimize opcode.idx and seenPtr 2020-08-31 03:14:37 +09:00
Masaaki Goshima 572d4842a5 Reset seenPtr 2020-08-31 00:14:32 +09:00