Home
last modified time | relevance | path

Searched full:bytes (Results 1 – 25 of 470) sorted by relevance

12345678910>>...19

/arkcompiler/runtime_core/static_core/libpandafile/
Dfile_writer.cpp23 bool MemoryWriter::WriteBytes(const std::vector<uint8_t> &bytes) in WriteBytes() argument
25 if (bytes.empty()) { in WriteBytes()
29 checksum_ = adler32(checksum_, bytes.data(), bytes.size()); in WriteBytes()
31 data_.insert(data_.end(), bytes.cbegin(), bytes.cend()); in WriteBytes()
40 bool MemoryBufferWriter::WriteBytes(const std::vector<uint8_t> &bytes) in WriteBytes() argument
42 if (bytes.empty()) { in WriteBytes()
46 checksum_ = adler32(checksum_, bytes.data(), bytes.size()); in WriteBytes()
48 auto subSp = sp_.SubSpan(offset_, bytes.size()); in WriteBytes()
49 if (memcpy_s(subSp.data(), subSp.size(), bytes.data(), bytes.size()) != 0) { in WriteBytes()
52 offset_ += bytes.size(); in WriteBytes()
[all …]
/arkcompiler/ets_frontend/merge_abc/protos/
DassemblyFunction.proto28 bytes wholeLine = 1;
29 bytes exceptionRecord = 2;
30 bytes tryBeginLabel = 3;
31 bytes tryEndLabel = 4;
32 bytes catchBeginLabel = 5;
33 bytes catchEndLabel = 6;
38 bytes key = 1;
42 bytes key = 1;
47 repeated bytes tryCatchOrder = 3;
57 bytes key = 1;
[all …]
DassemblyProgram.proto26 bytes key = 1;
30 bytes key = 1;
34 bytes key = 1;
35 repeated bytes value = 2;
38 bytes key = 1;
46 repeated bytes strings = 6;
DassemblyDebug.proto22 bytes wholeLine = 3;
28 bytes name = 1;
29 bytes signature = 2;
30 bytes signatureType = 3;
/arkcompiler/runtime_core/static_core/libziparchive/extractortool/
Dzip_file.h40 // local file header signature 4 bytes (0x04034b50)
41 // version needed to extract 2 bytes
42 // general purpose bit flag 2 bytes
43 // compression method 2 bytes 10
44 // last mod file time 2 bytes
45 // last mod file date 2 bytes
46 // crc-32 4 bytes
47 // compressed size 4 bytes 22
48 // uncompressed size 4 bytes
49 // file name length 2 bytes
[all …]
/arkcompiler/ets_runtime/ecmascript/extractortool/src/
Dzip_file.h38 // local file header signature 4 bytes (0x04034b50)
39 // version needed to extract 2 bytes
40 // general purpose bit flag 2 bytes
41 // compression method 2 bytes 10
42 // last mod file time 2 bytes
43 // last mod file date 2 bytes
44 // crc-32 4 bytes
45 // compressed size 4 bytes 22
46 // uncompressed size 4 bytes
47 // file name length 2 bytes
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/
DTextEncoderTest.ets52 const bytes = enc.encodeInto(str);
54 …assertTrue(NumberEqual(bytes[i], str[i]), "expected equality failed: " + bytes[i] + "===" + str[i]…
62 const bytes = enc.encodeInto(str);
63 assertEQ(bytes[0], 72);
64 assertEQ(bytes[3], 0);
70 const bytes = enc.encodeInto('He');
71 assertEQ(bytes[0], 72);
72 assertEQ(bytes[3], 0);
78 const bytes = enc.encodeInto('Hello world');
79 assertEQ(bytes[0], 0);
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/06.contexts_and_conversions/05.implicit_conversions/02.widening_primitive_conversions/
Dbytetolong.ets20 function bytesToLong(bytes: Uint8Array): bigint {
21 if (bytes.length !== 8) {
22 throw new Error("Byte array must be exactly 8 bytes long");
28 for (let i = 0; i < bytes.length; i++) {
29 dataView.setUint8(i, bytes[i]);
36 const bytes = new Uint8Array([0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08]);
38 const result = bytesToLong(bytes);
Dbytetofloat.ets20 function bytesToFloat(bytes: Uint8Array): number {
21 if (bytes.length !== 4) {
22 throw new Error("Byte array must be exactly 4 bytes long");
28 for (let i = 0; i < bytes.length; i++) {
29 dataView.setUint8(i, bytes[i]);
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_func_tests/escompat/
DArrayBufferTest3.ets41 function checkCreatedArrayBuffer(a: ArrayBuffer, bytes: FixedArray<byte>): void {
42 assertEQ(a.byteLength, bytes.length)
46 for (let idx = 0; idx < bytes.length; idx++) {
47 assertEQ(bytes[idx], a.at(idx))
55 let bytes : FixedArray<byte> = new byte[0]
56 let a = ArrayBuffer.from(bytes)
57 checkCreatedArrayBuffer(a, bytes)
59 bytes = [1, 2, 3]
60 a = ArrayBuffer.from(bytes)
61 checkCreatedArrayBuffer(a, bytes)
[all …]
/arkcompiler/ets_runtime/ecmascript/trampoline/aarch64/
Draw_asm_stub.S55 | x30 | (8 bytes) // SP + 168
56 | x29 | (8 bytes) // SP + 160
58 | x1 | (8 bytes) // SP + 152
59 | x0 | (8 bytes) // SP + 144
61 | x27/x28 | (16 bytes) // SP + 128
62 | x25/x26 | (16 bytes) // SP + 112
63 | x23/x24 | (16 bytes) // SP + 96
64 | x21/x22 | (16 bytes) // SP + 80
65 | x19/x20 | (16 bytes) // SP + 64
66 | d14/d15 | (16 bytes) // SP + 48
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/stdlib/escompat/
DBigInt.ets54 private readonly bytes: FixedArray<int>
96 …this.bytes = this.sign == 0 ? [] as FixedArray<int> : BigInt.fromLongHelper(d.toLong(), 8, this.si…
101 …this.bytes = this.sign == 0 ? [] as FixedArray<int> : BigInt.fromLongHelper(d.toLong(), 16, this.s…
106 …this.bytes = this.sign == 0 ? [] as FixedArray<int> : BigInt.fromLongHelper(d.toLong(), 32, this.s…
111 … this.bytes = this.sign == 0 ? [] as FixedArray<int> : BigInt.fromLongHelper(d, 64, this.sign)
116 // i.e. like this: this.bytes = BigInt.fromLongHelper(d as long, 64)
123 this.bytes = a[0] as FixedArray<int>
130 this.bytes = this.sign == 0
136 this(d.bytes, d.sign)
140 this.bytes = BigInt.stripLeadingZeros(v)
[all …]
DDataView.ets21 /** Count of bytes in a view */
54 * @param byteLength lenth of bytes to take
72 * @param byteLength lenth of bytes to take
81 * Read bytes as they represent given type
90 * Sets bytes as they represent given type
98 * Read bytes as they represent given type
107 * Sets bytes as they represent given type
155 * Read bytes as they represent given type
164 * Sets bytes as they represent given type
172 * Read bytes as they represent given type
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/runtime/intrinsics/helpers/
Darray_buffer_helper.cpp187 constexpr size_t K_UTF16_BYTES_PER_CHAR = 2; // Number of bytes per UTF-16 character.
232 PandaVector<uint8_t> bytes; in BytesFromString() local
233 bytes.assign(input.begin(), input.end()); in BytesFromString()
234 return bytes; in BytesFromString()
237 PandaString StringFromBytes(const PandaVector<uint8_t> &bytes) in StringFromBytes() argument
239 return PandaString(bytes.begin(), bytes.end()); in StringFromBytes()
244 PandaVector<uint8_t> bytes; in MaskBytes() local
245 bytes.resize(input.size()); in MaskBytes()
247 bytes[i] = static_cast<uint8_t>(static_cast<unsigned char>(input[i]) & mask); in MaskBytes()
249 return bytes; in MaskBytes()
[all …]
Darray_buffer_helper.h72 PandaString ConvertUtf8Encoding(const PandaVector<uint8_t> &bytes);
74 PandaString ConvertUtf16Encoding(const PandaVector<uint8_t> &bytes);
76 PandaString ConvertBase64Encoding(const PandaVector<uint8_t> &bytes, std::string_view encoding);
78 PandaString ConvertHexEncoding(const PandaVector<uint8_t> &bytes);
80 PandaString ConvertLatinEncoding(const PandaVector<uint8_t> &bytes);
84 /// @brief Calculates the number of bytes required to represent the string in the given encoding.
/arkcompiler/ets_runtime/test/moduletest/string/
Dstring.js436 let srcutf8 = "1234567812345678123456781234567812345678123456781234567812345678"; // bytes == 64
437 let srcutf16 = "一二三四五六七八一二三四五六七八一二三四五六七八一二三四五六七八"; // bytes == 64
439 print(srcutf8.slice(0, 0)); // bytes == 0
440 print(srcutf8.slice(64, 64)); // bytes == 0
441 print(srcutf8.slice(0, 6)); // bytes < 8
442 print(srcutf8.slice(0, 8)); // bytes == 8
443 print(srcutf8.slice(0, 14)); // bytes < 16
444 print(srcutf8.slice(0, 16)); // bytes == 16
445 print(srcutf8.slice(0, 21)); // bytes > 16 && bytes % 16 != 0
446 print(srcutf8.slice(0, 24)); // bytes == 3 * 8
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/debugger/src/overwrites/
Dwsproto_handshake.py35 item: Union[Tuple[bytes, bytes], Tuple[str, str]], argument
36 ) -> Union[Tuple[bytes, bytes], Tuple[str, str]]:
42 … headers: Union[List[Tuple[bytes, bytes]], List[Tuple[str, str]]] = kwargs.get("headers", None)
/arkcompiler/toolchain/websocket/
Dhandshake_helper.cpp23 std::array<unsigned char, SEC_WEBSOCKET_KEY_BYTES_LEN> bytes {}; in GenerateRandomSecWSKey() local
24 if (RAND_bytes(bytes.data(), bytes.size()) != 1) { in GenerateRandomSecWSKey()
25 LOGE("RAND_bytes failed to generate secure random bytes"); in GenerateRandomSecWSKey()
31 int encodedBytes = EVP_EncodeBlock(encoded.data(), bytes.data(), SEC_WEBSOCKET_KEY_BYTES_LEN); in GenerateRandomSecWSKey()
33 …LOGE("EVP_EncodeBlock failed to encode Sec-WebSocket-Key bytes, encodedBytes = %{public}d", encode… in GenerateRandomSecWSKey()
70 // "EVP_EncodeBlock() returns the number of bytes encoded excluding the NUL terminator." in EncodeKey()
72 LOGE("EVP_EncodeBlock failed to encode all bytes, encodedBytes = %{public}d", encodedBytes); in EncodeKey()
/arkcompiler/runtime_core/libpandafile/
Dfile_writer.cpp48 bool FileWriter::WriteBytes(const std::vector<uint8_t> &bytes) in WriteBytes() argument
50 if (UNLIKELY(bytes.empty())) { in WriteBytes()
55 checksum_ = adler32(checksum_, bytes.data(), bytes.size()); in WriteBytes()
58 buffer_.insert(buffer_.end(), bytes.begin(), bytes.end()); in WriteBytes()
Dfile_writer.h37 virtual bool WriteBytes(const std::vector<uint8_t> &bytes) = 0;
119 bool WriteBytes(const std::vector<uint8_t> &bytes) override in WriteBytes() argument
121 data_.insert(data_.end(), bytes.cbegin(), bytes.cend()); in WriteBytes()
154 bool WriteBytes(const std::vector<uint8_t> &bytes) override in WriteBytes() argument
156 if (bytes.empty()) { in WriteBytes()
160 auto sub_sp = sp_.SubSpan(offset_, bytes.size()); in WriteBytes()
161 if (memcpy_s(sub_sp.data(), sub_sp.size(), bytes.data(), bytes.size()) != 0) { in WriteBytes()
164 offset_ += bytes.size(); in WriteBytes()
211 bool WriteBytes(const std::vector<uint8_t> &bytes) override;
/arkcompiler/runtime_core/static_core/runtime/fibers/arch/amd64/
Dcontext_layout.h24 * GPRs: 9 x 8 = 72 bytes (RBX, RBP, 12, 13, 14, 15, RDI, RIP, RSP)
25 * Padding: 8 bytes
26 * FPENV: 28 bytes
27 * Padding: 4 bytes
28 * MXCSR: 4 bytes
29 * Padding: 12 bytes
30 * == TOTAL: 128 bytes ==
/arkcompiler/ets_runtime/ecmascript/mem/
Dmachine_code.h76 // | MarkWord | 8 bytes
78 // | machine payload size | 4 bytes
80 // | instructions size | 4 bytes
82 // | instructions addr | 8 bytes (if JitFort enabled)
84 // | nativePcOffsetTable size | 4 bytes
86 // | func addr | 8 bytes
88 // | fp deltaprevframe sp | 8 bytes
90 // | func size | 4 bytes
92 // | callee register num | 4 bytes
94 // | | 64 * 4 bytes (AMD64 or ARM64)
[all …]
/arkcompiler/runtime_core/bytecode_optimizer/tests/benchmark/
DREADME.md53 Average sizes (in bytes):
65 Minimum sizes (in bytes):
77 Maximum sizes (in bytes):
161 Total code_item section size of baseline files: 9201 bytes
162 Total code_item section size of compared files: 9162 bytes
163 Difference: 39 bytes [0.42%]
174 Total code_item section size of baseline files: 8784 bytes
175 Total code_item section size of compared files: 8745 bytes
176 Difference: 39 bytes [0.44%]
/arkcompiler/runtime_core/static_core/bytecode_optimizer/tests/benchmark/
DREADME.md53 Average sizes (in bytes):
65 Minimum sizes (in bytes):
77 Maximum sizes (in bytes):
161 Total code_item section size of baseline files: 9201 bytes
162 Total code_item section size of compared files: 9162 bytes
163 Difference: 39 bytes [0.42%]
174 Total code_item section size of baseline files: 8784 bytes
175 Total code_item section size of compared files: 8745 bytes
176 Difference: 39 bytes [0.44%]
/arkcompiler/runtime_core/static_core/plugins/ets/sdk/api/
D@ohos.buffer.ets149 * Allocates a new Buffer using an array of bytes in the range 0 – 255.
152 * @param {number[]} array - An array of bytes in the range 0 – 255
164 * @param {number} [length=arrayBuffer.byteLength - byteOffset] - Number of bytes to expose
232 * for the encoding that is used to convert the string into bytes.
236 * @returns {number} The number of bytes contained within `string`
287 …* Allocates a new Buffer for a fixed size bytes. If fill is undefined, the Buffer will be zero-fil…
317 * Allocates a new Buffer for a fixed size bytes. The Buffer will not be initially filled.
333 …* Allocates a new un-pooled Buffer for a fixed size bytes. The Buffer will not be initially filled.
521 * A class representing a fixed-length sequence of bytes.
531 * Gets the length of the buffer in bytes
[all …]

12345678910>>...19