| 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 4303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4314 } else { | 4314 } else { |
| 4315 __ B(deferred->entry()); | 4315 __ B(deferred->entry()); |
| 4316 } | 4316 } |
| 4317 | 4317 |
| 4318 __ Bind(deferred->exit()); | 4318 __ Bind(deferred->exit()); |
| 4319 __ Str(input, FieldMemOperand(result, HeapNumber::kValueOffset)); | 4319 __ Str(input, FieldMemOperand(result, HeapNumber::kValueOffset)); |
| 4320 __ Bind(&done); | 4320 __ Bind(&done); |
| 4321 } | 4321 } |
| 4322 | 4322 |
| 4323 | 4323 |
| 4324 void LCodeGen::DoDeferredNumberTagI(LInstruction* instr, | 4324 void LCodeGen::DoDeferredNumberTagU(LInstruction* instr, |
| 4325 LOperand* value, | 4325 LOperand* value, |
| 4326 LOperand* temp1, | 4326 LOperand* temp1, |
| 4327 LOperand* temp2, | 4327 LOperand* temp2) { |
| 4328 IntegerSignedness signedness) { | |
| 4329 Label slow, convert_and_store; | 4328 Label slow, convert_and_store; |
| 4330 Register src = ToRegister32(value); | 4329 Register src = ToRegister32(value); |
| 4331 Register dst = ToRegister(instr->result()); | 4330 Register dst = ToRegister(instr->result()); |
| 4332 Register scratch1 = ToRegister(temp1); | 4331 Register scratch1 = ToRegister(temp1); |
| 4333 | 4332 |
| 4334 if (FLAG_inline_new) { | 4333 if (FLAG_inline_new) { |
| 4335 Register scratch2 = ToRegister(temp2); | 4334 Register scratch2 = ToRegister(temp2); |
| 4336 __ AllocateHeapNumber(dst, &slow, scratch1, scratch2); | 4335 __ AllocateHeapNumber(dst, &slow, scratch1, scratch2); |
| 4337 __ B(&convert_and_store); | 4336 __ B(&convert_and_store); |
| 4338 } | 4337 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 4356 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); | 4355 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); |
| 4357 | 4356 |
| 4358 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); | 4357 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); |
| 4359 __ StoreToSafepointRegisterSlot(x0, dst); | 4358 __ StoreToSafepointRegisterSlot(x0, dst); |
| 4360 } | 4359 } |
| 4361 | 4360 |
| 4362 // Convert number to floating point and store in the newly allocated heap | 4361 // Convert number to floating point and store in the newly allocated heap |
| 4363 // number. | 4362 // number. |
| 4364 __ Bind(&convert_and_store); | 4363 __ Bind(&convert_and_store); |
| 4365 DoubleRegister dbl_scratch = double_scratch(); | 4364 DoubleRegister dbl_scratch = double_scratch(); |
| 4366 if (signedness == SIGNED_INT32) { | 4365 __ Ucvtf(dbl_scratch, src); |
| 4367 ASM_UNIMPLEMENTED_BREAK("DeferredNumberTagI - signed int32 case."); | |
| 4368 } else { | |
| 4369 ASSERT(signedness == UNSIGNED_INT32); | |
| 4370 __ Ucvtf(dbl_scratch, src); | |
| 4371 } | |
| 4372 __ Str(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); | 4366 __ Str(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); |
| 4373 } | 4367 } |
| 4374 | 4368 |
| 4375 | 4369 |
| 4376 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { | 4370 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { |
| 4377 class DeferredNumberTagU: public LDeferredCode { | 4371 class DeferredNumberTagU: public LDeferredCode { |
| 4378 public: | 4372 public: |
| 4379 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) | 4373 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) |
| 4380 : LDeferredCode(codegen), instr_(instr) { } | 4374 : LDeferredCode(codegen), instr_(instr) { } |
| 4381 virtual void Generate() { | 4375 virtual void Generate() { |
| 4382 codegen()->DoDeferredNumberTagI(instr_, | 4376 codegen()->DoDeferredNumberTagU(instr_, |
| 4383 instr_->value(), | 4377 instr_->value(), |
| 4384 instr_->temp1(), | 4378 instr_->temp1(), |
| 4385 instr_->temp2(), | 4379 instr_->temp2()); |
| 4386 UNSIGNED_INT32); | |
| 4387 } | 4380 } |
| 4388 virtual LInstruction* instr() { return instr_; } | 4381 virtual LInstruction* instr() { return instr_; } |
| 4389 private: | 4382 private: |
| 4390 LNumberTagU* instr_; | 4383 LNumberTagU* instr_; |
| 4391 }; | 4384 }; |
| 4392 | 4385 |
| 4393 Register value = ToRegister(instr->value()); | 4386 Register value = ToRegister(instr->value()); |
| 4394 Register result = ToRegister(instr->result()); | 4387 Register result = ToRegister(instr->result()); |
| 4395 | 4388 |
| 4396 DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr); | 4389 DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr); |
| (...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5606 __ Bind(&out_of_object); | 5599 __ Bind(&out_of_object); |
| 5607 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5600 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| 5608 // Index is equal to negated out of object property index plus 1. | 5601 // Index is equal to negated out of object property index plus 1. |
| 5609 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5602 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 5610 __ Ldr(result, FieldMemOperand(result, | 5603 __ Ldr(result, FieldMemOperand(result, |
| 5611 FixedArray::kHeaderSize - kPointerSize)); | 5604 FixedArray::kHeaderSize - kPointerSize)); |
| 5612 __ Bind(&done); | 5605 __ Bind(&done); |
| 5613 } | 5606 } |
| 5614 | 5607 |
| 5615 } } // namespace v8::internal | 5608 } } // namespace v8::internal |
| OLD | NEW |