cloop.rb 40.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
# Copyright (C) 2012 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.

require "config"
require "ast"
require "opt"

# The CLoop llint backend is initially based on the ARMv7 backend, and
# then further enhanced with a few instructions from the x86 backend to
# support building for X64 targets.  Hence, the shape of the generated
# code and the usage convention of registers will look a lot like the
# ARMv7 backend's.

def cloopMapType(type)
    case type
    when :int;            ".i"
    when :uint;           ".u"
    when :int32;          ".i32"
    when :uint32;         ".u32"
40 41
    when :int64;          ".i64"
    when :uint64;         ".u64"
42 43 44 45 46 47 48
    when :int8;           ".i8"
    when :uint8;          ".u8"
    when :int8Ptr;        ".i8p"
    when :voidPtr;        ".vp"
    when :nativeFunc;     ".nativeFunc"
    when :double;         ".d"
    when :castToDouble;   ".castToDouble"
49
    when :castToInt64;    ".castToInt64"
50 51 52 53 54 55 56 57
    when :opcode;         ".opcode"
    else;
        raise "Unsupported type"
    end
end


class SpecialRegister < NoChildren
58
    def clDump
59 60 61 62 63 64 65
        @name
    end
    def clValue(type=:int)
        @name + cloopMapType(type)
    end
end

66
C_LOOP_SCRATCH_FPR = SpecialRegister.new("d6")
67 68

class RegisterID
69 70
    def clDump
        case name
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
        when "a0"
            "a0"
        when "a1"
            "a1"
        when "a2"
            "a2"
        when "a3"
            "a3"
        when "a4"
            "a4"
        when "a5"
            "a5"
        when "a6"
            "a6"
        when "a6"
            "a6"
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
        when "t0"
            "t0"
        when "t1"
            "t1"
        when "t2"
            "t2"
        when "t3"
            "t3"
        when "t4"
            "rPC"
        when "t6"
            "rBasePC"
        when "csr1"
            "tagTypeNumber"
        when "csr2"
            "tagMask"
        when "cfr"
            "cfr"
        when "lr"
            "rRetVPC"
        when "sp"
            "sp"
        else
            raise "Bad register #{name} for C_LOOP at #{codeOriginString}"
        end
    end
113
    def clValue(type=:int)
114
        clDump + cloopMapType(type)
115 116 117 118
    end
end

class FPRegisterID
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
    def clDump
        case name
        when "ft0", "fr"
            "d0"
        when "ft1"
            "d1"
        when "ft2"
            "d2"
        when "ft3"
            "d3"
        when "ft4"
            "d4"
        when "ft5"
            "d5"
        else
            raise "Bad register #{name} for C_LOOP at #{codeOriginString}"
        end
    end
137
    def clValue(type=:int)
138
        clDump + cloopMapType(type)
139 140 141 142
    end
end

class Immediate
143 144 145
    def clDump
        "#{value}"
    end
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
    def clValue(type=:int)
        # There is a case of a very large unsigned number (0x8000000000000000)
        # which we wish to encode.  Unfortunately, the C/C++ compiler
        # complains if we express that number as a positive decimal integer.
        # Hence, for positive values, we just convert the number into hex form
        # to keep the compiler happy.
        #
        # However, for negative values, the to_s(16) hex conversion method does
        # not strip the "-" sign resulting in a meaningless "0x-..." valueStr.
        # To workaround this, we simply don't encode negative numbers as hex.

        valueStr = (value < 0) ? "#{value}" : "0x#{value.to_s(16)}"

        case type
        when :int8;    "int8_t(#{valueStr})"
        when :int32;   "int32_t(#{valueStr})"
162
        when :int64;   "int64_t(#{valueStr})"
163 164 165
        when :int;     "intptr_t(#{valueStr})"
        when :uint8;   "uint8_t(#{valueStr})"
        when :uint32;  "uint32_t(#{valueStr})"
166
        when :uint64;  "uint64_t(#{valueStr})"
167 168 169 170 171 172 173 174
        when :uint;    "uintptr_t(#{valueStr})"
        else
            raise "Not implemented immediate of type: #{type}" 
        end
    end
end

class Address
175 176 177
    def clDump
        "[#{base.clDump}, #{offset.value}]"
    end
178 179 180 181
    def clValue(type=:int)
        case type
        when :int8;         int8MemRef
        when :int32;        int32MemRef
182
        when :int64;        int64MemRef
183 184 185
        when :int;          intMemRef
        when :uint8;        uint8MemRef
        when :uint32;       uint32MemRef
186
        when :uint64;       uint64MemRef
187 188 189 190 191 192 193 194
        when :uint;         uintMemRef
        when :opcode;       opcodeMemRef
        when :nativeFunc;   nativeFuncMemRef
        else
            raise "Unexpected Address type: #{type}"
        end
    end
    def pointerExpr
195
        if  offset.value == 0
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
            "#{base.clValue(:int8Ptr)}"
        elsif offset.value > 0
            "#{base.clValue(:int8Ptr)} + #{offset.value}"
        else
            "#{base.clValue(:int8Ptr)} - #{-offset.value}"
        end
    end
    def int8MemRef
        "*CAST<int8_t*>(#{pointerExpr})"
    end
    def int16MemRef
        "*CAST<int16_t*>(#{pointerExpr})"
    end
    def int32MemRef
        "*CAST<int32_t*>(#{pointerExpr})"
    end
212 213 214
    def int64MemRef
        "*CAST<int64_t*>(#{pointerExpr})"
    end
215 216 217 218 219 220 221 222 223 224 225 226
    def intMemRef
        "*CAST<intptr_t*>(#{pointerExpr})"
    end
    def uint8MemRef
        "*CAST<uint8_t*>(#{pointerExpr})"
    end
    def uint16MemRef
        "*CAST<uint16_t*>(#{pointerExpr})"
    end
    def uint32MemRef
        "*CAST<uint32_t*>(#{pointerExpr})"
    end
227 228 229
    def uint64MemRef
        "*CAST<uint64_t*>(#{pointerExpr})"
    end
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
    def uintMemRef
        "*CAST<uintptr_t*>(#{pointerExpr})"
    end
    def nativeFuncMemRef
        "*CAST<NativeFunction*>(#{pointerExpr})"
    end
    def opcodeMemRef
        "*CAST<Opcode*>(#{pointerExpr})"
    end
    def dblMemRef
        "*CAST<double*>(#{pointerExpr})"
    end
end

class BaseIndex
245 246 247
    def clDump
        "[#{base.clDump}, #{offset.clDump}, #{index.clDump} << #{scaleShift}]"
    end
248 249 250 251
    def clValue(type=:int)
        case type
        when :int8;       int8MemRef
        when :int32;      int32MemRef
252
        when :int64;      int64MemRef
253 254 255
        when :int;        intMemRef
        when :uint8;      uint8MemRef
        when :uint32;     uint32MemRef
256
        when :uint64;     uint64MemRef
257 258 259 260 261 262 263
        when :uint;       uintMemRef
        when :opcode;     opcodeMemRef
        else
            raise "Unexpected BaseIndex type: #{type}"
        end
    end
    def pointerExpr
264
        "#{base.clValue(:int8Ptr)} + (#{index.clValue} << #{scaleShift}) + #{offset.clValue}"
265 266 267 268 269 270 271 272 273 274
    end
    def int8MemRef
        "*CAST<int8_t*>(#{pointerExpr})"
    end
    def int16MemRef
        "*CAST<int16_t*>(#{pointerExpr})"
    end
    def int32MemRef
        "*CAST<int32_t*>(#{pointerExpr})"
    end
275 276 277
    def int64MemRef
        "*CAST<int64_t*>(#{pointerExpr})"
    end
278 279 280 281 282 283 284 285 286 287 288 289
    def intMemRef
        "*CAST<intptr_t*>(#{pointerExpr})"
    end
    def uint8MemRef
        "*CAST<uint8_t*>(#{pointerExpr})"
    end
    def uint16MemRef
        "*CAST<uint16_t*>(#{pointerExpr})"
    end
    def uint32MemRef
        "*CAST<uint32_t*>(#{pointerExpr})"
    end
290 291 292
    def uint64MemRef
        "*CAST<uint64_t*>(#{pointerExpr})"
    end
293 294 295 296 297 298 299 300 301 302 303 304
    def uintMemRef
        "*CAST<uintptr_t*>(#{pointerExpr})"
    end
    def opcodeMemRef
        "*CAST<Opcode*>(#{pointerExpr})"
    end
    def dblMemRef
        "*CAST<double*>(#{pointerExpr})"
    end
end

class AbsoluteAddress
305 306 307
    def clDump
        "#{codeOriginString}"
    end
308
    def clValue
309
        clDump
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358
    end
end


#
# Lea support.
#

class Address
    def cloopEmitLea(destination, type)
        if destination == base
            $asm.putc "#{destination.clValue(:int8Ptr)} += #{offset.clValue(type)};"
        else
            $asm.putc "#{destination.clValue(:int8Ptr)} = #{base.clValue(:int8Ptr)} + #{offset.clValue(type)};"
        end
    end
end

class BaseIndex
    def cloopEmitLea(destination, type)
        raise "Malformed BaseIndex, offset should be zero at #{codeOriginString}" unless offset.value == 0
        $asm.putc "#{destination.clValue(:int8Ptr)} = #{base.clValue(:int8Ptr)} + (#{index.clValue} << #{scaleShift});"
    end
end

#
# Actual lowering code follows.
#

class Sequence
    def getModifiedListC_LOOP
        myList = @list
        
        # Verify that we will only see instructions and labels.
        myList.each {
            | node |
            unless node.is_a? Instruction or
                    node.is_a? Label or
                    node.is_a? LocalLabel or
                    node.is_a? Skip
                raise "Unexpected #{node.inspect} at #{node.codeOrigin}" 
            end
        }
        
        return myList
    end
end

def clOperands(operands)
359
    operands.map{|v| v.clDump}.join(", ")
360 361 362 363
end


def cloopEmitOperation(operands, type, operator)
364 365
    raise unless type == :int || type == :uint || type == :int32 || type == :uint32 || \
        type == :int64 || type == :uint64 || type == :double
366
    if operands.size == 3
367
        $asm.putc "#{operands[2].clValue(type)} = #{operands[0].clValue(type)} #{operator} #{operands[1].clValue(type)};"
368
        if operands[2].is_a? RegisterID and (type == :int32 or type == :uint32)
369
            $asm.putc "#{operands[2].clDump}.clearHighWord();" # Just clear it. It does nothing on the 32-bit port.
370
        end
371 372 373 374
    else
        raise unless operands.size == 2
        raise unless not operands[1].is_a? Immediate
        $asm.putc "#{operands[1].clValue(type)} = #{operands[1].clValue(type)} #{operator} #{operands[0].clValue(type)};"
375
        if operands[1].is_a? RegisterID and (type == :int32 or type == :uint32)
376
            $asm.putc "#{operands[1].clDump}.clearHighWord();" # Just clear it. It does nothing on the 32-bit port.
377
        end
378 379 380 381
    end
end

def cloopEmitShiftOperation(operands, type, operator)
382
    raise unless type == :int || type == :uint || type == :int32 || type == :uint32 || type == :int64 || type == :uint64
383 384
    if operands.size == 3
        $asm.putc "#{operands[2].clValue(type)} = #{operands[1].clValue(type)} #{operator} (#{operands[0].clValue(:int)} & 0x1f);"
385
        if operands[2].is_a? RegisterID and (type == :int32 or type == :uint32)
386
            $asm.putc "#{operands[2].clDump}.clearHighWord();" # Just clear it. It does nothing on the 32-bit port.
387
        end
388 389 390 391
    else
        raise unless operands.size == 2
        raise unless not operands[1].is_a? Immediate
        $asm.putc "#{operands[1].clValue(type)} = #{operands[1].clValue(type)} #{operator} (#{operands[0].clValue(:int)} & 0x1f);"
392
        if operands[1].is_a? RegisterID and (type == :int32 or type == :uint32)
393
            $asm.putc "#{operands[1].clDump}.clearHighWord();" # Just clear it. It does nothing on the 32-bit port.
394 395 396 397 398 399 400 401 402 403
        end
    end
end

def cloopEmitUnaryOperation(operands, type, operator)
    raise unless type == :int || type == :uint || type == :int32 || type == :uint32 || type == :int64 || type == :uint64
    raise unless operands.size == 1
    raise unless not operands[0].is_a? Immediate
    $asm.putc "#{operands[0].clValue(type)} = #{operator}#{operands[0].clValue(type)};"
    if operands[0].is_a? RegisterID and (type == :int32 or type == :uint32)
404
        $asm.putc "#{operands[0].clDump}.clearHighWord();" # Just clear it. It does nothing on the 32-bit port.
405 406 407 408
    end
end

def cloopEmitCompareDoubleWithNaNCheckAndBranch(operands, condition)
409
    $asm.putc "if (std::isnan(#{operands[0].clValue(:double)}) || std::isnan(#{operands[1].clValue(:double)})"
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465
    $asm.putc "    || (#{operands[0].clValue(:double)} #{condition} #{operands[1].clValue(:double)}))"
    $asm.putc "    goto #{operands[2].cLabel};"
end


def cloopEmitCompareAndSet(operands, type, comparator)
    # The result is a boolean.  Hence, it doesn't need to be based on the type
    # of the arguments being compared.
    $asm.putc "#{operands[2].clValue} = (#{operands[0].clValue(type)} #{comparator} #{op2 = operands[1].clValue(type)});"
end


def cloopEmitCompareAndBranch(operands, type, comparator)
    $asm.putc "if (#{operands[0].clValue(type)} #{comparator} #{operands[1].clValue(type)})"
    $asm.putc "    goto #{operands[2].cLabel};"
end


# conditionTest should contain a string that provides a comparator and a RHS
# value e.g. "< 0".
def cloopGenerateConditionExpression(operands, type, conditionTest)
    op1 = operands[0].clValue(type)

    # The operands must consist of 2 or 3 values.
    case operands.size
    when 2 # Just test op1 against the conditionTest.
        lhs = op1
    when 3 # Mask op1 with op2 before testing against the conditionTest.
        lhs = "(#{op1} & #{operands[1].clValue(type)})"
    else
        raise "Expected 2 or 3 operands but got #{operands.size} at #{codeOriginString}"
    end
    
    "#{lhs} #{conditionTest}"
end

# conditionTest should contain a string that provides a comparator and a RHS
# value e.g. "< 0".
def cloopEmitTestAndBranchIf(operands, type, conditionTest, branchTarget)
    conditionExpr = cloopGenerateConditionExpression(operands, type, conditionTest)
    $asm.putc "if (#{conditionExpr})"
    $asm.putc "    goto #{branchTarget};"
end

def cloopEmitTestSet(operands, type, conditionTest)
    # The result is a boolean condition.  Hence, the result type is always an
    # int.  The passed in type is only used for the values being tested in
    # the condition test.
    conditionExpr = cloopGenerateConditionExpression(operands, type, conditionTest)
    $asm.putc "#{operands[-1].clValue} = (#{conditionExpr});"
end

def cloopEmitOpAndBranch(operands, operator, type, conditionTest)
    case type
    when :int;   tempType = "intptr_t"
    when :int32; tempType = "int32_t"
466
    when :int64; tempType = "int64_t"
467 468 469 470 471 472 473 474 475
    else
        raise "Unimplemented type"
    end

    op1 = operands[0].clValue(type)
    op2 = operands[1].clValue(type)

    $asm.putc "{"
    $asm.putc "    #{tempType} temp = #{op2} #{operator} #{op1};"
476
    $asm.putc "    #{op2} = temp;"
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543
    $asm.putc "    if (temp #{conditionTest})"
    $asm.putc "        goto  #{operands[2].cLabel};"
    $asm.putc "}"
end

def cloopAddOverflowTest(operands, type)
    case type
    when :int32
        tempType = "int32_t"
        signBit = "SIGN_BIT32"
    else
        raise "Unimplemented type"
    end

    $asm.putc "    #{tempType} a = #{operands[0].clValue(type)};"
    $asm.putc "    #{tempType} b = #{operands[1].clValue(type)};"
    $asm.putc "    // sign(b) sign(a) | Overflows if:"
    $asm.putc "    // 0       0       | sign(b+a) = 1 (pos + pos != neg)"
    $asm.putc "    // 0       1       | never"
    $asm.putc "    // 1       0       | never"
    $asm.putc "    // 1       1       | sign(b+a) = 0 (neg + neg != pos)"
    "((#{signBit}(b) == #{signBit}(a)) && (#{signBit}(b+a) != #{signBit}(a)))"
end

def cloopSubOverflowTest(operands, type)
    case type
    when :int32
        tempType = "int32_t"
        signBit = "SIGN_BIT32"
    else
        raise "Unimplemented type"
    end

    $asm.putc "    #{tempType} a = #{operands[0].clValue(type)};"
    $asm.putc "    #{tempType} b = #{operands[1].clValue(type)};"
    $asm.putc "    // sign(b) sign(a) | Overflows if:"
    $asm.putc "    // 0       0       | never"
    $asm.putc "    // 0       1       | sign(b-a) = 1 (pos - neg != pos)"
    $asm.putc "    // 1       0       | sign(b-a) = 0 (neg - pos != pos)"
    $asm.putc "    // 1       1       | never"
    "((#{signBit}(b) != #{signBit}(a)) && (#{signBit}(b-a) == #{signBit}(a)))"
end

def cloopMulOverflowTest(operands, type)
    case type
    when :int32
        tempType = "uint32_t"
    else
        raise "Unimplemented type"
    end
    $asm.putc "    #{tempType} a = #{operands[0].clValue(type)};"
    $asm.putc "    #{tempType} b = #{operands[1].clValue(type)};"
    "((b | a) >> 15)"
end

def cloopEmitOpAndBranchIfOverflow(operands, operator, type)
    $asm.putc "{"

    # Emit the overflow test based on the operands and the type:
    case operator
    when "+"; overflowTest = cloopAddOverflowTest(operands, type)
    when "-"; overflowTest = cloopSubOverflowTest(operands, type)
    when "*"; overflowTest = cloopMulOverflowTest(operands, type)
    else
        raise "Unimplemented opeartor"
    end

544
    $asm.putc "    bool didOverflow = #{overflowTest};"
545
    $asm.putc "    #{operands[1].clValue(type)} = #{operands[1].clValue(type)} #{operator} #{operands[0].clValue(type)};"
546 547
    $asm.putc "    if (didOverflow)"
    $asm.putc "        goto #{operands[2].cLabel};"
548 549 550 551 552 553 554 555 556
    $asm.putc "}"
end

# operands: callTarget, currentFrame, currentPC
def cloopEmitCallSlowPath(operands)
    $asm.putc "{"
    $asm.putc "    ExecState* exec = CAST<ExecState*>(#{operands[1].clValue(:voidPtr)});"
    $asm.putc "    Instruction* pc = CAST<Instruction*>(#{operands[2].clValue(:voidPtr)});"
    $asm.putc "    SlowPathReturnType result = #{operands[0].cLabel}(exec, pc);"
557
    $asm.putc "    decodeResult(result, t0.instruction, t1.execState);"
558 559 560 561 562 563
    $asm.putc "}"
end

class Instruction
    def lowerC_LOOP
        $asm.codeOrigin codeOriginString if $enableCodeOriginComments
564
        $asm.annotation annotation if $enableInstrAnnotations && (opcode != "cloopDo")
565 566 567 568

        case opcode
        when "addi"
            cloopEmitOperation(operands, :int32, "+")
569 570
        when "addq"
            cloopEmitOperation(operands, :int64, "+")
571 572 573 574 575
        when "addp"
            cloopEmitOperation(operands, :int, "+")

        when "andi"
            cloopEmitOperation(operands, :int32, "&")
576 577
        when "andq"
            cloopEmitOperation(operands, :int64, "&")
578 579 580 581 582
        when "andp"
            cloopEmitOperation(operands, :int, "&")

        when "ori"
            cloopEmitOperation(operands, :int32, "|")
583 584
        when "orq"
            cloopEmitOperation(operands, :int64, "|")
585 586 587 588 589
        when "orp"
            cloopEmitOperation(operands, :int, "|")

        when "xori"
            cloopEmitOperation(operands, :int32, "^")
590 591
        when "xorq"
            cloopEmitOperation(operands, :int64, "^")
592 593 594 595 596
        when "xorp"
            cloopEmitOperation(operands, :int, "^")

        when "lshifti"
            cloopEmitShiftOperation(operands, :int32, "<<")
597 598
        when "lshiftq"
            cloopEmitShiftOperation(operands, :int64, "<<")
599 600 601 602 603
        when "lshiftp"
            cloopEmitShiftOperation(operands, :int, "<<")

        when "rshifti"
            cloopEmitShiftOperation(operands, :int32, ">>")
604 605
        when "rshiftq"
            cloopEmitShiftOperation(operands, :int64, ">>")
606 607 608 609 610
        when "rshiftp"
            cloopEmitShiftOperation(operands, :int, ">>")

        when "urshifti"
            cloopEmitShiftOperation(operands, :uint32, ">>")
611 612
        when "urshiftq"
            cloopEmitShiftOperation(operands, :uint64, ">>")
613 614 615 616 617
        when "urshiftp"
            cloopEmitShiftOperation(operands, :uint, ">>")

        when "muli"
            cloopEmitOperation(operands, :int32, "*")
618 619
        when "mulq"
            cloopEmitOperation(operands, :int64, "*")
620 621 622 623 624
        when "mulp"
            cloopEmitOperation(operands, :int, "*")

        when "subi"
            cloopEmitOperation(operands, :int32, "-")
625 626
        when "subq"
            cloopEmitOperation(operands, :int64, "-")
627 628 629 630
        when "subp"
            cloopEmitOperation(operands, :int, "-")

        when "negi"
631
            cloopEmitUnaryOperation(operands, :int32, "-")
632
        when "negq"
633
            cloopEmitUnaryOperation(operands, :int64, "-")
634
        when "negp"
635
            cloopEmitUnaryOperation(operands, :int, "-")
636 637

        when "noti"
638
            cloopEmitUnaryOperation(operands, :int32, "!")
639 640

        when "loadi"
641 642 643
            $asm.putc "#{operands[1].clValue(:uint)} = #{operands[0].uint32MemRef};"
            # There's no need to call clearHighWord() here because the above will
            # automatically take care of 0 extension.
644 645
        when "loadis"
            $asm.putc "#{operands[1].clValue(:int)} = #{operands[0].int32MemRef};"
646 647
        when "loadq"
            $asm.putc "#{operands[1].clValue(:int64)} = #{operands[0].int64MemRef};"
648 649 650 651
        when "loadp"
            $asm.putc "#{operands[1].clValue(:int)} = #{operands[0].intMemRef};"
        when "storei"
            $asm.putc "#{operands[1].int32MemRef} = #{operands[0].clValue(:int32)};"
652 653
        when "storeq"
            $asm.putc "#{operands[1].int64MemRef} = #{operands[0].clValue(:int64)};"
654 655 656 657 658 659 660
        when "storep"
            $asm.putc "#{operands[1].intMemRef} = #{operands[0].clValue(:int)};"
        when "loadb"
            $asm.putc "#{operands[1].clValue(:int)} = #{operands[0].uint8MemRef};"
        when "loadbs"
            $asm.putc "#{operands[1].clValue(:int)} = #{operands[0].int8MemRef};"
        when "storeb"
661
            $asm.putc "#{operands[1].uint8MemRef} = #{operands[0].clValue(:int8)};"
662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713
        when "loadh"
            $asm.putc "#{operands[1].clValue(:int)} = #{operands[0].uint16MemRef};"
        when "loadhs"
            $asm.putc "#{operands[1].clValue(:int)} = #{operands[0].int16MemRef};"
        when "storeh"
            $asm.putc "*#{operands[1].uint16MemRef} = #{operands[0].clValue(:int16)};"
        when "loadd"
            $asm.putc "#{operands[1].clValue(:double)} = #{operands[0].dblMemRef};"
        when "stored"
            $asm.putc "#{operands[1].dblMemRef} = #{operands[0].clValue(:double)};"

        when "addd"
            cloopEmitOperation(operands, :double, "+")
        when "divd"
            cloopEmitOperation(operands, :double, "/")
        when "subd"
            cloopEmitOperation(operands, :double, "-")
        when "muld"
            cloopEmitOperation(operands, :double, "*")

        # Convert an int value to its double equivalent, and store it in a double register.
        when "ci2d"
            $asm.putc "#{operands[1].clValue(:double)} = #{operands[0].clValue(:int32)};"
            
        when "bdeq"
            cloopEmitCompareAndBranch(operands, :double, "==")
        when "bdneq"
            cloopEmitCompareAndBranch(operands, :double, "!=")
        when "bdgt"
            cloopEmitCompareAndBranch(operands, :double, ">");
        when "bdgteq"
            cloopEmitCompareAndBranch(operands, :double, ">=");
        when "bdlt"
            cloopEmitCompareAndBranch(operands, :double, "<");
        when "bdlteq"
            cloopEmitCompareAndBranch(operands, :double, "<=");

        when "bdequn"
            cloopEmitCompareDoubleWithNaNCheckAndBranch(operands, "==")
        when "bdnequn"
            cloopEmitCompareDoubleWithNaNCheckAndBranch(operands, "!=")
        when "bdgtun"
            cloopEmitCompareDoubleWithNaNCheckAndBranch(operands, ">")
        when "bdgtequn"
            cloopEmitCompareDoubleWithNaNCheckAndBranch(operands, ">=")
        when "bdltun"
            cloopEmitCompareDoubleWithNaNCheckAndBranch(operands, "<")
        when "bdltequn"
            cloopEmitCompareDoubleWithNaNCheckAndBranch(operands, "<=")

        when "td2i"
            $asm.putc "#{operands[1].clValue(:int)} = #{operands[0].clValue(:double)};"
714
            $asm.putc "#{operands[1].clDump}.clearHighWord();"
715 716 717 718 719

        when "bcd2i"  # operands: srcDbl dstInt slowPath
            $asm.putc "{"
            $asm.putc "    double d = #{operands[0].clValue(:double)};"
            $asm.putc "    const int32_t asInt32 = int32_t(d);"
720
            $asm.putc "    if (asInt32 != d || (!asInt32 && std::signbit(d))) // true for -0.0"
721 722
            $asm.putc "        goto  #{operands[2].cLabel};"
            $asm.putc "    #{operands[1].clValue} = asInt32;"            
723
            $asm.putc "    #{operands[1].clDump}.clearHighWord();"
724 725 726 727
            $asm.putc "}"

        when "move"
            $asm.putc "#{operands[1].clValue(:int)} = #{operands[0].clValue(:int)};"
728 729 730 731
        when "sxi2q"
            $asm.putc "#{operands[1].clValue(:int64)} = #{operands[0].clValue(:int32)};"
        when "zxi2q"
            $asm.putc "#{operands[1].clValue(:uint64)} = #{operands[0].clValue(:uint32)};"
732 733 734 735 736 737
        when "nop"
            $asm.putc "// nop"
        when "bbeq"
            cloopEmitCompareAndBranch(operands, :int8, "==")
        when "bieq"
            cloopEmitCompareAndBranch(operands, :int32, "==")
738 739
        when "bqeq"
            cloopEmitCompareAndBranch(operands, :int64, "==")
740 741 742 743 744 745 746
        when "bpeq"
            cloopEmitCompareAndBranch(operands, :int, "==")

        when "bbneq"
            cloopEmitCompareAndBranch(operands, :int8, "!=")
        when "bineq"
            cloopEmitCompareAndBranch(operands, :int32, "!=")
747 748
        when "bqneq"
            cloopEmitCompareAndBranch(operands, :int64, "!=")
749 750 751 752 753 754 755
        when "bpneq"
            cloopEmitCompareAndBranch(operands, :int, "!=")

        when "bba"
            cloopEmitCompareAndBranch(operands, :uint8, ">")
        when "bia"
            cloopEmitCompareAndBranch(operands, :uint32, ">")
756 757
        when "bqa"
            cloopEmitCompareAndBranch(operands, :uint64, ">")
758 759 760 761 762 763 764
        when "bpa"
            cloopEmitCompareAndBranch(operands, :uint, ">")

        when "bbaeq"
            cloopEmitCompareAndBranch(operands, :uint8, ">=")
        when "biaeq"
            cloopEmitCompareAndBranch(operands, :uint32, ">=")
765 766
        when "bqaeq"
            cloopEmitCompareAndBranch(operands, :uint64, ">=")
767 768 769 770 771 772 773
        when "bpaeq"
            cloopEmitCompareAndBranch(operands, :uint, ">=")

        when "bbb"
            cloopEmitCompareAndBranch(operands, :uint8, "<")
        when "bib"
            cloopEmitCompareAndBranch(operands, :uint32, "<")
774 775
        when "bqb"
            cloopEmitCompareAndBranch(operands, :uint64, "<")
776 777 778 779 780 781 782
        when "bpb"
            cloopEmitCompareAndBranch(operands, :uint, "<")

        when "bbbeq"
            cloopEmitCompareAndBranch(operands, :uint8, "<=")
        when "bibeq"
            cloopEmitCompareAndBranch(operands, :uint32, "<=")
783 784
        when "bqbeq"
            cloopEmitCompareAndBranch(operands, :uint64, "<=")
785 786 787 788 789 790 791
        when "bpbeq"
            cloopEmitCompareAndBranch(operands, :uint, "<=")

        when "bbgt"
            cloopEmitCompareAndBranch(operands, :int8, ">")
        when "bigt"
            cloopEmitCompareAndBranch(operands, :int32, ">")
792 793
        when "bqgt"
            cloopEmitCompareAndBranch(operands, :int64, ">")
794 795 796 797 798 799 800
        when "bpgt"
            cloopEmitCompareAndBranch(operands, :int, ">")

        when "bbgteq"
            cloopEmitCompareAndBranch(operands, :int8, ">=")
        when "bigteq"
            cloopEmitCompareAndBranch(operands, :int32, ">=")
801 802
        when "bqgteq"
            cloopEmitCompareAndBranch(operands, :int64, ">=")
803 804 805 806 807 808 809
        when "bpgteq"
            cloopEmitCompareAndBranch(operands, :int, ">=")

        when "bblt"
            cloopEmitCompareAndBranch(operands, :int8, "<")
        when "bilt"
            cloopEmitCompareAndBranch(operands, :int32, "<")
810 811
        when "bqlt"
            cloopEmitCompareAndBranch(operands, :int64, "<")
812 813 814 815 816 817 818
        when "bplt"
            cloopEmitCompareAndBranch(operands, :int, "<")

        when "bblteq"
            cloopEmitCompareAndBranch(operands, :int8, "<=")
        when "bilteq"
            cloopEmitCompareAndBranch(operands, :int32, "<=")
819 820
        when "bqlteq"
            cloopEmitCompareAndBranch(operands, :int64, "<=")
821 822 823 824 825 826 827
        when "bplteq"
            cloopEmitCompareAndBranch(operands, :int, "<=")

        when "btbz"
            cloopEmitTestAndBranchIf(operands, :int8, "== 0", operands[-1].cLabel)
        when "btiz"
            cloopEmitTestAndBranchIf(operands, :int32, "== 0", operands[-1].cLabel)
828 829
        when "btqz"
            cloopEmitTestAndBranchIf(operands, :int64, "== 0", operands[-1].cLabel)
830 831 832 833 834 835 836
        when "btpz"
            cloopEmitTestAndBranchIf(operands, :int, "== 0", operands[-1].cLabel)

        when "btbnz"
            cloopEmitTestAndBranchIf(operands, :int8, "!= 0", operands[-1].cLabel)
        when "btinz"
            cloopEmitTestAndBranchIf(operands, :int32, "!= 0", operands[-1].cLabel)
837 838
        when "btqnz"
            cloopEmitTestAndBranchIf(operands, :int64, "!= 0", operands[-1].cLabel)
839 840 841 842 843 844 845
        when "btpnz"
            cloopEmitTestAndBranchIf(operands, :int, "!= 0", operands[-1].cLabel)

        when "btbs"
            cloopEmitTestAndBranchIf(operands, :int8, "< 0", operands[-1].cLabel)
        when "btis"
            cloopEmitTestAndBranchIf(operands, :int32, "< 0", operands[-1].cLabel)
846 847
        when "btqs"
            cloopEmitTestAndBranchIf(operands, :int64, "< 0", operands[-1].cLabel)
848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880
        when "btps"
            cloopEmitTestAndBranchIf(operands, :int, "< 0", operands[-1].cLabel)

        # For jmp, we do not want to assume that we have COMPUTED_GOTO support.
        # Fortunately, the only times we should ever encounter indirect jmps is
        # when the jmp target is a CLoop opcode (by design).
        #
        # Hence, we check if the jmp target is a known label reference. If so,
        # we can emit a goto directly. If it is not a known target, then we set
        # the target in the opcode, and dispatch to it via whatever dispatch
        # mechanism is in used.
        when "jmp"
            if operands[0].is_a? LocalLabelReference or operands[0].is_a? LabelReference
                # Handles jumps local or global labels.
                $asm.putc "goto #{operands[0].cLabel};"
            else
                # Handles jumps to some computed target.
                # NOTE: must be an opcode handler or a llint glue helper.
                $asm.putc "opcode = #{operands[0].clValue(:opcode)};"
                $asm.putc "DISPATCH_OPCODE();"
            end

        when "call"
            $asm.putc "CRASH(); // generic call instruction not supported by design!"
        when "break"
            $asm.putc "CRASH(); // break instruction not implemented."
        when "ret"
            $asm.putc "goto doReturnHelper;"

        when "cbeq"
            cloopEmitCompareAndSet(operands, :uint8, "==")
        when "cieq"
            cloopEmitCompareAndSet(operands, :uint32, "==")
881 882
        when "cqeq"
            cloopEmitCompareAndSet(operands, :uint64, "==")
883 884 885 886 887 888 889
        when "cpeq"
            cloopEmitCompareAndSet(operands, :uint, "==")

        when "cbneq"
            cloopEmitCompareAndSet(operands, :uint8, "!=")
        when "cineq"
            cloopEmitCompareAndSet(operands, :uint32, "!=")
890 891
        when "cqneq"
            cloopEmitCompareAndSet(operands, :uint64, "!=")
892 893 894 895 896 897 898
        when "cpneq"
            cloopEmitCompareAndSet(operands, :uint, "!=")

        when "cba"
            cloopEmitCompareAndSet(operands, :uint8, ">")
        when "cia"
            cloopEmitCompareAndSet(operands, :uint32, ">")
899 900
        when "cqa"
            cloopEmitCompareAndSet(operands, :uint64, ">")
901 902 903 904 905 906 907
        when "cpa"
            cloopEmitCompareAndSet(operands, :uint, ">")

        when "cbaeq"
            cloopEmitCompareAndSet(operands, :uint8, ">=")
        when "ciaeq"
            cloopEmitCompareAndSet(operands, :uint32, ">=")
908 909
        when "cqaeq"
            cloopEmitCompareAndSet(operands, :uint64, ">=")
910 911 912 913 914 915 916
        when "cpaeq"
            cloopEmitCompareAndSet(operands, :uint, ">=")

        when "cbb"
            cloopEmitCompareAndSet(operands, :uint8, "<")
        when "cib"
            cloopEmitCompareAndSet(operands, :uint32, "<")
917 918
        when "cqb"
            cloopEmitCompareAndSet(operands, :uint64, "<")
919 920 921 922 923 924 925
        when "cpb"
            cloopEmitCompareAndSet(operands, :uint, "<")

        when "cbbeq"
            cloopEmitCompareAndSet(operands, :uint8, "<=")
        when "cibeq"
            cloopEmitCompareAndSet(operands, :uint32, "<=")
926 927
        when "cqbeq"
            cloopEmitCompareAndSet(operands, :uint64, "<=")
928 929 930 931 932 933 934
        when "cpbeq"
            cloopEmitCompareAndSet(operands, :uint, "<=")

        when "cbgt"
            cloopEmitCompareAndSet(operands, :int8, ">")
        when "cigt"
            cloopEmitCompareAndSet(operands, :int32, ">")
935 936
        when "cqgt"
            cloopEmitCompareAndSet(operands, :int64, ">")
937 938 939 940 941 942 943
        when "cpgt"
            cloopEmitCompareAndSet(operands, :int, ">")

        when "cbgteq"
            cloopEmitCompareAndSet(operands, :int8, ">=")
        when "cigteq"
            cloopEmitCompareAndSet(operands, :int32, ">=")
944 945
        when "cqgteq"
            cloopEmitCompareAndSet(operands, :int64, ">=")
946 947 948 949 950 951 952
        when "cpgteq"
            cloopEmitCompareAndSet(operands, :int, ">=")

        when "cblt"
            cloopEmitCompareAndSet(operands, :int8, "<")
        when "cilt"
            cloopEmitCompareAndSet(operands, :int32, "<")
953 954
        when "cqlt"
            cloopEmitCompareAndSet(operands, :int64, "<")
955 956 957 958 959 960 961
        when "cplt"
            cloopEmitCompareAndSet(operands, :int, "<")

        when "cblteq"
            cloopEmitCompareAndSet(operands, :int8, "<=")
        when "cilteq"
            cloopEmitCompareAndSet(operands, :int32, "<=")
962 963
        when "cqlteq"
            cloopEmitCompareAndSet(operands, :int64, "<=")
964 965 966 967 968 969 970
        when "cplteq"
            cloopEmitCompareAndSet(operands, :int, "<=")

        when "tbs"
            cloopEmitTestSet(operands, :int8, "< 0")
        when "tis"
            cloopEmitTestSet(operands, :int32, "< 0")
971 972
        when "tqs"
            cloopEmitTestSet(operands, :int64, "< 0")
973 974 975 976 977 978 979
        when "tps"
            cloopEmitTestSet(operands, :int, "< 0")

        when "tbz"
            cloopEmitTestSet(operands, :int8, "== 0")
        when "tiz"
            cloopEmitTestSet(operands, :int32, "== 0")
980 981
        when "tqz"
            cloopEmitTestSet(operands, :int64, "== 0")
982 983 984 985 986 987 988
        when "tpz"
            cloopEmitTestSet(operands, :int, "== 0")

        when "tbnz"
            cloopEmitTestSet(operands, :int8, "!= 0")
        when "tinz"
            cloopEmitTestSet(operands, :int32, "!= 0")
989 990
        when "tqnz"
            cloopEmitTestSet(operands, :int64, "!= 0")
991 992 993 994 995 996 997 998 999 1000
        when "tpnz"
            cloopEmitTestSet(operands, :int, "!= 0")

        # 64-bit instruction: cdqi (based on X64)
        # Sign extends the lower 32 bits of t0, but put the sign extension into
        # the lower 32 bits of t1. Leave the upper 32 bits of t0 and t1 unchanged.
        when "cdqi"
            $asm.putc "{"
            $asm.putc "    int64_t temp = t0.i32; // sign extend the low 32bit"
            $asm.putc "    t0.i32 = temp; // low word"
1001
            $asm.putc "    t0.clearHighWord();"
1002
            $asm.putc "    t1.i32 = uint64_t(temp) >> 32; // high word"
1003
            $asm.putc "    t1.clearHighWord();"
1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022
            $asm.putc "}"

        # 64-bit instruction: idivi op1 (based on X64)
        # Divide a 64-bit integer numerator by the specified denominator.
        # The numerator is specified in t0 and t1 as follows:
        #     1. low 32 bits of the numerator is in the low 32 bits of t0.
        #     2. high 32 bits of the numerator is in the low 32 bits of t1.
        #
        # The resultant quotient is a signed 32-bit int, and is to be stored
        # in the lower 32 bits of t0.
        # The resultant remainder is a signed 32-bit int, and is to be stored
        # in the lower 32 bits of t1.
        when "idivi"
            # Divide t1,t0 (EDX,EAX) by the specified arg, and store the remainder in t1,
            # and quotient in t0:
            $asm.putc "{"
            $asm.putc "    int64_t dividend = (int64_t(t1.u32) << 32) | t0.u32;"
            $asm.putc "    int64_t divisor = #{operands[0].clValue(:int)};"
            $asm.putc "    t1.i32 = dividend % divisor; // remainder"
1023
            $asm.putc "    t1.clearHighWord();"
1024
            $asm.putc "    t0.i32 = dividend / divisor; // quotient"
1025
            $asm.putc "    t0.clearHighWord();"
1026 1027 1028 1029 1030 1031 1032 1033 1034 1035
            $asm.putc "}"

        # 32-bit instruction: fii2d int32LoOp int32HiOp dblOp (based on ARMv7)
        # Decode 2 32-bit ints (low and high) into a 64-bit double.
        when "fii2d"
            $asm.putc "#{operands[2].clValue(:double)} = Ints2Double(#{operands[0].clValue(:uint32)}, #{operands[1].clValue(:uint32)});"

        # 32-bit instruction: f2dii dblOp int32LoOp int32HiOp (based on ARMv7)
        # Encode a 64-bit double into 2 32-bit ints (low and high).
        when "fd2ii"
1036
            $asm.putc "Double2Ints(#{operands[0].clValue(:double)}, #{operands[1].clValue(:uint32)}, #{operands[2].clValue(:uint32)});"
1037

1038
        # 64-bit instruction: fq2d int64Op dblOp (based on X64)
1039
        # Copy a bit-encoded double in a 64-bit int register to a double register.
1040
        when "fq2d"
1041 1042
            $asm.putc "#{operands[1].clValue(:double)} = #{operands[0].clValue(:castToDouble)};"

1043
        # 64-bit instruction: fd2q dblOp int64Op (based on X64 instruction set)
1044
        # Copy a double as a bit-encoded double into a 64-bit int register.
1045 1046
        when "fd2q"
            $asm.putc "#{operands[1].clValue(:int64)} = #{operands[0].clValue(:castToInt64)};"
1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066

        when "leai"
            operands[0].cloopEmitLea(operands[1], :int32)
        when "leap"
            operands[0].cloopEmitLea(operands[1], :int)

        when "baddio"
            cloopEmitOpAndBranchIfOverflow(operands, "+", :int32)
        when "bsubio"
            cloopEmitOpAndBranchIfOverflow(operands, "-", :int32)
        when "bmulio"
            cloopEmitOpAndBranchIfOverflow(operands, "*", :int32)

        when "baddis"
            cloopEmitOpAndBranch(operands, "+", :int32, "< 0")
        when "baddiz"
            cloopEmitOpAndBranch(operands, "+", :int32, "== 0")
        when "baddinz"
            cloopEmitOpAndBranch(operands, "+", :int32, "!= 0")

1067 1068 1069 1070 1071 1072 1073
        when "baddqs"
            cloopEmitOpAndBranch(operands, "+", :int64, "< 0")
        when "baddqz"
            cloopEmitOpAndBranch(operands, "+", :int64, "== 0")
        when "baddqnz"
            cloopEmitOpAndBranch(operands, "+", :int64, "!= 0")

1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094
        when "baddps"
            cloopEmitOpAndBranch(operands, "+", :int, "< 0")
        when "baddpz"
            cloopEmitOpAndBranch(operands, "+", :int, "== 0")
        when "baddpnz"
            cloopEmitOpAndBranch(operands, "+", :int, "!= 0")

        when "bsubis"
            cloopEmitOpAndBranch(operands, "-", :int32, "< 0")
        when "bsubiz"
            cloopEmitOpAndBranch(operands, "-", :int32, "== 0")
        when "bsubinz"
            cloopEmitOpAndBranch(operands, "-", :int32, "!= 0")

        when "borris"
            cloopEmitOpAndBranch(operands, "|", :int32, "< 0")
        when "borriz"
            cloopEmitOpAndBranch(operands, "|", :int32, "== 0")
        when "borrinz"
            cloopEmitOpAndBranch(operands, "|", :int32, "!= 0")

1095 1096 1097 1098
        when "pushCalleeSaves"
        when "popCalleeSaves"


1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132
        # A convenience and compact call to crash because we don't want to use
        # the generic llint crash mechanism which relies on the availability
        # of the call instruction (which cannot be implemented in a generic
        # way, and can be abused if we made it just work for this special case).
        # Using a special cloopCrash instruction is cleaner.
        when "cloopCrash"
            $asm.putc "CRASH();"

        # We can't rely on the llint JS call mechanism which actually makes
        # use of the call instruction. Instead, we just implement JS calls
        # as an opcode dispatch.
        when "cloopCallJSFunction"
            $asm.putc "opcode = #{operands[0].clValue(:opcode)};"
            $asm.putc "DISPATCH_OPCODE();"

        # We can't do generic function calls with an arbitrary set of args, but
        # fortunately we don't have to here. All native function calls always
        # have a fixed prototype of 1 args: the passed ExecState.
        when "cloopCallNative"
            $asm.putc "nativeFunc = #{operands[0].clValue(:nativeFunc)};"
            $asm.putc "functionReturnValue = JSValue::decode(nativeFunc(t0.execState));"
            $asm.putc "#if USE(JSVALUE32_64)"
            $asm.putc "    t1.i = functionReturnValue.tag();"
            $asm.putc "    t0.i = functionReturnValue.payload();"
            $asm.putc "#else // USE_JSVALUE64)"
            $asm.putc "    t0.encodedJSValue = JSValue::encode(functionReturnValue);"
            $asm.putc "#endif // USE_JSVALUE64)"            

        # We can't do generic function calls with an arbitrary set of args, but
        # fortunately we don't have to here. All slow path function calls always
        # have a fixed prototype too. See cloopEmitCallSlowPath() for details.
        when "cloopCallSlowPath"
            cloopEmitCallSlowPath(operands)

1133 1134 1135 1136 1137 1138
        # For debugging only. This is used to insert instrumentation into the
        # generated LLIntAssembly.h during llint development only. Do not use
        # for production code.
        when "cloopDo"
            $asm.putc "#{annotation}"

1139 1140 1141 1142 1143
        else
            lowerDefault
        end
    end
end