Changeset 46202 in webkit for trunk/JavaScriptCore/assembler/X86Assembler.h
- Timestamp:
- Jul 21, 2009, 5:37:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/assembler/X86Assembler.h
r46059 r46202 1368 1368 1369 1369 char* code = reinterpret_cast<char*>(m_formatter.data()); 1370 patchRel32(code + from.m_offset, code + to.m_offset);1370 setRel32(code + from.m_offset, code + to.m_offset); 1371 1371 } 1372 1372 … … 1375 1375 ASSERT(from.m_offset != -1); 1376 1376 1377 patchRel32(reinterpret_cast<char*>(code) + from.m_offset, to);1377 setRel32(reinterpret_cast<char*>(code) + from.m_offset, to); 1378 1378 } 1379 1379 … … 1382 1382 ASSERT(from.m_offset != -1); 1383 1383 1384 patchRel32(reinterpret_cast<char*>(code) + from.m_offset, to);1385 } 1386 1387 #if PLATFORM(X86_64) 1388 static void patchPointerForCall(void* where, void* value)1384 setRel32(reinterpret_cast<char*>(code) + from.m_offset, to); 1385 } 1386 1387 #if PLATFORM(X86_64) 1388 static void linkPointerForCall(void* where, void* value) 1389 1389 { 1390 1390 reinterpret_cast<void**>(where)[-1] = value; … … 1392 1392 #endif 1393 1393 1394 static void patchPointer(void* code, JmpDst where, void* value)1394 static void linkPointer(void* code, JmpDst where, void* value) 1395 1395 { 1396 1396 ASSERT(where.m_offset != -1); 1397 1397 1398 patchPointer(reinterpret_cast<char*>(code) + where.m_offset, value);1398 setPointer(reinterpret_cast<char*>(code) + where.m_offset, value); 1399 1399 } 1400 1400 … … 1402 1402 { 1403 1403 ExecutableAllocator::MakeWritable unprotect(reinterpret_cast<char*>(from) - sizeof(int32_t), sizeof(int32_t)); 1404 patchRel32(from, to);1404 setRel32(from, to); 1405 1405 } 1406 1406 … … 1408 1408 { 1409 1409 ExecutableAllocator::MakeWritable unprotect(reinterpret_cast<char*>(from) - sizeof(int32_t), sizeof(int32_t)); 1410 patchRel32(from, to);1410 setRel32(from, to); 1411 1411 } 1412 1412 … … 1414 1414 { 1415 1415 ExecutableAllocator::MakeWritable unprotect(reinterpret_cast<char*>(where) - sizeof(int32_t), sizeof(int32_t)); 1416 patchInt32(where, value);1416 setInt32(where, value); 1417 1417 } 1418 1418 … … 1420 1420 { 1421 1421 ExecutableAllocator::MakeWritable unprotect(reinterpret_cast<char*>(where) - sizeof(void*), sizeof(void*)); 1422 patchPointer(where, value);1422 setPointer(where, value); 1423 1423 } 1424 1424 … … 1478 1478 private: 1479 1479 1480 static void patchPointer(void* where, void* value)1480 static void setPointer(void* where, void* value) 1481 1481 { 1482 1482 reinterpret_cast<void**>(where)[-1] = value; 1483 1483 } 1484 1484 1485 static void patchInt32(void* where, int32_t value)1485 static void setInt32(void* where, int32_t value) 1486 1486 { 1487 1487 reinterpret_cast<int32_t*>(where)[-1] = value; 1488 1488 } 1489 1489 1490 static void patchRel32(void* from, void* to)1490 static void setRel32(void* from, void* to) 1491 1491 { 1492 1492 intptr_t offset = reinterpret_cast<intptr_t>(to) - reinterpret_cast<intptr_t>(from); 1493 1493 ASSERT(offset == static_cast<int32_t>(offset)); 1494 1494 1495 patchInt32(from, offset);1495 setInt32(from, offset); 1496 1496 } 1497 1497
Note:
See TracChangeset
for help on using the changeset viewer.