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

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

Issue 160423002: A64 support for DoubleToIStub (truncating). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test cases 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 5289 matching lines...) Expand 10 before | Expand all | Expand 10 after
5300 5300
5301 if (instr->truncating()) { 5301 if (instr->truncating()) {
5302 Register output = ToRegister(instr->result()); 5302 Register output = ToRegister(instr->result());
5303 Register scratch2 = ToRegister(temp2); 5303 Register scratch2 = ToRegister(temp2);
5304 Label check_bools; 5304 Label check_bools;
5305 5305
5306 // If it's not a heap number, jump to undefined check. 5306 // If it's not a heap number, jump to undefined check.
5307 __ JumpIfNotRoot(scratch1, Heap::kHeapNumberMapRootIndex, &check_bools); 5307 __ JumpIfNotRoot(scratch1, Heap::kHeapNumberMapRootIndex, &check_bools);
5308 5308
5309 // A heap number: load value and convert to int32 using truncating function. 5309 // A heap number: load value and convert to int32 using truncating function.
5310 __ Ldr(dbl_scratch1, FieldMemOperand(input, HeapNumber::kValueOffset)); 5310 __ TruncateHeapNumberToI(output, input);
5311 __ ECMA262ToInt32(output, dbl_scratch1, scratch1, scratch2);
5312 __ B(&done); 5311 __ B(&done);
5313 5312
5314 __ Bind(&check_bools); 5313 __ Bind(&check_bools);
5315 5314
5316 Register true_root = output; 5315 Register true_root = output;
5317 Register false_root = scratch2; 5316 Register false_root = scratch2;
5318 __ LoadTrueFalseRoots(true_root, false_root); 5317 __ LoadTrueFalseRoots(true_root, false_root);
5319 __ Cmp(scratch1, true_root); 5318 __ Cmp(scratch1, true_root);
5320 __ Cset(output, eq); 5319 __ Cset(output, eq);
5321 __ Ccmp(scratch1, false_root, ZFlag, ne); 5320 __ Ccmp(scratch1, false_root, ZFlag, ne);
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
5488 Label no_memento_found; 5487 Label no_memento_found;
5489 __ JumpIfJSArrayHasAllocationMemento(object, temp1, temp2, &no_memento_found); 5488 __ JumpIfJSArrayHasAllocationMemento(object, temp1, temp2, &no_memento_found);
5490 Deoptimize(instr->environment()); 5489 Deoptimize(instr->environment());
5491 __ Bind(&no_memento_found); 5490 __ Bind(&no_memento_found);
5492 } 5491 }
5493 5492
5494 5493
5495 void LCodeGen::DoTruncateDoubleToIntOrSmi(LTruncateDoubleToIntOrSmi* instr) { 5494 void LCodeGen::DoTruncateDoubleToIntOrSmi(LTruncateDoubleToIntOrSmi* instr) {
5496 DoubleRegister input = ToDoubleRegister(instr->value()); 5495 DoubleRegister input = ToDoubleRegister(instr->value());
5497 Register result = ToRegister(instr->result()); 5496 Register result = ToRegister(instr->result());
5498 __ ECMA262ToInt32(result, input, 5497 __ TruncateDoubleToI(result, input);
5499 ToRegister(instr->temp1()), 5498 if (instr->tag_result()) {
5500 ToRegister(instr->temp2()), 5499 __ SmiTag(result, result);
5501 instr->tag_result() 5500 }
5502 ? MacroAssembler::SMI
5503 : MacroAssembler::INT32_IN_W);
5504 } 5501 }
5505 5502
5506 5503
5507 void LCodeGen::DoTypeof(LTypeof* instr) { 5504 void LCodeGen::DoTypeof(LTypeof* instr) {
5508 Register input = ToRegister(instr->value()); 5505 Register input = ToRegister(instr->value());
5509 __ Push(input); 5506 __ Push(input);
5510 CallRuntime(Runtime::kTypeof, 1, instr); 5507 CallRuntime(Runtime::kTypeof, 1, instr);
5511 } 5508 }
5512 5509
5513 5510
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
5701 __ Bind(&out_of_object); 5698 __ Bind(&out_of_object);
5702 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5699 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
5703 // Index is equal to negated out of object property index plus 1. 5700 // Index is equal to negated out of object property index plus 1.
5704 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5701 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5705 __ Ldr(result, FieldMemOperand(result, 5702 __ Ldr(result, FieldMemOperand(result,
5706 FixedArray::kHeaderSize - kPointerSize)); 5703 FixedArray::kHeaderSize - kPointerSize));
5707 __ Bind(&done); 5704 __ Bind(&done);
5708 } 5705 }
5709 5706
5710 } } // namespace v8::internal 5707 } } // 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