Changeset 220184 in webkit
- Timestamp:
- Aug 2, 2017, 10:48:59 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
llint/LLIntOfflineAsmConfig.h (modified) (2 diffs)
-
llint/LowLevelInterpreter64.asm (modified) (9 diffs)
-
offlineasm/ast.rb (modified) (1 diff)
-
offlineasm/x86.rb (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r220175 r220184 1 2017-08-02 Filip Pizlo <fpizlo@apple.com> 2 3 LLInt should do pointer caging 4 https://bugs.webkit.org/show_bug.cgi?id=175036 5 6 Reviewed by Keith Miller. 7 8 Implementing this in the LLInt was challenging because offlineasm did not previously know 9 how to load from globals. This teaches it how to do that on Darwin/x86_64, which happens 10 to be where the Gigacage is enabled right now. 11 12 * llint/LLIntOfflineAsmConfig.h: 13 * llint/LowLevelInterpreter64.asm: 14 * offlineasm/ast.rb: 15 * offlineasm/x86.rb: 16 1 17 2017-08-02 Filip Pizlo <fpizlo@apple.com> 2 18 -
trunk/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
r218794 r220184 28 28 #include "LLIntCommon.h" 29 29 #include <wtf/Assertions.h> 30 #include <wtf/Gigacage.h> 30 31 31 32 #if !ENABLE(JIT) … … 165 166 #define OFFLINE_ASM_EXECUTION_TRACING 0 166 167 #endif 168 169 #define OFFLINE_ASM_GIGACAGE_ENABLED GIGACAGE_ENABLED -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
r220118 r220184 377 377 end 378 378 379 macro loadCaged(source, dest, scratch) 380 loadp source, dest 381 if GIGACAGE_ENABLED and not C_LOOP 382 loadp _g_gigacageBasePtr, scratch 383 btpz scratch, .done 384 andp constexpr GIGACAGE_MASK, dest 385 addp scratch, dest 386 .done: 387 end 388 end 389 379 390 macro loadVariable(operand, value) 380 391 loadisFromInstruction(operand, value) … … 1199 1210 macro loadPropertyAtVariableOffset(propertyOffsetAsInt, objectAndStorage, value) 1200 1211 bilt propertyOffsetAsInt, firstOutOfLineOffset, .isInline 1201 # FIXME: Should do caging 1202 # https://bugs.webkit.org/show_bug.cgi?id=175036 1203 loadp JSObject::m_butterfly[objectAndStorage], objectAndStorage 1212 loadCaged(JSObject::m_butterfly[objectAndStorage], objectAndStorage, value) 1204 1213 negi propertyOffsetAsInt 1205 1214 sxi2q propertyOffsetAsInt, propertyOffsetAsInt … … 1212 1221 1213 1222 1214 macro storePropertyAtVariableOffset(propertyOffsetAsInt, objectAndStorage, value )1223 macro storePropertyAtVariableOffset(propertyOffsetAsInt, objectAndStorage, value, scratch) 1215 1224 bilt propertyOffsetAsInt, firstOutOfLineOffset, .isInline 1216 # FIXME: Should do caging 1217 # https://bugs.webkit.org/show_bug.cgi?id=175036 1218 loadp JSObject::m_butterfly[objectAndStorage], objectAndStorage 1225 loadCaged(JSObject::m_butterfly[objectAndStorage], objectAndStorage, scratch) 1219 1226 negi propertyOffsetAsInt 1220 1227 sxi2q propertyOffsetAsInt, propertyOffsetAsInt … … 1292 1299 btiz t2, IndexingShapeMask, .opGetArrayLengthSlow 1293 1300 loadisFromInstruction(1, t1) 1294 # FIXME: Should do caging 1295 # https://bugs.webkit.org/show_bug.cgi?id=175036 1296 loadp JSObject::m_butterfly[t3], t0 1301 loadCaged(JSObject::m_butterfly[t3], t0, t2) 1297 1302 loadi -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0], t0 1298 1303 bilt t0, 0, .opGetArrayLengthSlow … … 1441 1446 loadConstantOrVariable(t1, t2) 1442 1447 loadisFromInstruction(5, t1) 1443 storePropertyAtVariableOffset(t1, t0, t2 )1448 storePropertyAtVariableOffset(t1, t0, t2, t3) 1444 1449 writeBarrierOnOperands(1, 3) 1445 1450 dispatch(constexpr op_put_by_id_length) … … 1477 1482 loadConstantOrVariableInt32(t3, t1, .opGetByValSlow) 1478 1483 sxi2q t1, t1 1479 # FIXME: Should do caging 1480 # https://bugs.webkit.org/show_bug.cgi?id=175036 1481 loadp JSObject::m_butterfly[t0], t3 1484 loadCaged(JSObject::m_butterfly[t0], t3, t5) 1482 1485 andi IndexingShapeMask, t2 1483 1486 bieq t2, Int32Shape, .opGetByValIsContiguous … … 1526 1529 1527 1530 # Sweet, now we know that we have a typed array. Do some basic things now. 1528 # FIXME: Should do caging 1529 # https://bugs.webkit.org/show_bug.cgi?id=175036 1530 loadp JSArrayBufferView::m_vector[t0], t3 1531 loadCaged(JSArrayBufferView::m_vector[t0], t3, t5) 1531 1532 biaeq t1, JSArrayBufferView::m_length[t0], .opGetByValSlow 1532 1533 … … 1619 1620 loadConstantOrVariableInt32(t0, t3, .opPutByValSlow) 1620 1621 sxi2q t3, t3 1621 # FIXME: Should do caging 1622 # https://bugs.webkit.org/show_bug.cgi?id=175036 1623 loadp JSObject::m_butterfly[t1], t0 1622 loadCaged(JSObject::m_butterfly[t1], t0, t5) 1624 1623 andi IndexingShapeMask, t2 1625 1624 bineq t2, Int32Shape, .opPutByValNotInt32 … … 2239 2238 loadConstantOrVariable(t1, t2) 2240 2239 loadisFromInstruction(6, t1) 2241 storePropertyAtVariableOffset(t1, t0, t2 )2240 storePropertyAtVariableOffset(t1, t0, t2, t3) 2242 2241 end 2243 2242 -
trunk/Source/JavaScriptCore/offlineasm/ast.rb
r220047 r220184 929 929 $asm.putGlobalAnnotation 930 930 when "emit" 931 $asm.puts "#{operands[0].dump}"931 $asm.puts "#{operands[0].dump}" 932 932 else 933 933 raise "Unhandled opcode #{opcode} at #{codeOriginString}" -
trunk/Source/JavaScriptCore/offlineasm/x86.rb
r206759 r220184 248 248 end 249 249 250 class Node 251 def x86LoadOperand(type, dst) 252 x86Operand(type) 253 end 254 end 255 250 256 class RegisterID 251 257 def supports8BitOnX86 … … 457 463 asmLabel 458 464 end 465 def x86LoadOperand(kind, dst) 466 # FIXME: Implement this on platforms that aren't Mach-O. 467 # https://bugs.webkit.org/show_bug.cgi?id=175104 468 $asm.puts "movq #{asmLabel}@GOTPCREL(%rip), #{dst.x86Operand(:ptr)}" 469 "(#{dst.x86Operand(kind)})" 470 end 459 471 end 460 472 … … 523 535 } 524 536 result.join(", ") 537 end 538 539 def x86LoadOperands(srcKind, dstKind) 540 orderOperands(operands[0].x86LoadOperand(srcKind, operands[1]), operands[1].x86Operand(dstKind)) 525 541 end 526 542 … … 928 944 when "xorq" 929 945 handleX86Op("xor#{x86Suffix(:quad)}", :quad) 930 when "loadi", "storei" 946 when "loadi" 947 $asm.puts "mov#{x86Suffix(:int)} #{x86LoadOperands(:int, :int)}" 948 when "storei" 931 949 $asm.puts "mov#{x86Suffix(:int)} #{x86Operands(:int, :int)}" 932 950 when "loadis" 933 951 if isX64 934 952 if !isIntelSyntax 935 $asm.puts "movslq #{x86 Operands(:int, :quad)}"953 $asm.puts "movslq #{x86LoadOperands(:int, :quad)}" 936 954 else 937 $asm.puts "movsxd #{x86 Operands(:int, :quad)}"955 $asm.puts "movsxd #{x86LoadOperands(:int, :quad)}" 938 956 end 939 957 else 940 $asm.puts "mov#{x86Suffix(:int)} #{x86Operands(:int, :int)}" 941 end 942 when "loadp", "storep" 958 $asm.puts "mov#{x86Suffix(:int)} #{x86LoadOperands(:int, :int)}" 959 end 960 when "loadp" 961 $asm.puts "mov#{x86Suffix(:ptr)} #{x86LoadOperands(:ptr, :ptr)}" 962 when "storep" 943 963 $asm.puts "mov#{x86Suffix(:ptr)} #{x86Operands(:ptr, :ptr)}" 944 when "loadq", "storeq" 964 when "loadq" 965 $asm.puts "mov#{x86Suffix(:quad)} #{x86LoadOperands(:quad, :quad)}" 966 when "storeq" 945 967 $asm.puts "mov#{x86Suffix(:quad)} #{x86Operands(:quad, :quad)}" 946 968 when "loadb" 947 969 if !isIntelSyntax 948 $asm.puts "movzbl #{ orderOperands(operands[0].x86Operand(:byte), operands[1].x86Operand(:int))}"949 else 950 $asm.puts "movzx #{ orderOperands(operands[0].x86Operand(:byte), operands[1].x86Operand(:int))}"970 $asm.puts "movzbl #{x86LoadOperands(:byte, :int)}" 971 else 972 $asm.puts "movzx #{x86LoadOperands(:byte, :int)}" 951 973 end 952 974 when "loadbs" 953 975 if !isIntelSyntax 954 $asm.puts "movsbl #{ orderOperands(operands[0].x86Operand(:byte), operands[1].x86Operand(:int))}"955 else 956 $asm.puts "movsx #{ orderOperands(operands[0].x86Operand(:byte), operands[1].x86Operand(:int))}"976 $asm.puts "movsbl #{x86LoadOperands(:byte, :int)}" 977 else 978 $asm.puts "movsx #{x86LoadOperands(:byte, :int)}" 957 979 end 958 980 when "loadh" 959 981 if !isIntelSyntax 960 $asm.puts "movzwl #{ orderOperands(operands[0].x86Operand(:half), operands[1].x86Operand(:int))}"961 else 962 $asm.puts "movzx #{ orderOperands(operands[0].x86Operand(:half), operands[1].x86Operand(:int))}"982 $asm.puts "movzwl #{x86LoadOperands(:half, :int)}" 983 else 984 $asm.puts "movzx #{x86LoadOperands(:half, :int)}" 963 985 end 964 986 when "loadhs" 965 987 if !isIntelSyntax 966 $asm.puts "movswl #{ orderOperands(operands[0].x86Operand(:half), operands[1].x86Operand(:int))}"967 else 968 $asm.puts "movsx #{ orderOperands(operands[0].x86Operand(:half), operands[1].x86Operand(:int))}"988 $asm.puts "movswl #{x86LoadOperands(:half, :int)}" 989 else 990 $asm.puts "movsx #{x86LoadOperands(:half, :int)}" 969 991 end 970 992 when "storeb"
Note:
See TracChangeset
for help on using the changeset viewer.