Ignore:
Timestamp:
Mar 9, 2014, 11:57:13 PM (11 years ago)
Author:
[email protected]
Message:

GPRInfo::toIndex should return InvalidIndex for non-temp registers on ARM64
https://bugs.webkit.org/show_bug.cgi?id=129998

Reviewed by Geoffrey Garen.

Not only is that the established contract, but this is used to signal to
ScratchRegisterAllocator that the register doesn't need locking since it isn't a register
that this allocator would use. In the FTL, we may have an inline cache where LLVM had used
some non-temp register (i.e. a register that JSC itself wouldn't have used). This is totally
fine but previously it would have led to either an assertion failure, or data corruption, in
the ScratchRegisterAllocator.

  • jit/GPRInfo.h:

(JSC::GPRInfo::toIndex):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/GPRInfo.h

    r164673 r165362  
    11/*
    2  * Copyright (C) 2011, 2013 Apple Inc. All rights reserved.
     2 * Copyright (C) 2011, 2013, 2014 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    602602    static unsigned toIndex(GPRReg reg)
    603603    {
     604        if (reg > regT15)
     605            return InvalidIndex;
    604606        return (unsigned)reg;
    605607    }
Note: See TracChangeset for help on using the changeset viewer.