Chromium Code Reviews| Index: src/x64/code-stubs-x64.cc |
| =================================================================== |
| --- src/x64/code-stubs-x64.cc (revision 7153) |
| +++ src/x64/code-stubs-x64.cc (working copy) |
| @@ -2244,11 +2244,14 @@ |
| Label slow; |
| __ JumpIfNotSmi(rdx, &slow); |
| - // Check if the calling frame is an arguments adaptor frame. |
| + // Check if the calling frame is an arguments adaptor frame. We look at the |
| + // context offset, and if the frame is not a regular one, then we find a |
| + // Smi instead of the context. We can't use SmiCompare here, because that |
| + // only works for comparing two Smis. |
| Label adaptor; |
| __ movq(rbx, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); |
| - __ SmiCompare(Operand(rbx, StandardFrameConstants::kContextOffset), |
| - Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); |
| + __ SmiCompareWithObject(Operand(rbx, StandardFrameConstants::kContextOffset), |
| + Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); |
|
Lasse Reichstein
2011/03/14 08:51:01
You can use Cmp(const Operand* dst, Handle<Object>
Erik Corry
2011/03/14 16:26:45
Renamed to Cmp
|
| __ j(equal, &adaptor); |
| // Check index against formal parameters count limit passed in |
| @@ -2303,8 +2306,8 @@ |
| // Check if the calling frame is an arguments adaptor frame. |
| Label adaptor_frame, try_allocate, runtime; |
| __ movq(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); |
| - __ SmiCompare(Operand(rdx, StandardFrameConstants::kContextOffset), |
| - Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); |
| + __ SmiCompareWithObject(Operand(rdx, StandardFrameConstants::kContextOffset), |
| + Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); |
| __ j(equal, &adaptor_frame); |
| // Get the length from the frame. |
| @@ -4157,8 +4160,8 @@ |
| // Look at the length of the result of adding the two strings. |
| STATIC_ASSERT(String::kMaxLength <= Smi::kMaxValue / 2); |
| __ SmiAdd(rbx, rbx, rcx); |
| - // Use the runtime system when adding two one character strings, as it |
| - // contains optimizations for this specific case using the symbol table. |
| + // Use the symbol table when adding two one character strings, as it |
| + // helps later optimizations to return a symbol here. |
| __ SmiCompare(rbx, Smi::FromInt(2)); |
| __ j(not_equal, &longer_than_two); |
| @@ -4510,15 +4513,14 @@ |
| FieldOperand(symbol_table, SymbolTable::kCapacityOffset)); |
| __ decl(mask); |
| - Register undefined = scratch4; |
| - __ LoadRoot(undefined, Heap::kUndefinedValueRootIndex); |
| + Register map = scratch4; |
| // Registers |
| // chars: two character string, char 1 in byte 0 and char 2 in byte 1. |
| // hash: hash of two character string (32-bit int) |
| // symbol_table: symbol table |
| // mask: capacity mask (32-bit int) |
| - // undefined: undefined value |
| + // map: - |
| // scratch: - |
| // Perform a number of probes in the symbol table. |
| @@ -4533,7 +4535,7 @@ |
| } |
| __ andl(scratch, mask); |
| - // Load the entry from the symble table. |
| + // Load the entry from the symbol table. |
| Register candidate = scratch; // Scratch register contains candidate. |
| STATIC_ASSERT(SymbolTable::kEntrySize == 1); |
| __ movq(candidate, |
| @@ -4543,12 +4545,21 @@ |
| SymbolTable::kElementsStartOffset)); |
| // If entry is undefined no string with this hash can be found. |
| - __ cmpq(candidate, undefined); |
| + NearLabel is_string; |
| + __ CmpObjectType(candidate, ODDBALL_TYPE, map); |
| + __ j(not_equal, &is_string); |
| + |
| + __ CompareRoot(candidate, Heap::kUndefinedValueRootIndex); |
| __ j(equal, not_found); |
| + // Must be null (deleted entry). |
| + __ jmp(&next_probe[i]); |
| + __ bind(&is_string); |
| + |
| // If length is not 2 the string is not a candidate. |
| __ SmiCompare(FieldOperand(candidate, String::kLengthOffset), |
| Smi::FromInt(2)); |
| + __ nop(); |
|
Lasse Reichstein
2011/03/14 08:51:01
Why the nop?
Erik Corry
2011/03/14 16:26:45
Done.
|
| __ j(not_equal, &next_probe[i]); |
| // We use kScratchRegister as a temporary register in assumption that |
| @@ -4556,8 +4567,7 @@ |
| Register temp = kScratchRegister; |
| // Check that the candidate is a non-external ascii string. |
| - __ movq(temp, FieldOperand(candidate, HeapObject::kMapOffset)); |
| - __ movzxbl(temp, FieldOperand(temp, Map::kInstanceTypeOffset)); |
| + __ movzxbl(temp, FieldOperand(map, Map::kInstanceTypeOffset)); |
| __ JumpIfInstanceTypeIsNotSequentialAscii( |
| temp, temp, &next_probe[i]); |