Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index 954d043a9f532ef260064b349a4f56bd17e87b36..78e1dec51358f5aa40ff2854ffdd989452d0608f 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -2642,28 +2642,22 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( |
__ j(equal, if_false); |
// Look for valueOf symbol in the descriptor array, and indicate false if |
- // found. Since we omit an enumeration index check, if it is added via a |
- // transition that shares its descriptor array, this is a false positive. |
- Label entry, loop, done; |
- |
- // Skip loop if no descriptors are valid. |
- __ NumberOfOwnDescriptors(rcx, rbx); |
- __ cmpq(rcx, Immediate(0)); |
- __ j(equal, &done); |
- |
+ // found. The type is not checked, so if it is a transition it is a false |
+ // negative. |
__ LoadInstanceDescriptors(rbx, rbx); |
- // rbx: descriptor array. |
- // rcx: valid entries in the descriptor array. |
+ __ movq(rcx, FieldOperand(rbx, FixedArray::kLengthOffset)); |
+ // rbx: descriptor array |
+ // rcx: length of descriptor array |
// Calculate the end of the descriptor array. |
- __ imul(rcx, rcx, Immediate(DescriptorArray::kDescriptorSize)); |
SmiIndex index = masm_->SmiToIndex(rdx, rcx, kPointerSizeLog2); |
__ lea(rcx, |
Operand( |
- rbx, index.reg, index.scale, DescriptorArray::kFirstOffset)); |
+ rbx, index.reg, index.scale, FixedArray::kHeaderSize)); |
// Calculate location of the first key name. |
__ addq(rbx, Immediate(DescriptorArray::kFirstOffset)); |
// Loop through all the keys in the descriptor array. If one of these is the |
// symbol valueOf the result is false. |
+ Label entry, loop; |
__ jmp(&entry); |
__ bind(&loop); |
__ movq(rdx, FieldOperand(rbx, 0)); |
@@ -2674,11 +2668,10 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( |
__ cmpq(rbx, rcx); |
__ j(not_equal, &loop); |
- __ bind(&done); |
// Reload map as register rbx was used as temporary above. |
__ movq(rbx, FieldOperand(rax, HeapObject::kMapOffset)); |
- // If a valueOf property is not found on the object check that its |
+ // If a valueOf property is not found on the object check that it's |
// prototype is the un-modified String prototype. If not result is false. |
__ movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); |
__ testq(rcx, Immediate(kSmiTagMask)); |