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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 HConstant* constant = chunk_->LookupConstant(const_op); | 419 HConstant* constant = chunk_->LookupConstant(const_op); |
420 Handle<Object> literal = constant->handle(); | 420 Handle<Object> literal = constant->handle(); |
421 Representation r = chunk_->LookupLiteralRepresentation(const_op); | 421 Representation r = chunk_->LookupLiteralRepresentation(const_op); |
422 if (r.IsInteger32()) { | 422 if (r.IsInteger32()) { |
423 ASSERT(literal->IsNumber()); | 423 ASSERT(literal->IsNumber()); |
424 __ mov(scratch, Operand(static_cast<int32_t>(literal->Number()))); | 424 __ mov(scratch, Operand(static_cast<int32_t>(literal->Number()))); |
425 } else if (r.IsDouble()) { | 425 } else if (r.IsDouble()) { |
426 Abort("EmitLoadRegister: Unsupported double immediate."); | 426 Abort("EmitLoadRegister: Unsupported double immediate."); |
427 } else { | 427 } else { |
428 ASSERT(r.IsTagged()); | 428 ASSERT(r.IsTagged()); |
429 if (literal->IsSmi()) { | 429 __ LoadObject(scratch, literal); |
430 __ mov(scratch, Operand(literal)); | |
431 } else { | |
432 __ LoadHeapObject(scratch, Handle<HeapObject>::cast(literal)); | |
433 } | |
434 } | 430 } |
435 return scratch; | 431 return scratch; |
436 } else if (op->IsStackSlot() || op->IsArgument()) { | 432 } else if (op->IsStackSlot() || op->IsArgument()) { |
437 __ ldr(scratch, ToMemOperand(op)); | 433 __ ldr(scratch, ToMemOperand(op)); |
438 return scratch; | 434 return scratch; |
439 } | 435 } |
440 UNREACHABLE(); | 436 UNREACHABLE(); |
441 return scratch; | 437 return scratch; |
442 } | 438 } |
443 | 439 |
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1799 ASSERT(instr->result()->IsDoubleRegister()); | 1795 ASSERT(instr->result()->IsDoubleRegister()); |
1800 DwVfpRegister result = ToDoubleRegister(instr->result()); | 1796 DwVfpRegister result = ToDoubleRegister(instr->result()); |
1801 double v = instr->value(); | 1797 double v = instr->value(); |
1802 __ Vmov(result, v, scratch0()); | 1798 __ Vmov(result, v, scratch0()); |
1803 } | 1799 } |
1804 | 1800 |
1805 | 1801 |
1806 void LCodeGen::DoConstantT(LConstantT* instr) { | 1802 void LCodeGen::DoConstantT(LConstantT* instr) { |
1807 Handle<Object> value = instr->value(); | 1803 Handle<Object> value = instr->value(); |
1808 AllowDeferredHandleDereference smi_check; | 1804 AllowDeferredHandleDereference smi_check; |
1809 if (value->IsSmi()) { | 1805 __ LoadObject(ToRegister(instr->result()), value); |
1810 __ mov(ToRegister(instr->result()), Operand(value)); | |
1811 } else { | |
1812 __ LoadHeapObject(ToRegister(instr->result()), | |
1813 Handle<HeapObject>::cast(value)); | |
1814 } | |
1815 } | 1806 } |
1816 | 1807 |
1817 | 1808 |
1818 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { | 1809 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { |
1819 Register result = ToRegister(instr->result()); | 1810 Register result = ToRegister(instr->result()); |
1820 Register map = ToRegister(instr->value()); | 1811 Register map = ToRegister(instr->value()); |
1821 __ EnumLength(result, map); | 1812 __ EnumLength(result, map); |
1822 } | 1813 } |
1823 | 1814 |
1824 | 1815 |
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3025 int offset = index * kPointerSize; | 3016 int offset = index * kPointerSize; |
3026 if (index < 0) { | 3017 if (index < 0) { |
3027 // Negative property indices are in-object properties, indexed | 3018 // Negative property indices are in-object properties, indexed |
3028 // from the end of the fixed part of the object. | 3019 // from the end of the fixed part of the object. |
3029 __ ldr(result, FieldMemOperand(object, offset + type->instance_size())); | 3020 __ ldr(result, FieldMemOperand(object, offset + type->instance_size())); |
3030 } else { | 3021 } else { |
3031 // Non-negative property indices are in the properties array. | 3022 // Non-negative property indices are in the properties array. |
3032 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 3023 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
3033 __ ldr(result, FieldMemOperand(result, offset + FixedArray::kHeaderSize)); | 3024 __ ldr(result, FieldMemOperand(result, offset + FixedArray::kHeaderSize)); |
3034 } | 3025 } |
3035 } else if (lookup.IsConstantFunction()) { | 3026 } else if (lookup.IsConstant()) { |
3036 Handle<JSFunction> function(lookup.GetConstantFunctionFromMap(*type)); | 3027 Handle<Object> constant(lookup.GetConstantFromMap(*type), isolate()); |
3037 __ LoadHeapObject(result, function); | 3028 __ LoadObject(result, constant); |
3038 } else { | 3029 } else { |
3039 // Negative lookup. | 3030 // Negative lookup. |
3040 // Check prototypes. | 3031 // Check prototypes. |
3041 Handle<HeapObject> current(HeapObject::cast((*type)->prototype())); | 3032 Handle<HeapObject> current(HeapObject::cast((*type)->prototype())); |
3042 Heap* heap = type->GetHeap(); | 3033 Heap* heap = type->GetHeap(); |
3043 while (*current != heap->null_value()) { | 3034 while (*current != heap->null_value()) { |
3044 __ LoadHeapObject(result, current); | 3035 __ LoadHeapObject(result, current); |
3045 __ ldr(result, FieldMemOperand(result, HeapObject::kMapOffset)); | 3036 __ ldr(result, FieldMemOperand(result, HeapObject::kMapOffset)); |
3046 __ cmp(result, Operand(Handle<Map>(current->map()))); | 3037 __ cmp(result, Operand(Handle<Map>(current->map()))); |
3047 DeoptimizeIf(ne, env); | 3038 DeoptimizeIf(ne, env); |
(...skipping 2778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5826 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5817 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5827 __ ldr(result, FieldMemOperand(scratch, | 5818 __ ldr(result, FieldMemOperand(scratch, |
5828 FixedArray::kHeaderSize - kPointerSize)); | 5819 FixedArray::kHeaderSize - kPointerSize)); |
5829 __ bind(&done); | 5820 __ bind(&done); |
5830 } | 5821 } |
5831 | 5822 |
5832 | 5823 |
5833 #undef __ | 5824 #undef __ |
5834 | 5825 |
5835 } } // namespace v8::internal | 5826 } } // namespace v8::internal |
OLD | NEW |