OLD | NEW |
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 1492 matching lines...) Loading... |
1503 Register tmp = ToRegister(instr->temp()); | 1503 Register tmp = ToRegister(instr->temp()); |
1504 __ Set(tmp, int_val); | 1504 __ Set(tmp, int_val); |
1505 __ movq(res, tmp); | 1505 __ movq(res, tmp); |
1506 } | 1506 } |
1507 } | 1507 } |
1508 | 1508 |
1509 | 1509 |
1510 void LCodeGen::DoConstantT(LConstantT* instr) { | 1510 void LCodeGen::DoConstantT(LConstantT* instr) { |
1511 Handle<Object> value = instr->value(); | 1511 Handle<Object> value = instr->value(); |
1512 AllowDeferredHandleDereference smi_check; | 1512 AllowDeferredHandleDereference smi_check; |
1513 if (value->IsSmi()) { | 1513 __ LoadObject(ToRegister(instr->result()), value); |
1514 __ Move(ToRegister(instr->result()), value); | |
1515 } else { | |
1516 __ LoadHeapObject(ToRegister(instr->result()), | |
1517 Handle<HeapObject>::cast(value)); | |
1518 } | |
1519 } | 1514 } |
1520 | 1515 |
1521 | 1516 |
1522 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { | 1517 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { |
1523 Register result = ToRegister(instr->result()); | 1518 Register result = ToRegister(instr->result()); |
1524 Register map = ToRegister(instr->value()); | 1519 Register map = ToRegister(instr->value()); |
1525 __ EnumLength(result, map); | 1520 __ EnumLength(result, map); |
1526 } | 1521 } |
1527 | 1522 |
1528 | 1523 |
(...skipping 1167 matching lines...) Loading... |
2696 int offset = index * kPointerSize; | 2691 int offset = index * kPointerSize; |
2697 if (index < 0) { | 2692 if (index < 0) { |
2698 // Negative property indices are in-object properties, indexed | 2693 // Negative property indices are in-object properties, indexed |
2699 // from the end of the fixed part of the object. | 2694 // from the end of the fixed part of the object. |
2700 __ movq(result, FieldOperand(object, offset + type->instance_size())); | 2695 __ movq(result, FieldOperand(object, offset + type->instance_size())); |
2701 } else { | 2696 } else { |
2702 // Non-negative property indices are in the properties array. | 2697 // Non-negative property indices are in the properties array. |
2703 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset)); | 2698 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset)); |
2704 __ movq(result, FieldOperand(result, offset + FixedArray::kHeaderSize)); | 2699 __ movq(result, FieldOperand(result, offset + FixedArray::kHeaderSize)); |
2705 } | 2700 } |
2706 } else if (lookup.IsConstantFunction()) { | 2701 } else if (lookup.IsConstant()) { |
2707 Handle<JSFunction> function(lookup.GetConstantFunctionFromMap(*type)); | 2702 Handle<Object> constant(lookup.GetConstantFromMap(*type), isolate()); |
2708 __ LoadHeapObject(result, function); | 2703 __ LoadObject(result, constant); |
2709 } else { | 2704 } else { |
2710 // Negative lookup. | 2705 // Negative lookup. |
2711 // Check prototypes. | 2706 // Check prototypes. |
2712 Handle<HeapObject> current(HeapObject::cast((*type)->prototype())); | 2707 Handle<HeapObject> current(HeapObject::cast((*type)->prototype())); |
2713 Heap* heap = type->GetHeap(); | 2708 Heap* heap = type->GetHeap(); |
2714 while (*current != heap->null_value()) { | 2709 while (*current != heap->null_value()) { |
2715 __ LoadHeapObject(result, current); | 2710 __ LoadHeapObject(result, current); |
2716 __ Cmp(FieldOperand(result, HeapObject::kMapOffset), | 2711 __ Cmp(FieldOperand(result, HeapObject::kMapOffset), |
2717 Handle<Map>(current->map())); | 2712 Handle<Map>(current->map())); |
2718 DeoptimizeIf(not_equal, env); | 2713 DeoptimizeIf(not_equal, env); |
(...skipping 10 matching lines...) Loading... |
2729 static bool CompactEmit(SmallMapList* list, | 2724 static bool CompactEmit(SmallMapList* list, |
2730 Handle<String> name, | 2725 Handle<String> name, |
2731 int i, | 2726 int i, |
2732 Isolate* isolate) { | 2727 Isolate* isolate) { |
2733 Handle<Map> map = list->at(i); | 2728 Handle<Map> map = list->at(i); |
2734 // If the map has ElementsKind transitions, we will generate map checks | 2729 // If the map has ElementsKind transitions, we will generate map checks |
2735 // for each kind in __ CompareMap(..., ALLOW_ELEMENTS_TRANSITION_MAPS). | 2730 // for each kind in __ CompareMap(..., ALLOW_ELEMENTS_TRANSITION_MAPS). |
2736 if (map->HasElementsTransition()) return false; | 2731 if (map->HasElementsTransition()) return false; |
2737 LookupResult lookup(isolate); | 2732 LookupResult lookup(isolate); |
2738 map->LookupDescriptor(NULL, *name, &lookup); | 2733 map->LookupDescriptor(NULL, *name, &lookup); |
2739 return lookup.IsField() || lookup.IsConstantFunction(); | 2734 return lookup.IsField() || lookup.IsConstant(); |
2740 } | 2735 } |
2741 | 2736 |
2742 | 2737 |
2743 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { | 2738 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { |
2744 Register object = ToRegister(instr->object()); | 2739 Register object = ToRegister(instr->object()); |
2745 Register result = ToRegister(instr->result()); | 2740 Register result = ToRegister(instr->result()); |
2746 | 2741 |
2747 int map_count = instr->hydrogen()->types()->length(); | 2742 int map_count = instr->hydrogen()->types()->length(); |
2748 bool need_generic = instr->hydrogen()->need_generic(); | 2743 bool need_generic = instr->hydrogen()->need_generic(); |
2749 | 2744 |
(...skipping 2788 matching lines...) Loading... |
5538 FixedArray::kHeaderSize - kPointerSize)); | 5533 FixedArray::kHeaderSize - kPointerSize)); |
5539 __ bind(&done); | 5534 __ bind(&done); |
5540 } | 5535 } |
5541 | 5536 |
5542 | 5537 |
5543 #undef __ | 5538 #undef __ |
5544 | 5539 |
5545 } } // namespace v8::internal | 5540 } } // namespace v8::internal |
5546 | 5541 |
5547 #endif // V8_TARGET_ARCH_X64 | 5542 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |