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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 return chunk_->LookupLiteralRepresentation(op).IsSmi(); | 532 return chunk_->LookupLiteralRepresentation(op).IsSmi(); |
533 } | 533 } |
534 | 534 |
535 | 535 |
536 int LCodeGen::ToInteger32(LConstantOperand* op) const { | 536 int LCodeGen::ToInteger32(LConstantOperand* op) const { |
537 HConstant* constant = chunk_->LookupConstant(op); | 537 HConstant* constant = chunk_->LookupConstant(op); |
538 return constant->Integer32Value(); | 538 return constant->Integer32Value(); |
539 } | 539 } |
540 | 540 |
541 | 541 |
| 542 Smi* LCodeGen::ToSmi(LConstantOperand* op) const { |
| 543 HConstant* constant = chunk_->LookupConstant(op); |
| 544 return Smi::FromInt(constant->Integer32Value()); |
| 545 } |
| 546 |
| 547 |
542 double LCodeGen::ToDouble(LConstantOperand* op) const { | 548 double LCodeGen::ToDouble(LConstantOperand* op) const { |
543 HConstant* constant = chunk_->LookupConstant(op); | 549 HConstant* constant = chunk_->LookupConstant(op); |
544 ASSERT(constant->HasDoubleValue()); | 550 ASSERT(constant->HasDoubleValue()); |
545 return constant->DoubleValue(); | 551 return constant->DoubleValue(); |
546 } | 552 } |
547 | 553 |
548 | 554 |
549 Operand LCodeGen::ToOperand(LOperand* op) { | 555 Operand LCodeGen::ToOperand(LOperand* op) { |
550 if (op->IsConstantOperand()) { | 556 if (op->IsConstantOperand()) { |
551 LConstantOperand* const_op = LConstantOperand::cast(op); | 557 LConstantOperand* const_op = LConstantOperand::cast(op); |
(...skipping 5428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5980 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5986 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5981 __ ldr(result, FieldMemOperand(scratch, | 5987 __ ldr(result, FieldMemOperand(scratch, |
5982 FixedArray::kHeaderSize - kPointerSize)); | 5988 FixedArray::kHeaderSize - kPointerSize)); |
5983 __ bind(&done); | 5989 __ bind(&done); |
5984 } | 5990 } |
5985 | 5991 |
5986 | 5992 |
5987 #undef __ | 5993 #undef __ |
5988 | 5994 |
5989 } } // namespace v8::internal | 5995 } } // namespace v8::internal |
OLD | NEW |