Searched refs:magic (Results 1 - 22 of 22) sorted by relevance

/art/runtime/base/
H A Dfile_magic.cc29 ScopedFd OpenAndReadMagic(const char* filename, uint32_t* magic, std::string* error_msg) { argument
30 CHECK(magic != nullptr);
36 int n = TEMP_FAILURE_RETRY(read(fd.get(), magic, sizeof(*magic)));
37 if (n != sizeof(*magic)) {
38 *error_msg = StringPrintf("Failed to find magic in '%s'", filename);
49 bool IsZipMagic(uint32_t magic) { argument
50 return (('P' == ((magic >> 0) & 0xff)) &&
51 ('K' == ((magic >> 8) & 0xff)));
54 bool IsDexMagic(uint32_t magic) { argument
[all...]
H A Dfile_magic.h27 // Open file and read magic number
28 ScopedFd OpenAndReadMagic(const char* filename, uint32_t* magic, std::string* error_msg);
30 // Check whether the given magic matches a known file type.
31 bool IsZipMagic(uint32_t magic);
32 bool IsDexMagic(uint32_t magic);
/art/compiler/optimizing/
H A Dcode_generator_utils.h26 // Computes the magic number and the shift needed in the div/rem by constant algorithm, as out
27 // arguments `magic` and `shift`
28 void CalculateMagicAndShiftForDivRem(int64_t divisor, bool is_long, int64_t* magic, int* shift);
H A Dcode_generator_utils.cc25 int64_t* magic, int* shift) {
26 // It does not make sense to calculate magic and shift for zero divisor.
32 * The magic number M and shift S can be calculated in the following way:
45 * The magic number M is calculated by
89 *magic = (divisor > 0) ? (quotient2 + 1) : (-quotient2 - 1);
92 *magic = static_cast<int>(*magic);
24 CalculateMagicAndShiftForDivRem(int64_t divisor, bool is_long, int64_t* magic, int* shift) argument
H A Dcode_generator_mips64.cc1993 int64_t magic; local
1997 &magic,
2001 __ LoadConst32(TMP, magic);
2004 if (imm > 0 && magic < 0) {
2006 } else if (imm < 0 && magic > 0) {
2025 __ LoadConst64(TMP, magic);
2028 if (imm > 0 && magic < 0) {
2030 } else if (imm < 0 && magic > 0) {
H A Dcode_generator_x86_64.cc3386 int64_t magic; local
3393 CalculateMagicAndShiftForDivRem(imm, false /* is_long */, &magic, &shift);
3407 __ movl(eax, Immediate(magic));
3410 if (imm > 0 && magic < 0) {
3412 } else if (imm < 0 && magic > 0) {
3441 CalculateMagicAndShiftForDivRem(imm, true /* is_long */, &magic, &shift);
3446 // RAX = magic
3447 codegen_->Load64BitValue(rax, magic);
3449 // RDX:RAX = magic * numerator
3452 if (imm > 0 && magic <
[all...]
H A Dcode_generator_arm64.cc2589 int64_t magic; local
2591 CalculateMagicAndShiftForDivRem(imm, type == Primitive::kPrimLong /* is_long */, &magic, &shift);
2596 // temp = get_high(dividend * magic)
2597 __ Mov(temp, magic);
2605 if (imm > 0 && magic < 0) {
2607 } else if (imm < 0 && magic > 0) {
H A Dcode_generator_mips.cc2347 int64_t magic; local
2349 CalculateMagicAndShiftForDivRem(imm, false /* is_long */, &magic, &shift);
2353 __ LoadConst32(TMP, magic);
2360 if (imm > 0 && magic < 0) {
2362 } else if (imm < 0 && magic > 0) {
H A Dcode_generator_arm.cc2769 int64_t magic; local
2771 CalculateMagicAndShiftForDivRem(imm, false /* is_long */, &magic, &shift);
2773 __ LoadImmediate(temp1, magic);
2776 if (imm > 0 && magic < 0) {
2778 } else if (imm < 0 && magic > 0) {
H A Dcode_generator_x86.cc3305 int64_t magic; local
3307 CalculateMagicAndShiftForDivRem(imm, false /* is_long */, &magic, &shift);
3323 // EAX = magic
3324 __ movl(eax, Immediate(magic));
3326 // EDX:EAX = magic * numerator
3329 if (imm > 0 && magic < 0) {
3332 } else if (imm < 0 && magic > 0) {
/art/test/037-inherit/src/
H A DMain.java10 MagicClass magic = new MagicClass();
12 System.out.print("magic is ");
13 System.out.println(magic.getSomeData());
/art/tools/dexfuzz/src/dexfuzz/rawdex/
H A DHeaderItem.java24 public byte[] magic; field in class:HeaderItem
51 magic = new byte[8];
53 magic[i] = file.readByte();
93 file.writeByte(magic[i]);
/art/tools/
H A Dstream-trace-converter.py79 magic = ReadIntLE(input)
80 if magic != 0x574f4c53:
83 WriteIntLE(body, magic)
/art/runtime/gc/space/
H A Dlarge_object_space_test.cc61 // Fill in our magic value.
62 uint8_t magic = (request_size & 0xFF) | 1; local
63 memset(obj, magic, request_size);
93 uint8_t magic = (request_size & 0xFF) | 1; local
95 ASSERT_EQ(reinterpret_cast<const uint8_t*>(obj)[k], magic);
/art/compiler/
H A Dimage_test.cc513 char* magic = const_cast<char*>(image_header.GetMagic());
514 strcpy(magic, ""); // bad magic
516 strcpy(magic, "art\n000"); // bad version
H A Doat_test.cc463 char* magic = const_cast<char*>(oat_header->GetMagic()); local
464 strcpy(magic, ""); // bad magic
466 strcpy(magic, "oat\n000"); // bad version
H A Doat_writer.cc324 uint32_t magic;
326 ScopedFd fd(OpenAndReadMagic(filename, &magic, &error_msg));
328 PLOG(ERROR) << "Failed to read magic number from dex file: '" << filename << "'";
330 } else if (IsDexMagic(magic)) {
337 } else if (IsZipMagic(magic)) {
1793 LOG(ERROR) << "Invalid magic number in dex file header. " << " File: " << location;
/art/tools/dmtracedump/
H A Dcreatetesttrace.cc37 uint32_t magic; member in struct:DataHeader
346 write4LE(dataFp, header.magic);
H A Dtracedump.cc122 uint32_t magic; member in struct:DataHeader
941 pHeader->magic = read4LE(fp);
/art/runtime/
H A Ddex_file.cc74 uint32_t magic; local
88 ScopedFd fd(OpenAndReadMagic(file_part, &magic, error_msg));
93 if (IsZipMagic(magic)) {
110 if (IsDexMagic(magic)) {
127 uint32_t magic; local
128 ScopedFd fd(OpenAndReadMagic(filename, &magic, error_msg));
133 if (IsZipMagic(magic)) {
136 if (IsDexMagic(magic)) {
161 uint32_t magic; local
163 ScopedFd fd(OpenAndReadMagic(filename, &magic,
495 IsMagicValid(const uint8_t* magic) argument
499 IsVersionValid(const uint8_t* magic) argument
[all...]
H A Ddex_file.h115 // Decode the dex magic version
422 // Checks whether the given file has the dex magic, or is a zip file with a classes.dex entry.
489 // Decode the dex magic version
494 // Returns true if the byte string points to the magic value.
495 static bool IsMagicValid(const uint8_t* magic);
497 // Returns true if the byte string after the magic is the correct value.
498 static bool IsVersionValid(const uint8_t* magic);
1226 // Returns true if the header magic and version numbers are of the expected values.
/art/runtime/hprof/
H A Dhprof.cc640 // U1: NUL-terminated magic string.
641 const char magic[] = "JAVA PROFILE 1.0.3"; local
642 __ AddU1List(reinterpret_cast<const uint8_t*>(magic), sizeof(magic));

Completed in 5075 milliseconds