OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "arm64/lithium-codegen-arm64.h" | 7 #include "arm64/lithium-codegen-arm64.h" |
8 #include "arm64/lithium-gap-resolver-arm64.h" | 8 #include "arm64/lithium-gap-resolver-arm64.h" |
9 #include "code-stubs.h" | 9 #include "code-stubs.h" |
10 #include "stub-cache.h" | 10 #include "stub-cache.h" |
(...skipping 2097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2108 codegen()->DoDeferredInstanceMigration(instr_, object_); | 2108 codegen()->DoDeferredInstanceMigration(instr_, object_); |
2109 } | 2109 } |
2110 Label* check_maps() { return &check_maps_; } | 2110 Label* check_maps() { return &check_maps_; } |
2111 virtual LInstruction* instr() { return instr_; } | 2111 virtual LInstruction* instr() { return instr_; } |
2112 private: | 2112 private: |
2113 LCheckMaps* instr_; | 2113 LCheckMaps* instr_; |
2114 Label check_maps_; | 2114 Label check_maps_; |
2115 Register object_; | 2115 Register object_; |
2116 }; | 2116 }; |
2117 | 2117 |
2118 if (instr->hydrogen()->CanOmitMapChecks()) { | 2118 if (instr->hydrogen()->IsStabilityCheck()) { |
2119 ASSERT(instr->value() == NULL); | 2119 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); |
2120 ASSERT(instr->temp() == NULL); | 2120 for (int i = 0; i < maps->size(); ++i) { |
| 2121 AddStabilityDependency(maps->at(i).handle()); |
| 2122 } |
2121 return; | 2123 return; |
2122 } | 2124 } |
2123 | 2125 |
2124 Register object = ToRegister(instr->value()); | 2126 Register object = ToRegister(instr->value()); |
2125 Register map_reg = ToRegister(instr->temp()); | 2127 Register map_reg = ToRegister(instr->temp()); |
2126 | 2128 |
2127 __ Ldr(map_reg, FieldMemOperand(object, HeapObject::kMapOffset)); | 2129 __ Ldr(map_reg, FieldMemOperand(object, HeapObject::kMapOffset)); |
2128 | 2130 |
2129 DeferredCheckMaps* deferred = NULL; | 2131 DeferredCheckMaps* deferred = NULL; |
2130 if (instr->hydrogen()->has_migration_target()) { | 2132 if (instr->hydrogen()->HasMigrationTarget()) { |
2131 deferred = new(zone()) DeferredCheckMaps(this, instr, object); | 2133 deferred = new(zone()) DeferredCheckMaps(this, instr, object); |
2132 __ Bind(deferred->check_maps()); | 2134 __ Bind(deferred->check_maps()); |
2133 } | 2135 } |
2134 | 2136 |
2135 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); | 2137 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); |
2136 Label success; | 2138 Label success; |
2137 for (int i = 0; i < maps->size() - 1; i++) { | 2139 for (int i = 0; i < maps->size() - 1; i++) { |
2138 Handle<Map> map = maps->at(i).handle(); | 2140 Handle<Map> map = maps->at(i).handle(); |
2139 __ CompareMap(map_reg, map); | 2141 __ CompareMap(map_reg, map); |
2140 __ B(eq, &success); | 2142 __ B(eq, &success); |
2141 } | 2143 } |
2142 Handle<Map> map = maps->at(maps->size() - 1).handle(); | 2144 Handle<Map> map = maps->at(maps->size() - 1).handle(); |
2143 __ CompareMap(map_reg, map); | 2145 __ CompareMap(map_reg, map); |
2144 | 2146 |
2145 // We didn't match a map. | 2147 // We didn't match a map. |
2146 if (instr->hydrogen()->has_migration_target()) { | 2148 if (instr->hydrogen()->HasMigrationTarget()) { |
2147 __ B(ne, deferred->entry()); | 2149 __ B(ne, deferred->entry()); |
2148 } else { | 2150 } else { |
2149 DeoptimizeIf(ne, instr->environment()); | 2151 DeoptimizeIf(ne, instr->environment()); |
2150 } | 2152 } |
2151 | 2153 |
2152 __ Bind(&success); | 2154 __ Bind(&success); |
2153 } | 2155 } |
2154 | 2156 |
2155 | 2157 |
2156 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { | 2158 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { |
(...skipping 3786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5943 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5945 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
5944 // Index is equal to negated out of object property index plus 1. | 5946 // Index is equal to negated out of object property index plus 1. |
5945 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5947 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5946 __ Ldr(result, FieldMemOperand(result, | 5948 __ Ldr(result, FieldMemOperand(result, |
5947 FixedArray::kHeaderSize - kPointerSize)); | 5949 FixedArray::kHeaderSize - kPointerSize)); |
5948 __ Bind(deferred->exit()); | 5950 __ Bind(deferred->exit()); |
5949 __ Bind(&done); | 5951 __ Bind(&done); |
5950 } | 5952 } |
5951 | 5953 |
5952 } } // namespace v8::internal | 5954 } } // namespace v8::internal |
OLD | NEW |