| 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 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3201 static const int kOffsetToResultValue = 18; | 3201 static const int kOffsetToResultValue = 18; |
| 3202 // The last 4 bytes of the instruction sequence | 3202 // The last 4 bytes of the instruction sequence |
| 3203 // movq(rdi, FieldOperand(rax, HeapObject::kMapOffset)) | 3203 // movq(rdi, FieldOperand(rax, HeapObject::kMapOffset)) |
| 3204 // Move(kScratchRegister, Factory::the_hole_value()) | 3204 // Move(kScratchRegister, Factory::the_hole_value()) |
| 3205 // in front of the hole value address. | 3205 // in front of the hole value address. |
| 3206 static const unsigned int kWordBeforeMapCheckValue = 0xBA49FF78; | 3206 static const unsigned int kWordBeforeMapCheckValue = 0xBA49FF78; |
| 3207 // The last 4 bytes of the instruction sequence | 3207 // The last 4 bytes of the instruction sequence |
| 3208 // __ j(not_equal, &cache_miss); | 3208 // __ j(not_equal, &cache_miss); |
| 3209 // __ LoadRoot(ToRegister(instr->result()), Heap::kTheHoleValueRootIndex); | 3209 // __ LoadRoot(ToRegister(instr->result()), Heap::kTheHoleValueRootIndex); |
| 3210 // before the offset of the hole value in the root array. | 3210 // before the offset of the hole value in the root array. |
| 3211 static const unsigned int kWordBeforeResultValue = 0x458B4909; | 3211 static const unsigned int kWordBeforeResultValue = 0x458B4906; |
| 3212 // Only the inline check flag is supported on X64. | 3212 // Only the inline check flag is supported on X64. |
| 3213 ASSERT(flags_ == kNoFlags || HasCallSiteInlineCheck()); | 3213 ASSERT(flags_ == kNoFlags || HasCallSiteInlineCheck()); |
| 3214 int extra_argument_offset = HasCallSiteInlineCheck() ? 1 : 0; | 3214 int extra_argument_offset = HasCallSiteInlineCheck() ? 1 : 0; |
| 3215 | 3215 |
| 3216 // Get the object - go slow case if it's a smi. | 3216 // Get the object - go slow case if it's a smi. |
| 3217 Label slow; | 3217 Label slow; |
| 3218 StackArgumentsAccessor args(rsp, 2 + extra_argument_offset, | 3218 StackArgumentsAccessor args(rsp, 2 + extra_argument_offset, |
| 3219 ARGUMENTS_DONT_CONTAIN_RECEIVER); | 3219 ARGUMENTS_DONT_CONTAIN_RECEIVER); |
| 3220 __ movq(rax, args.GetArgumentOperand(0)); | 3220 __ movq(rax, args.GetArgumentOperand(0)); |
| 3221 __ JumpIfSmi(rax, &slow); | 3221 __ JumpIfSmi(rax, &slow); |
| (...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4538 if (left_ == CompareIC::SMI) { | 4538 if (left_ == CompareIC::SMI) { |
| 4539 __ JumpIfNotSmi(rdx, &miss); | 4539 __ JumpIfNotSmi(rdx, &miss); |
| 4540 } | 4540 } |
| 4541 if (right_ == CompareIC::SMI) { | 4541 if (right_ == CompareIC::SMI) { |
| 4542 __ JumpIfNotSmi(rax, &miss); | 4542 __ JumpIfNotSmi(rax, &miss); |
| 4543 } | 4543 } |
| 4544 | 4544 |
| 4545 // Load left and right operand. | 4545 // Load left and right operand. |
| 4546 Label done, left, left_smi, right_smi; | 4546 Label done, left, left_smi, right_smi; |
| 4547 __ JumpIfSmi(rax, &right_smi, Label::kNear); | 4547 __ JumpIfSmi(rax, &right_smi, Label::kNear); |
| 4548 __ CompareMap(rax, masm->isolate()->factory()->heap_number_map(), NULL); | 4548 __ CompareMap(rax, masm->isolate()->factory()->heap_number_map()); |
| 4549 __ j(not_equal, &maybe_undefined1, Label::kNear); | 4549 __ j(not_equal, &maybe_undefined1, Label::kNear); |
| 4550 __ movsd(xmm1, FieldOperand(rax, HeapNumber::kValueOffset)); | 4550 __ movsd(xmm1, FieldOperand(rax, HeapNumber::kValueOffset)); |
| 4551 __ jmp(&left, Label::kNear); | 4551 __ jmp(&left, Label::kNear); |
| 4552 __ bind(&right_smi); | 4552 __ bind(&right_smi); |
| 4553 __ SmiToInteger32(rcx, rax); // Can't clobber rax yet. | 4553 __ SmiToInteger32(rcx, rax); // Can't clobber rax yet. |
| 4554 __ Cvtlsi2sd(xmm1, rcx); | 4554 __ Cvtlsi2sd(xmm1, rcx); |
| 4555 | 4555 |
| 4556 __ bind(&left); | 4556 __ bind(&left); |
| 4557 __ JumpIfSmi(rdx, &left_smi, Label::kNear); | 4557 __ JumpIfSmi(rdx, &left_smi, Label::kNear); |
| 4558 __ CompareMap(rdx, masm->isolate()->factory()->heap_number_map(), NULL); | 4558 __ CompareMap(rdx, masm->isolate()->factory()->heap_number_map()); |
| 4559 __ j(not_equal, &maybe_undefined2, Label::kNear); | 4559 __ j(not_equal, &maybe_undefined2, Label::kNear); |
| 4560 __ movsd(xmm0, FieldOperand(rdx, HeapNumber::kValueOffset)); | 4560 __ movsd(xmm0, FieldOperand(rdx, HeapNumber::kValueOffset)); |
| 4561 __ jmp(&done); | 4561 __ jmp(&done); |
| 4562 __ bind(&left_smi); | 4562 __ bind(&left_smi); |
| 4563 __ SmiToInteger32(rcx, rdx); // Can't clobber rdx yet. | 4563 __ SmiToInteger32(rcx, rdx); // Can't clobber rdx yet. |
| 4564 __ Cvtlsi2sd(xmm0, rcx); | 4564 __ Cvtlsi2sd(xmm0, rcx); |
| 4565 | 4565 |
| 4566 __ bind(&done); | 4566 __ bind(&done); |
| 4567 // Compare operands | 4567 // Compare operands |
| 4568 __ ucomisd(xmm0, xmm1); | 4568 __ ucomisd(xmm0, xmm1); |
| (...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5815 __ bind(&fast_elements_case); | 5815 __ bind(&fast_elements_case); |
| 5816 GenerateCase(masm, FAST_ELEMENTS); | 5816 GenerateCase(masm, FAST_ELEMENTS); |
| 5817 } | 5817 } |
| 5818 | 5818 |
| 5819 | 5819 |
| 5820 #undef __ | 5820 #undef __ |
| 5821 | 5821 |
| 5822 } } // namespace v8::internal | 5822 } } // namespace v8::internal |
| 5823 | 5823 |
| 5824 #endif // V8_TARGET_ARCH_X64 | 5824 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |