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

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

Issue 141593005: A64: Implement Smi support in MathAbs (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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') | src/a64/macro-assembler-a64.h » ('j') | 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 3474 matching lines...) Expand 10 before | Expand all | Expand 10 after
3485 __ EnumLengthSmi(result, map); 3485 __ EnumLengthSmi(result, map);
3486 } 3486 }
3487 3487
3488 3488
3489 void LCodeGen::DoMathAbs(LMathAbs* instr) { 3489 void LCodeGen::DoMathAbs(LMathAbs* instr) {
3490 Representation r = instr->hydrogen()->value()->representation(); 3490 Representation r = instr->hydrogen()->value()->representation();
3491 if (r.IsDouble()) { 3491 if (r.IsDouble()) {
3492 DoubleRegister input = ToDoubleRegister(instr->value()); 3492 DoubleRegister input = ToDoubleRegister(instr->value());
3493 DoubleRegister result = ToDoubleRegister(instr->result()); 3493 DoubleRegister result = ToDoubleRegister(instr->result());
3494 __ Fabs(result, input); 3494 __ Fabs(result, input);
3495 } else { 3495 } else if (r.IsSmi() || r.IsInteger32()) {
3496 ASSERT(r.IsInteger32()); 3496 Register input = r.IsSmi() ? ToRegister(instr->value())
3497 Register input = ToRegister32(instr->value()); 3497 : ToRegister32(instr->value());
3498 Register result = ToRegister32(instr->result()); 3498 Register result = r.IsSmi() ? ToRegister(instr->result())
3499 : ToRegister32(instr->result());
3499 Label done; 3500 Label done;
3500 __ Abs(result, input, NULL, &done); 3501 __ Abs(result, input, NULL, &done);
3501 Deoptimize(instr->environment()); 3502 Deoptimize(instr->environment());
3502 __ Bind(&done); 3503 __ Bind(&done);
3503 } 3504 }
3504 } 3505 }
3505 3506
3506 3507
3507 void LCodeGen::DoDeferredMathAbsTagged(LMathAbsTagged* instr, 3508 void LCodeGen::DoDeferredMathAbsTagged(LMathAbsTagged* instr,
3508 Label* exit, 3509 Label* exit,
(...skipping 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after
5547 __ Bind(&out_of_object); 5548 __ Bind(&out_of_object);
5548 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5549 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
5549 // Index is equal to negated out of object property index plus 1. 5550 // Index is equal to negated out of object property index plus 1.
5550 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5551 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5551 __ Ldr(result, FieldMemOperand(result, 5552 __ Ldr(result, FieldMemOperand(result,
5552 FixedArray::kHeaderSize - kPointerSize)); 5553 FixedArray::kHeaderSize - kPointerSize));
5553 __ Bind(&done); 5554 __ Bind(&done);
5554 } 5555 }
5555 5556
5556 } } // namespace v8::internal 5557 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/a64/lithium-a64.cc ('k') | src/a64/macro-assembler-a64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698