| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2215 | 2215 |
| 2216 static void CheckInputType(MacroAssembler* masm, | 2216 static void CheckInputType(MacroAssembler* masm, |
| 2217 Register input, | 2217 Register input, |
| 2218 CompareIC::State expected, | 2218 CompareIC::State expected, |
| 2219 Label* fail) { | 2219 Label* fail) { |
| 2220 Label ok; | 2220 Label ok; |
| 2221 if (expected == CompareIC::SMI) { | 2221 if (expected == CompareIC::SMI) { |
| 2222 __ JumpIfNotSmi(input, fail); | 2222 __ JumpIfNotSmi(input, fail); |
| 2223 } else if (expected == CompareIC::NUMBER) { | 2223 } else if (expected == CompareIC::NUMBER) { |
| 2224 __ JumpIfSmi(input, &ok); | 2224 __ JumpIfSmi(input, &ok); |
| 2225 __ CompareMap(input, masm->isolate()->factory()->heap_number_map(), NULL); | 2225 __ CompareMap(input, masm->isolate()->factory()->heap_number_map()); |
| 2226 __ j(not_equal, fail); | 2226 __ j(not_equal, fail); |
| 2227 } | 2227 } |
| 2228 // We could be strict about internalized/non-internalized here, but as long as | 2228 // We could be strict about internalized/non-internalized here, but as long as |
| 2229 // hydrogen doesn't care, the stub doesn't have to care either. | 2229 // hydrogen doesn't care, the stub doesn't have to care either. |
| 2230 __ bind(&ok); | 2230 __ bind(&ok); |
| 2231 } | 2231 } |
| 2232 | 2232 |
| 2233 | 2233 |
| 2234 static void BranchIfNotInternalizedString(MacroAssembler* masm, | 2234 static void BranchIfNotInternalizedString(MacroAssembler* masm, |
| 2235 Label* label, | 2235 Label* label, |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3199 static const int kOffsetToResultValue = 18; | 3199 static const int kOffsetToResultValue = 18; |
| 3200 // The last 4 bytes of the instruction sequence | 3200 // The last 4 bytes of the instruction sequence |
| 3201 // movq(rdi, FieldOperand(rax, HeapObject::kMapOffset)) | 3201 // movq(rdi, FieldOperand(rax, HeapObject::kMapOffset)) |
| 3202 // Move(kScratchRegister, Factory::the_hole_value()) | 3202 // Move(kScratchRegister, Factory::the_hole_value()) |
| 3203 // in front of the hole value address. | 3203 // in front of the hole value address. |
| 3204 static const unsigned int kWordBeforeMapCheckValue = 0xBA49FF78; | 3204 static const unsigned int kWordBeforeMapCheckValue = 0xBA49FF78; |
| 3205 // The last 4 bytes of the instruction sequence | 3205 // The last 4 bytes of the instruction sequence |
| 3206 // __ j(not_equal, &cache_miss); | 3206 // __ j(not_equal, &cache_miss); |
| 3207 // __ LoadRoot(ToRegister(instr->result()), Heap::kTheHoleValueRootIndex); | 3207 // __ LoadRoot(ToRegister(instr->result()), Heap::kTheHoleValueRootIndex); |
| 3208 // before the offset of the hole value in the root array. | 3208 // before the offset of the hole value in the root array. |
| 3209 static const unsigned int kWordBeforeResultValue = 0x458B4909; | 3209 static const unsigned int kWordBeforeResultValue = 0x458B4906; |
| 3210 // Only the inline check flag is supported on X64. | 3210 // Only the inline check flag is supported on X64. |
| 3211 ASSERT(flags_ == kNoFlags || HasCallSiteInlineCheck()); | 3211 ASSERT(flags_ == kNoFlags || HasCallSiteInlineCheck()); |
| 3212 int extra_argument_offset = HasCallSiteInlineCheck() ? 1 : 0; | 3212 int extra_argument_offset = HasCallSiteInlineCheck() ? 1 : 0; |
| 3213 | 3213 |
| 3214 // Get the object - go slow case if it's a smi. | 3214 // Get the object - go slow case if it's a smi. |
| 3215 Label slow; | 3215 Label slow; |
| 3216 StackArgumentsAccessor args(rsp, 2 + extra_argument_offset, | 3216 StackArgumentsAccessor args(rsp, 2 + extra_argument_offset, |
| 3217 ARGUMENTS_DONT_CONTAIN_RECEIVER); | 3217 ARGUMENTS_DONT_CONTAIN_RECEIVER); |
| 3218 __ movq(rax, args.GetArgumentOperand(0)); | 3218 __ movq(rax, args.GetArgumentOperand(0)); |
| 3219 __ JumpIfSmi(rax, &slow); | 3219 __ JumpIfSmi(rax, &slow); |
| (...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4536 if (left_ == CompareIC::SMI) { | 4536 if (left_ == CompareIC::SMI) { |
| 4537 __ JumpIfNotSmi(rdx, &miss); | 4537 __ JumpIfNotSmi(rdx, &miss); |
| 4538 } | 4538 } |
| 4539 if (right_ == CompareIC::SMI) { | 4539 if (right_ == CompareIC::SMI) { |
| 4540 __ JumpIfNotSmi(rax, &miss); | 4540 __ JumpIfNotSmi(rax, &miss); |
| 4541 } | 4541 } |
| 4542 | 4542 |
| 4543 // Load left and right operand. | 4543 // Load left and right operand. |
| 4544 Label done, left, left_smi, right_smi; | 4544 Label done, left, left_smi, right_smi; |
| 4545 __ JumpIfSmi(rax, &right_smi, Label::kNear); | 4545 __ JumpIfSmi(rax, &right_smi, Label::kNear); |
| 4546 __ CompareMap(rax, masm->isolate()->factory()->heap_number_map(), NULL); | 4546 __ CompareMap(rax, masm->isolate()->factory()->heap_number_map()); |
| 4547 __ j(not_equal, &maybe_undefined1, Label::kNear); | 4547 __ j(not_equal, &maybe_undefined1, Label::kNear); |
| 4548 __ movsd(xmm1, FieldOperand(rax, HeapNumber::kValueOffset)); | 4548 __ movsd(xmm1, FieldOperand(rax, HeapNumber::kValueOffset)); |
| 4549 __ jmp(&left, Label::kNear); | 4549 __ jmp(&left, Label::kNear); |
| 4550 __ bind(&right_smi); | 4550 __ bind(&right_smi); |
| 4551 __ SmiToInteger32(rcx, rax); // Can't clobber rax yet. | 4551 __ SmiToInteger32(rcx, rax); // Can't clobber rax yet. |
| 4552 __ Cvtlsi2sd(xmm1, rcx); | 4552 __ Cvtlsi2sd(xmm1, rcx); |
| 4553 | 4553 |
| 4554 __ bind(&left); | 4554 __ bind(&left); |
| 4555 __ JumpIfSmi(rdx, &left_smi, Label::kNear); | 4555 __ JumpIfSmi(rdx, &left_smi, Label::kNear); |
| 4556 __ CompareMap(rdx, masm->isolate()->factory()->heap_number_map(), NULL); | 4556 __ CompareMap(rdx, masm->isolate()->factory()->heap_number_map()); |
| 4557 __ j(not_equal, &maybe_undefined2, Label::kNear); | 4557 __ j(not_equal, &maybe_undefined2, Label::kNear); |
| 4558 __ movsd(xmm0, FieldOperand(rdx, HeapNumber::kValueOffset)); | 4558 __ movsd(xmm0, FieldOperand(rdx, HeapNumber::kValueOffset)); |
| 4559 __ jmp(&done); | 4559 __ jmp(&done); |
| 4560 __ bind(&left_smi); | 4560 __ bind(&left_smi); |
| 4561 __ SmiToInteger32(rcx, rdx); // Can't clobber rdx yet. | 4561 __ SmiToInteger32(rcx, rdx); // Can't clobber rdx yet. |
| 4562 __ Cvtlsi2sd(xmm0, rcx); | 4562 __ Cvtlsi2sd(xmm0, rcx); |
| 4563 | 4563 |
| 4564 __ bind(&done); | 4564 __ bind(&done); |
| 4565 // Compare operands | 4565 // Compare operands |
| 4566 __ ucomisd(xmm0, xmm1); | 4566 __ ucomisd(xmm0, xmm1); |
| (...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5813 __ bind(&fast_elements_case); | 5813 __ bind(&fast_elements_case); |
| 5814 GenerateCase(masm, FAST_ELEMENTS); | 5814 GenerateCase(masm, FAST_ELEMENTS); |
| 5815 } | 5815 } |
| 5816 | 5816 |
| 5817 | 5817 |
| 5818 #undef __ | 5818 #undef __ |
| 5819 | 5819 |
| 5820 } } // namespace v8::internal | 5820 } } // namespace v8::internal |
| 5821 | 5821 |
| 5822 #endif // V8_TARGET_ARCH_X64 | 5822 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |