Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: src/a64/lithium-codegen-a64.cc

Issue 146693002: A64: Fix NumberTagI for cases calling runtime (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/a64/lithium-a64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3979 matching lines...) Expand 10 before | Expand all | Expand 10 after
3990 __ Str(input, FieldMemOperand(result, HeapNumber::kValueOffset)); 3990 __ Str(input, FieldMemOperand(result, HeapNumber::kValueOffset));
3991 __ Bind(&done); 3991 __ Bind(&done);
3992 } 3992 }
3993 3993
3994 3994
3995 void LCodeGen::DoDeferredNumberTagI(LInstruction* instr, 3995 void LCodeGen::DoDeferredNumberTagI(LInstruction* instr,
3996 LOperand* value, 3996 LOperand* value,
3997 LOperand* temp1, 3997 LOperand* temp1,
3998 LOperand* temp2, 3998 LOperand* temp2,
3999 IntegerSignedness signedness) { 3999 IntegerSignedness signedness) {
4000 Label slow; 4000 Label slow, convert_and_store;
4001 Register src = ToRegister32(value); 4001 Register src = ToRegister32(value);
4002 Register dst = ToRegister(instr->result()); 4002 Register dst = ToRegister(instr->result());
4003 DoubleRegister dbl_scratch = double_scratch(); 4003 Register scratch1 = ToRegister(temp1);
4004 4004
4005 Label done;
4006 if (signedness == SIGNED_INT32) {
4007 ASM_UNIMPLEMENTED_BREAK("DeferredNumberTagI - signed int32 case.");
4008 } else {
4009 ASSERT(signedness == UNSIGNED_INT32);
4010 __ Ucvtf(dbl_scratch, src);
4011 }
4012
4013 Register scratch1 = ToRegister(temp1);
4014 if (FLAG_inline_new) { 4005 if (FLAG_inline_new) {
4015 Register scratch2 = ToRegister(temp2); 4006 Register scratch2 = ToRegister(temp2);
4016 __ AllocateHeapNumber(dst, &slow, scratch1, scratch2); 4007 __ AllocateHeapNumber(dst, &slow, scratch1, scratch2);
4017 __ B(&done); 4008 __ B(&convert_and_store);
4018 } 4009 }
4019 4010
4020 // Slow case: call the runtime system to do the number allocation. 4011 // Slow case: call the runtime system to do the number allocation.
4021 __ Bind(&slow); 4012 __ Bind(&slow);
4022 4013
4023 // Check that the dst register contains new space allocation top, which is a 4014 // Check that the dst register contains new space allocation top, which is a
4024 // valid address for the GC. 4015 // valid address for the GC.
4025 if (FLAG_debug_code) { 4016 if (FLAG_debug_code) {
4026 ExternalReference new_space_allocation_top = 4017 ExternalReference new_space_allocation_top =
4027 ExternalReference::new_space_allocation_top_address(isolate()); 4018 ExternalReference::new_space_allocation_top_address(isolate());
4028 __ Mov(scratch1, Operand(new_space_allocation_top)); 4019 __ Mov(scratch1, Operand(new_space_allocation_top));
4029 __ Ldr(scratch1, MemOperand(scratch1)); 4020 __ Ldr(scratch1, MemOperand(scratch1));
4030 __ Cmp(dst, scratch1); 4021 __ Cmp(dst, scratch1);
4031 __ Check(eq, "Register dst does not contain allocation top."); 4022 __ Check(eq, "Register dst does not contain allocation top.");
4032 } 4023 }
4033 4024
4034 { 4025 {
4035 // Preserve the value of all registers. 4026 // Preserve the value of all registers.
4036 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); 4027 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
4037 4028
4038 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); 4029 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr);
4039 __ StoreToSafepointRegisterSlot(x0, dst); 4030 __ StoreToSafepointRegisterSlot(x0, dst);
4040 } 4031 }
4041 4032
4042 // Done. Move converted value in dbl_scratch into the newly allocated heap 4033 // Convert number to floating point and store in the newly allocated heap
4043 // number. 4034 // number.
4044 __ Bind(&done); 4035 __ Bind(&convert_and_store);
4036 DoubleRegister dbl_scratch = double_scratch();
4037 if (signedness == SIGNED_INT32) {
4038 ASM_UNIMPLEMENTED_BREAK("DeferredNumberTagI - signed int32 case.");
4039 } else {
4040 ASSERT(signedness == UNSIGNED_INT32);
4041 __ Ucvtf(dbl_scratch, src);
4042 }
4045 __ Str(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); 4043 __ Str(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset));
4046 } 4044 }
4047 4045
4048 4046
4049 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { 4047 void LCodeGen::DoNumberTagU(LNumberTagU* instr) {
4050 class DeferredNumberTagU: public LDeferredCode { 4048 class DeferredNumberTagU: public LDeferredCode {
4051 public: 4049 public:
4052 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) 4050 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr)
4053 : LDeferredCode(codegen), instr_(instr) { } 4051 : LDeferredCode(codegen), instr_(instr) { }
4054 virtual void Generate() { 4052 virtual void Generate() {
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
5271 __ Bind(&out_of_object); 5269 __ Bind(&out_of_object);
5272 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5270 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
5273 // Index is equal to negated out of object property index plus 1. 5271 // Index is equal to negated out of object property index plus 1.
5274 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5272 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5275 __ Ldr(result, FieldMemOperand(result, 5273 __ Ldr(result, FieldMemOperand(result,
5276 FixedArray::kHeaderSize - kPointerSize)); 5274 FixedArray::kHeaderSize - kPointerSize));
5277 __ Bind(&done); 5275 __ Bind(&done);
5278 } 5276 }
5279 5277
5280 } } // namespace v8::internal 5278 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/a64/lithium-a64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698