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

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

Issue 146213004: A64: Synchronize with r16849. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: 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 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after
2059 2059
2060 if (instr->hydrogen()->CanOmitMapChecks()) { 2060 if (instr->hydrogen()->CanOmitMapChecks()) {
2061 ASSERT(instr->value() == NULL); 2061 ASSERT(instr->value() == NULL);
2062 ASSERT(instr->temp() == NULL); 2062 ASSERT(instr->temp() == NULL);
2063 return; 2063 return;
2064 } 2064 }
2065 2065
2066 Register object = ToRegister(instr->value()); 2066 Register object = ToRegister(instr->value());
2067 Register map_reg = ToRegister(instr->temp()); 2067 Register map_reg = ToRegister(instr->temp());
2068 2068
2069 SmallMapList* map_set = instr->hydrogen()->map_set();
2070 __ Ldr(map_reg, FieldMemOperand(object, HeapObject::kMapOffset)); 2069 __ Ldr(map_reg, FieldMemOperand(object, HeapObject::kMapOffset));
2071 2070
2072 DeferredCheckMaps* deferred = NULL; 2071 DeferredCheckMaps* deferred = NULL;
2073 if (instr->hydrogen()->has_migration_target()) { 2072 if (instr->hydrogen()->has_migration_target()) {
2074 deferred = new(zone()) DeferredCheckMaps(this, instr, object); 2073 deferred = new(zone()) DeferredCheckMaps(this, instr, object);
2075 __ Bind(deferred->check_maps()); 2074 __ Bind(deferred->check_maps());
2076 } 2075 }
2077 2076
2077 UniqueSet<Map> map_set = instr->hydrogen()->map_set();
2078 Label success; 2078 Label success;
2079 for (int i = 0; i < map_set->length(); i++) { 2079 for (int i = 0; i < map_set.size(); i++) {
2080 Handle<Map> map = map_set->at(i); 2080 Handle<Map> map = map_set.at(i).handle();
2081 __ CompareMap(map_reg, map, &success); 2081 __ CompareMap(map_reg, map, &success);
2082 __ B(eq, &success); 2082 __ B(eq, &success);
2083 } 2083 }
2084 2084
2085 // We didn't match a map. 2085 // We didn't match a map.
2086 if (instr->hydrogen()->has_migration_target()) { 2086 if (instr->hydrogen()->has_migration_target()) {
2087 __ B(deferred->entry()); 2087 __ B(deferred->entry());
2088 } else { 2088 } else {
2089 Deoptimize(instr->environment()); 2089 Deoptimize(instr->environment());
2090 } 2090 }
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
2440 if (!it.value()->IsReturn()) { 2440 if (!it.value()->IsReturn()) {
2441 __ Mov(result, cp); 2441 __ Mov(result, cp);
2442 return; 2442 return;
2443 } 2443 }
2444 } 2444 }
2445 } 2445 }
2446 2446
2447 2447
2448 void LCodeGen::DoCheckValue(LCheckValue* instr) { 2448 void LCodeGen::DoCheckValue(LCheckValue* instr) {
2449 Register reg = ToRegister(instr->value()); 2449 Register reg = ToRegister(instr->value());
2450 Handle<HeapObject> object = instr->hydrogen()->object(); 2450 Handle<HeapObject> object = instr->hydrogen()->object().handle();
2451 AllowDeferredHandleDereference smi_check; 2451 AllowDeferredHandleDereference smi_check;
2452 if (isolate()->heap()->InNewSpace(*object)) { 2452 if (isolate()->heap()->InNewSpace(*object)) {
2453 Register temp = ToRegister(instr->temp()); 2453 Register temp = ToRegister(instr->temp());
2454 Handle<Cell> cell = isolate()->factory()->NewCell(object); 2454 Handle<Cell> cell = isolate()->factory()->NewCell(object);
2455 __ Mov(temp, Operand(Handle<Object>(cell))); 2455 __ Mov(temp, Operand(Handle<Object>(cell)));
2456 __ Ldr(temp, FieldMemOperand(temp, Cell::kValueOffset)); 2456 __ Ldr(temp, FieldMemOperand(temp, Cell::kValueOffset));
2457 __ Cmp(reg, temp); 2457 __ Cmp(reg, temp);
2458 } else { 2458 } else {
2459 __ Cmp(reg, Operand(object)); 2459 __ Cmp(reg, Operand(object));
2460 } 2460 }
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
3107 3107
3108 // Check the marker in the calling frame. 3108 // Check the marker in the calling frame.
3109 __ Bind(&check_frame_marker); 3109 __ Bind(&check_frame_marker);
3110 __ Ldr(temp1, MemOperand(temp1, StandardFrameConstants::kMarkerOffset)); 3110 __ Ldr(temp1, MemOperand(temp1, StandardFrameConstants::kMarkerOffset));
3111 3111
3112 EmitCompareAndBranch( 3112 EmitCompareAndBranch(
3113 instr, eq, temp1, Operand(Smi::FromInt(StackFrame::CONSTRUCT))); 3113 instr, eq, temp1, Operand(Smi::FromInt(StackFrame::CONSTRUCT)));
3114 } 3114 }
3115 3115
3116 3116
3117 void LCodeGen::DoIsNumberAndBranch(LIsNumberAndBranch* instr) {
3118 Representation r = instr->hydrogen()->value()->representation();
3119 if (r.IsSmiOrInteger32() || r.IsDouble()) {
3120 __ B(instr->TrueLabel(chunk_));
3121 } else {
3122 ASSERT(r.IsTagged());
3123 Register value = ToRegister(instr->value());
3124 HType type = instr->hydrogen()->value()->type();
3125 if (type.IsTaggedNumber()) {
3126 __ B(instr->TrueLabel(chunk_));
3127 }
3128 __ JumpIfSmi(value, instr->TrueLabel(chunk_));
3129
3130 EmitBranchIfHeapNumber(instr, value);
3131 }
3132 }
3133
3134
3135 void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { 3117 void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) {
3136 Label* is_object = instr->TrueLabel(chunk_); 3118 Label* is_object = instr->TrueLabel(chunk_);
3137 Label* is_not_object = instr->FalseLabel(chunk_); 3119 Label* is_not_object = instr->FalseLabel(chunk_);
3138 Register value = ToRegister(instr->value()); 3120 Register value = ToRegister(instr->value());
3139 Register map = ToRegister(instr->temp1()); 3121 Register map = ToRegister(instr->temp1());
3140 Register scratch = ToRegister(instr->temp2()); 3122 Register scratch = ToRegister(instr->temp2());
3141 3123
3142 __ JumpIfSmi(value, is_not_object); 3124 __ JumpIfSmi(value, is_not_object);
3143 __ JumpIfRoot(value, Heap::kNullValueRootIndex, is_object); 3125 __ JumpIfRoot(value, Heap::kNullValueRootIndex, is_object);
3144 3126
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
3558 ASSERT(ToRegister(instr->object()).is(x0)); 3540 ASSERT(ToRegister(instr->object()).is(x0));
3559 __ Mov(x2, Operand(instr->name())); 3541 __ Mov(x2, Operand(instr->name()));
3560 3542
3561 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); 3543 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
3562 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3544 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3563 3545
3564 ASSERT(ToRegister(instr->result()).is(x0)); 3546 ASSERT(ToRegister(instr->result()).is(x0));
3565 } 3547 }
3566 3548
3567 3549
3550 void LCodeGen::DoLoadRoot(LLoadRoot* instr) {
3551 Register result = ToRegister(instr->result());
3552 __ LoadRoot(result, instr->index());
3553 }
3554
3555
3568 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { 3556 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) {
3569 Register result = ToRegister(instr->result()); 3557 Register result = ToRegister(instr->result());
3570 Register map = ToRegister(instr->value()); 3558 Register map = ToRegister(instr->value());
3571 __ EnumLengthSmi(result, map); 3559 __ EnumLengthSmi(result, map);
3572 } 3560 }
3573 3561
3574 3562
3575 void LCodeGen::DoMathAbs(LMathAbs* instr) { 3563 void LCodeGen::DoMathAbs(LMathAbs* instr) {
3576 Representation r = instr->hydrogen()->value()->representation(); 3564 Representation r = instr->hydrogen()->value()->representation();
3577 if (r.IsDouble()) { 3565 if (r.IsDouble()) {
(...skipping 2036 matching lines...) Expand 10 before | Expand all | Expand 10 after
5614 __ Bind(&out_of_object); 5602 __ Bind(&out_of_object);
5615 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5603 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
5616 // Index is equal to negated out of object property index plus 1. 5604 // Index is equal to negated out of object property index plus 1.
5617 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5605 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5618 __ Ldr(result, FieldMemOperand(result, 5606 __ Ldr(result, FieldMemOperand(result,
5619 FixedArray::kHeaderSize - kPointerSize)); 5607 FixedArray::kHeaderSize - kPointerSize));
5620 __ Bind(&done); 5608 __ Bind(&done);
5621 } 5609 }
5622 5610
5623 } } // namespace v8::internal 5611 } } // 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