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 3197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3208 scratch2); | 3208 scratch2); |
3209 } | 3209 } |
3210 | 3210 |
3211 | 3211 |
3212 // Allocates a heap number or jumps to the label if the young space is full and | 3212 // Allocates a heap number or jumps to the label if the young space is full and |
3213 // a scavenge is needed. | 3213 // a scavenge is needed. |
3214 void MacroAssembler::AllocateHeapNumber(Register result, | 3214 void MacroAssembler::AllocateHeapNumber(Register result, |
3215 Register scratch1, | 3215 Register scratch1, |
3216 Register scratch2, | 3216 Register scratch2, |
3217 Register heap_number_map, | 3217 Register heap_number_map, |
3218 Label* need_gc) { | 3218 Label* need_gc, |
| 3219 TaggingMode tagging_mode) { |
3219 // Allocate an object in the heap for the heap number and tag it as a heap | 3220 // Allocate an object in the heap for the heap number and tag it as a heap |
3220 // object. | 3221 // object. |
3221 AllocateInNewSpace(HeapNumber::kSize, | 3222 AllocateInNewSpace(HeapNumber::kSize, |
3222 result, | 3223 result, |
3223 scratch1, | 3224 scratch1, |
3224 scratch2, | 3225 scratch2, |
3225 need_gc, | 3226 need_gc, |
3226 TAG_OBJECT); | 3227 tagging_mode == TAG_RESULT ? TAG_OBJECT : |
| 3228 NO_ALLOCATION_FLAGS); |
3227 | 3229 |
3228 // Store heap number map in the allocated object. | 3230 // Store heap number map in the allocated object. |
3229 AssertRegisterIsRoot(heap_number_map, Heap::kHeapNumberMapRootIndex); | 3231 AssertRegisterIsRoot(heap_number_map, Heap::kHeapNumberMapRootIndex); |
3230 sw(heap_number_map, FieldMemOperand(result, HeapObject::kMapOffset)); | 3232 if (tagging_mode == TAG_RESULT) { |
| 3233 sw(heap_number_map, FieldMemOperand(result, HeapObject::kMapOffset)); |
| 3234 } else { |
| 3235 sw(heap_number_map, MemOperand(result, HeapObject::kMapOffset)); |
| 3236 } |
3231 } | 3237 } |
3232 | 3238 |
3233 | 3239 |
3234 void MacroAssembler::AllocateHeapNumberWithValue(Register result, | 3240 void MacroAssembler::AllocateHeapNumberWithValue(Register result, |
3235 FPURegister value, | 3241 FPURegister value, |
3236 Register scratch1, | 3242 Register scratch1, |
3237 Register scratch2, | 3243 Register scratch2, |
3238 Label* gc_required) { | 3244 Label* gc_required) { |
3239 LoadRoot(t8, Heap::kHeapNumberMapRootIndex); | 3245 LoadRoot(t8, Heap::kHeapNumberMapRootIndex); |
3240 AllocateHeapNumber(result, scratch1, scratch2, t8, gc_required); | 3246 AllocateHeapNumber(result, scratch1, scratch2, t8, gc_required); |
(...skipping 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5465 opcode == BGTZL); | 5471 opcode == BGTZL); |
5466 opcode = (cond == eq) ? BEQ : BNE; | 5472 opcode = (cond == eq) ? BEQ : BNE; |
5467 instr = (instr & ~kOpcodeMask) | opcode; | 5473 instr = (instr & ~kOpcodeMask) | opcode; |
5468 masm_.emit(instr); | 5474 masm_.emit(instr); |
5469 } | 5475 } |
5470 | 5476 |
5471 | 5477 |
5472 } } // namespace v8::internal | 5478 } } // namespace v8::internal |
5473 | 5479 |
5474 #endif // V8_TARGET_ARCH_MIPS | 5480 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |