Commit Graph

103 Commits

Author SHA1 Message Date
Masaaki Goshima 135a3c0cfb Use NoEscapedString 2021-01-11 19:47:33 +09:00
Masaaki Goshima 06906637f2 Reduce memory usage at compile 2021-01-11 05:16:37 +09:00
Masaaki Goshima 877a86b07e Add indent test cases for float32/float64 types 2021-01-10 14:56:49 +09:00
Masaaki Goshima 2dfee264f0 Add indent test cases for unsigned integer types 2021-01-10 14:24:52 +09:00
Masaaki Goshima 4a005d0c25 Add indent test cases for int16/int32/int64 types 2021-01-10 14:12:17 +09:00
Masaaki Goshima 9f0ff9c509 Add indent test cases for int8 type 2021-01-10 13:46:17 +09:00
Masaaki Goshima 56326bfb35 Add indent test cases for int type 2021-01-10 09:40:38 +09:00
Masaaki Goshima a9396cb5d1 Add string test cases 2021-01-10 01:03:02 +09:00
Masaaki Goshima 3415acf30d Add float32/float64 test cases 2021-01-09 21:08:29 +09:00
Masaaki Goshima 8494277be4 Add unsigned integer test cases 2021-01-09 20:33:55 +09:00
Masaaki Goshima 8d4029d900 Add int32/int64 test cases 2021-01-09 20:14:34 +09:00
Masaaki Goshima b132de9821 Add int8/int16 test cases 2021-01-09 19:55:15 +09:00
Masaaki Goshima a6067697e8 Add coverage_test 2021-01-09 14:24:43 +09:00
Masaaki Goshima bed16416aa Remove unnecessary code 2021-01-09 13:56:33 +09:00
Masaaki Goshima eb6fb3b15d Pass all tests 2021-01-09 13:55:34 +09:00
Masaaki Goshima 2356c0ceab Fix runtime error 2020-12-30 01:29:29 +09:00
Masaaki Goshima 17f7434e93 Add optimized StructEnd operation to vm 2020-12-29 23:17:39 +09:00
Masaaki Goshima b8f43ca445 Optimize HTML escape operation 2020-12-25 22:26:59 +09:00
Masaaki Goshima 5741c733a6 Refactor indent code 2020-12-25 17:03:56 +09:00
Masaaki Goshima f5daa592fa Improve encoding performance 2020-12-25 03:53:48 +09:00
Masaaki Goshima 6c3382dc4e Support multiple pointer 2020-12-23 13:13:34 +09:00
Masaaki Goshima 7e55f41a59 Fix encoding of nil value for opMarshalText 2020-12-23 01:42:49 +09:00
Masaaki Goshima 24aa07e47f Merge branch 'master' of github.com:goccy/go-json into feature/fix-decoder 2020-12-23 01:37:54 +09:00
Masaaki Goshima 16309e2635 Refactor int encoding 2020-12-20 22:59:23 +09:00
Masaaki Goshima 7083274627 Fix initialize seenPtr 2020-12-20 19:08:20 +09:00
Masaaki Goshima 01b439e41e Refactor buffering of encoder for improvement performance 2020-12-20 04:02:03 +09:00
Masaaki Goshima 85577616f8 Support int and uint types as map key type 2020-12-12 18:09:46 +09:00
Masaaki Goshima 59f5713178 Fix double pointer 2020-12-07 10:49:00 +09:00
Masaaki Goshima ee52d7f0ae Fix double pointer 2020-12-07 10:44:24 +09:00
Masaaki Goshima 35395bba60 Keep unsafe.Pointer reference for handling of opInterface 2020-11-18 17:05:27 +09:00
Masaaki Goshima 9802f67a9b Refactor unsupported value error for float64 2020-11-17 15:14:07 +09:00
Masaaki Goshima ea96cc7811 Refactor cast manipulation from uintptr 2020-11-17 15:09:06 +09:00
Masaaki Goshima c79cf6a3f5 Refactor error of marshaler 2020-11-17 15:08:12 +09:00
Masaaki Goshima 69ea157270 Refactor unsupported value for float64 2020-11-17 15:06:05 +09:00
Koichi Shiraishi 96528cbae4
Fix resolve conflict to #55 2020-11-16 23:39:33 +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 3e1a1ac1ad Fix recursive anonymous field 2020-11-16 21:28:33 +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 9351afdb88 Fix pointer fields 2020-09-17 21:50:27 +09:00
Masaaki Goshima d76012422a Fix stream encoding 2020-09-17 01:26:39 +09:00
Masaaki Goshima 2b5effab31 Remove unused operation ( RootMap ) 2020-09-16 18:49:47 +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 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 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