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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 if (op->IsRegister()) { | 400 if (op->IsRegister()) { |
401 return ToRegister(op->index()); | 401 return ToRegister(op->index()); |
402 } else if (op->IsConstantOperand()) { | 402 } else if (op->IsConstantOperand()) { |
403 LConstantOperand* const_op = LConstantOperand::cast(op); | 403 LConstantOperand* const_op = LConstantOperand::cast(op); |
404 HConstant* constant = chunk_->LookupConstant(const_op); | 404 HConstant* constant = chunk_->LookupConstant(const_op); |
405 Handle<Object> literal = constant->handle(); | 405 Handle<Object> literal = constant->handle(); |
406 Representation r = chunk_->LookupLiteralRepresentation(const_op); | 406 Representation r = chunk_->LookupLiteralRepresentation(const_op); |
407 if (r.IsInteger32()) { | 407 if (r.IsInteger32()) { |
408 ASSERT(literal->IsNumber()); | 408 ASSERT(literal->IsNumber()); |
409 __ li(scratch, Operand(static_cast<int32_t>(literal->Number()))); | 409 __ li(scratch, Operand(static_cast<int32_t>(literal->Number()))); |
| 410 } else if (r.IsSmi()) { |
| 411 ASSERT(constant->HasSmiValue()); |
| 412 __ li(scratch, Operand(Smi::FromInt(constant->Integer32Value()))); |
410 } else if (r.IsDouble()) { | 413 } else if (r.IsDouble()) { |
411 Abort("EmitLoadRegister: Unsupported double immediate."); | 414 Abort("EmitLoadRegister: Unsupported double immediate."); |
412 } else { | 415 } else { |
413 ASSERT(r.IsTagged()); | 416 ASSERT(r.IsTagged()); |
414 __ LoadObject(scratch, literal); | 417 __ LoadObject(scratch, literal); |
415 } | 418 } |
416 return scratch; | 419 return scratch; |
417 } else if (op->IsStackSlot() || op->IsArgument()) { | 420 } else if (op->IsStackSlot() || op->IsArgument()) { |
418 __ lw(scratch, ToMemOperand(op)); | 421 __ lw(scratch, ToMemOperand(op)); |
419 return scratch; | 422 return scratch; |
(...skipping 5427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5847 __ Subu(scratch, result, scratch); | 5850 __ Subu(scratch, result, scratch); |
5848 __ lw(result, FieldMemOperand(scratch, | 5851 __ lw(result, FieldMemOperand(scratch, |
5849 FixedArray::kHeaderSize - kPointerSize)); | 5852 FixedArray::kHeaderSize - kPointerSize)); |
5850 __ bind(&done); | 5853 __ bind(&done); |
5851 } | 5854 } |
5852 | 5855 |
5853 | 5856 |
5854 #undef __ | 5857 #undef __ |
5855 | 5858 |
5856 } } // namespace v8::internal | 5859 } } // namespace v8::internal |
OLD | NEW |