| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3202 InitializeNewString(result, | 3202 InitializeNewString(result, |
| 3203 length, | 3203 length, |
| 3204 Heap::kSlicedAsciiStringMapRootIndex, | 3204 Heap::kSlicedAsciiStringMapRootIndex, |
| 3205 scratch1, | 3205 scratch1, |
| 3206 scratch2); | 3206 scratch2); |
| 3207 } | 3207 } |
| 3208 | 3208 |
| 3209 | 3209 |
| 3210 void MacroAssembler::JumpIfNotUniqueName(Register reg, | 3210 void MacroAssembler::JumpIfNotUniqueName(Register reg, |
| 3211 Label* not_unique_name) { | 3211 Label* not_unique_name) { |
| 3212 STATIC_ASSERT(((SYMBOL_TYPE - 1) & kIsInternalizedMask) == kInternalizedTag); | 3212 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); |
| 3213 Branch(not_unique_name, lt, reg, Operand(kIsInternalizedMask)); | 3213 Label succeed; |
| 3214 Branch(not_unique_name, gt, reg, Operand(SYMBOL_TYPE)); | 3214 And(at, reg, Operand(kIsNotStringMask | kIsNotInternalizedMask)); |
| 3215 Branch(&succeed, eq, at, Operand(zero_reg)); |
| 3216 Branch(not_unique_name, ne, reg, Operand(SYMBOL_TYPE)); |
| 3217 |
| 3218 bind(&succeed); |
| 3215 } | 3219 } |
| 3216 | 3220 |
| 3217 | 3221 |
| 3218 // Allocates a heap number or jumps to the label if the young space is full and | 3222 // Allocates a heap number or jumps to the label if the young space is full and |
| 3219 // a scavenge is needed. | 3223 // a scavenge is needed. |
| 3220 void MacroAssembler::AllocateHeapNumber(Register result, | 3224 void MacroAssembler::AllocateHeapNumber(Register result, |
| 3221 Register scratch1, | 3225 Register scratch1, |
| 3222 Register scratch2, | 3226 Register scratch2, |
| 3223 Register heap_number_map, | 3227 Register heap_number_map, |
| 3224 Label* need_gc, | 3228 Label* need_gc, |
| (...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4957 failure); | 4961 failure); |
| 4958 } | 4962 } |
| 4959 | 4963 |
| 4960 | 4964 |
| 4961 void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialAscii( | 4965 void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialAscii( |
| 4962 Register first, | 4966 Register first, |
| 4963 Register second, | 4967 Register second, |
| 4964 Register scratch1, | 4968 Register scratch1, |
| 4965 Register scratch2, | 4969 Register scratch2, |
| 4966 Label* failure) { | 4970 Label* failure) { |
| 4967 int kFlatAsciiStringMask = | 4971 const int kFlatAsciiStringMask = |
| 4968 kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask; | 4972 kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask; |
| 4969 int kFlatAsciiStringTag = ASCII_STRING_TYPE; | 4973 const int kFlatAsciiStringTag = |
| 4974 kStringTag | kOneByteStringTag | kSeqStringTag; |
| 4970 ASSERT(kFlatAsciiStringTag <= 0xffff); // Ensure this fits 16-bit immed. | 4975 ASSERT(kFlatAsciiStringTag <= 0xffff); // Ensure this fits 16-bit immed. |
| 4971 andi(scratch1, first, kFlatAsciiStringMask); | 4976 andi(scratch1, first, kFlatAsciiStringMask); |
| 4972 Branch(failure, ne, scratch1, Operand(kFlatAsciiStringTag)); | 4977 Branch(failure, ne, scratch1, Operand(kFlatAsciiStringTag)); |
| 4973 andi(scratch2, second, kFlatAsciiStringMask); | 4978 andi(scratch2, second, kFlatAsciiStringMask); |
| 4974 Branch(failure, ne, scratch2, Operand(kFlatAsciiStringTag)); | 4979 Branch(failure, ne, scratch2, Operand(kFlatAsciiStringTag)); |
| 4975 } | 4980 } |
| 4976 | 4981 |
| 4977 | 4982 |
| 4978 void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii(Register type, | 4983 void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii(Register type, |
| 4979 Register scratch, | 4984 Register scratch, |
| 4980 Label* failure) { | 4985 Label* failure) { |
| 4981 int kFlatAsciiStringMask = | 4986 const int kFlatAsciiStringMask = |
| 4982 kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask; | 4987 kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask; |
| 4983 int kFlatAsciiStringTag = ASCII_STRING_TYPE; | 4988 const int kFlatAsciiStringTag = |
| 4989 kStringTag | kOneByteStringTag | kSeqStringTag; |
| 4984 And(scratch, type, Operand(kFlatAsciiStringMask)); | 4990 And(scratch, type, Operand(kFlatAsciiStringMask)); |
| 4985 Branch(failure, ne, scratch, Operand(kFlatAsciiStringTag)); | 4991 Branch(failure, ne, scratch, Operand(kFlatAsciiStringTag)); |
| 4986 } | 4992 } |
| 4987 | 4993 |
| 4988 | 4994 |
| 4989 static const int kRegisterPassedArguments = 4; | 4995 static const int kRegisterPassedArguments = 4; |
| 4990 | 4996 |
| 4991 int MacroAssembler::CalculateStackPassedWords(int num_reg_arguments, | 4997 int MacroAssembler::CalculateStackPassedWords(int num_reg_arguments, |
| 4992 int num_double_arguments) { | 4998 int num_double_arguments) { |
| 4993 int stack_passed_words = 0; | 4999 int stack_passed_words = 0; |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5471 Branch(&done); | 5477 Branch(&done); |
| 5472 | 5478 |
| 5473 // In 0-255 range, round and truncate. | 5479 // In 0-255 range, round and truncate. |
| 5474 bind(&in_bounds); | 5480 bind(&in_bounds); |
| 5475 cvt_w_d(temp_double_reg, input_reg); | 5481 cvt_w_d(temp_double_reg, input_reg); |
| 5476 mfc1(result_reg, temp_double_reg); | 5482 mfc1(result_reg, temp_double_reg); |
| 5477 bind(&done); | 5483 bind(&done); |
| 5478 } | 5484 } |
| 5479 | 5485 |
| 5480 | 5486 |
| 5481 void MacroAssembler::TestJSArrayForAllocationSiteInfo( | 5487 void MacroAssembler::TestJSArrayForAllocationMemento( |
| 5482 Register receiver_reg, | 5488 Register receiver_reg, |
| 5483 Register scratch_reg, | 5489 Register scratch_reg, |
| 5484 Condition cond, | 5490 Condition cond, |
| 5485 Label* allocation_info_present) { | 5491 Label* allocation_memento_present) { |
| 5486 Label no_info_available; | 5492 Label no_memento_available; |
| 5487 ExternalReference new_space_start = | 5493 ExternalReference new_space_start = |
| 5488 ExternalReference::new_space_start(isolate()); | 5494 ExternalReference::new_space_start(isolate()); |
| 5489 ExternalReference new_space_allocation_top = | 5495 ExternalReference new_space_allocation_top = |
| 5490 ExternalReference::new_space_allocation_top_address(isolate()); | 5496 ExternalReference::new_space_allocation_top_address(isolate()); |
| 5491 Addu(scratch_reg, receiver_reg, | 5497 Addu(scratch_reg, receiver_reg, |
| 5492 Operand(JSArray::kSize + AllocationSiteInfo::kSize - kHeapObjectTag)); | 5498 Operand(JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag)); |
| 5493 Branch(&no_info_available, lt, scratch_reg, Operand(new_space_start)); | 5499 Branch(&no_memento_available, lt, scratch_reg, Operand(new_space_start)); |
| 5494 li(at, Operand(new_space_allocation_top)); | 5500 li(at, Operand(new_space_allocation_top)); |
| 5495 lw(at, MemOperand(at)); | 5501 lw(at, MemOperand(at)); |
| 5496 Branch(&no_info_available, gt, scratch_reg, Operand(at)); | 5502 Branch(&no_memento_available, gt, scratch_reg, Operand(at)); |
| 5497 lw(scratch_reg, MemOperand(scratch_reg, -AllocationSiteInfo::kSize)); | 5503 lw(scratch_reg, MemOperand(scratch_reg, -AllocationMemento::kSize)); |
| 5498 Branch(allocation_info_present, cond, scratch_reg, | 5504 Branch(allocation_memento_present, cond, scratch_reg, |
| 5499 Operand(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); | 5505 Operand(Handle<Map>(isolate()->heap()->allocation_memento_map()))); |
| 5500 bind(&no_info_available); | 5506 bind(&no_memento_available); |
| 5501 } | 5507 } |
| 5502 | 5508 |
| 5503 | 5509 |
| 5504 bool AreAliased(Register r1, Register r2, Register r3, Register r4) { | 5510 bool AreAliased(Register r1, Register r2, Register r3, Register r4) { |
| 5505 if (r1.is(r2)) return true; | 5511 if (r1.is(r2)) return true; |
| 5506 if (r1.is(r3)) return true; | 5512 if (r1.is(r3)) return true; |
| 5507 if (r1.is(r4)) return true; | 5513 if (r1.is(r4)) return true; |
| 5508 if (r2.is(r3)) return true; | 5514 if (r2.is(r3)) return true; |
| 5509 if (r2.is(r4)) return true; | 5515 if (r2.is(r4)) return true; |
| 5510 if (r3.is(r4)) return true; | 5516 if (r3.is(r4)) return true; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5561 opcode == BGTZL); | 5567 opcode == BGTZL); |
| 5562 opcode = (cond == eq) ? BEQ : BNE; | 5568 opcode = (cond == eq) ? BEQ : BNE; |
| 5563 instr = (instr & ~kOpcodeMask) | opcode; | 5569 instr = (instr & ~kOpcodeMask) | opcode; |
| 5564 masm_.emit(instr); | 5570 masm_.emit(instr); |
| 5565 } | 5571 } |
| 5566 | 5572 |
| 5567 | 5573 |
| 5568 } } // namespace v8::internal | 5574 } } // namespace v8::internal |
| 5569 | 5575 |
| 5570 #endif // V8_TARGET_ARCH_MIPS | 5576 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |