Chromium Code Reviews| 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 "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2165 CallIC(code, expr->BinaryOperationFeedbackId()); | 2165 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2166 patch_site.EmitPatchInfo(); | 2166 patch_site.EmitPatchInfo(); |
| 2167 } | 2167 } |
| 2168 context()->Plug(x0); | 2168 context()->Plug(x0); |
| 2169 } | 2169 } |
| 2170 | 2170 |
| 2171 | 2171 |
| 2172 void FullCodeGenerator::EmitAssignment(Expression* expr) { | 2172 void FullCodeGenerator::EmitAssignment(Expression* expr) { |
| 2173 DCHECK(expr->IsValidReferenceExpression()); | 2173 DCHECK(expr->IsValidReferenceExpression()); |
| 2174 | 2174 |
| 2175 // Left-hand side can only be a property, a global or a (parameter or local) | |
| 2176 // slot. | |
| 2177 enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY }; | |
| 2178 LhsKind assign_type = VARIABLE; | |
| 2179 Property* prop = expr->AsProperty(); | 2175 Property* prop = expr->AsProperty(); |
| 2180 if (prop != NULL) { | 2176 LhsKind assign_type = GetAssignType(prop); |
| 2181 assign_type = (prop->key()->IsPropertyName()) | |
| 2182 ? NAMED_PROPERTY | |
| 2183 : KEYED_PROPERTY; | |
| 2184 } | |
| 2185 | 2177 |
| 2186 switch (assign_type) { | 2178 switch (assign_type) { |
| 2187 case VARIABLE: { | 2179 case VARIABLE: { |
| 2188 Variable* var = expr->AsVariableProxy()->var(); | 2180 Variable* var = expr->AsVariableProxy()->var(); |
| 2189 EffectContext context(this); | 2181 EffectContext context(this); |
| 2190 EmitVariableAssignment(var, Token::ASSIGN); | 2182 EmitVariableAssignment(var, Token::ASSIGN); |
| 2191 break; | 2183 break; |
| 2192 } | 2184 } |
| 2193 case NAMED_PROPERTY: { | 2185 case NAMED_PROPERTY: { |
| 2194 __ Push(x0); // Preserve value. | 2186 __ Push(x0); // Preserve value. |
| 2195 VisitForAccumulatorValue(prop->obj()); | 2187 VisitForAccumulatorValue(prop->obj()); |
| 2196 // TODO(all): We could introduce a VisitForRegValue(reg, expr) to avoid | 2188 // TODO(all): We could introduce a VisitForRegValue(reg, expr) to avoid |
| 2197 // this copy. | 2189 // this copy. |
| 2198 __ Mov(StoreDescriptor::ReceiverRegister(), x0); | 2190 __ Mov(StoreDescriptor::ReceiverRegister(), x0); |
| 2199 __ Pop(StoreDescriptor::ValueRegister()); // Restore value. | 2191 __ Pop(StoreDescriptor::ValueRegister()); // Restore value. |
| 2200 __ Mov(StoreDescriptor::NameRegister(), | 2192 __ Mov(StoreDescriptor::NameRegister(), |
| 2201 Operand(prop->key()->AsLiteral()->value())); | 2193 Operand(prop->key()->AsLiteral()->value())); |
| 2202 CallStoreIC(); | 2194 CallStoreIC(); |
| 2203 break; | 2195 break; |
| 2204 } | 2196 } |
| 2197 case NAMED_SUPER_PROPERTY: { | |
| 2198 __ Push(x0); | |
| 2199 VisitForStackValue(prop->obj()->AsSuperReference()->this_var()); | |
| 2200 EmitLoadHomeObject(prop->obj()->AsSuperReference()); | |
| 2201 // stack: value, this; x0: home_object | |
| 2202 Register scratch = x10; | |
| 2203 Register scratch2 = x11; | |
| 2204 __ mov(scratch, result_register()); // home_object | |
| 2205 __ Peek(scratch2, kPointerSize); // value | |
|
Igor Sheludko
2014/10/13 11:39:07
Same note here as for arm.
Dmitry Lomov (no reviews)
2014/10/13 12:39:51
Done.
| |
| 2206 __ Peek(x0, 0); // this | |
| 2207 __ Poke(x0, kPointerSize); // this | |
| 2208 __ Poke(scratch, 0); // home_object | |
| 2209 __ Move(x0, scratch2); | |
| 2210 // stack: this, home_object; x0: value | |
| 2211 EmitNamedSuperPropertyStore(prop); | |
| 2212 break; | |
| 2213 } | |
| 2214 case KEYED_SUPER_PROPERTY: { | |
| 2215 __ Push(x0); | |
| 2216 VisitForStackValue(prop->obj()->AsSuperReference()->this_var()); | |
| 2217 EmitLoadHomeObject(prop->obj()->AsSuperReference()); | |
| 2218 __ Push(result_register()); | |
| 2219 VisitForAccumulatorValue(prop->key()); | |
| 2220 Register scratch = x10; | |
| 2221 Register scratch2 = x11; | |
| 2222 __ Peek(scratch2, 2 * kPointerSize); // value | |
| 2223 // stack: value, this, home_object; x0: key, x11: value | |
| 2224 __ Peek(scratch, kPointerSize); // this | |
| 2225 __ Poke(scratch, 2 * kPointerSize); | |
| 2226 __ Peek(scratch, 0); // home_object | |
| 2227 __ Poke(scratch, kPointerSize); | |
| 2228 __ Poke(x0, 0); | |
| 2229 __ Move(x0, scratch2); | |
| 2230 // stack: this, home_object, key; x0: value. | |
| 2231 EmitKeyedSuperPropertyStore(prop); | |
| 2232 break; | |
| 2233 } | |
| 2205 case KEYED_PROPERTY: { | 2234 case KEYED_PROPERTY: { |
| 2206 __ Push(x0); // Preserve value. | 2235 __ Push(x0); // Preserve value. |
| 2207 VisitForStackValue(prop->obj()); | 2236 VisitForStackValue(prop->obj()); |
| 2208 VisitForAccumulatorValue(prop->key()); | 2237 VisitForAccumulatorValue(prop->key()); |
| 2209 __ Mov(StoreDescriptor::NameRegister(), x0); | 2238 __ Mov(StoreDescriptor::NameRegister(), x0); |
| 2210 __ Pop(StoreDescriptor::ReceiverRegister(), | 2239 __ Pop(StoreDescriptor::ReceiverRegister(), |
| 2211 StoreDescriptor::ValueRegister()); | 2240 StoreDescriptor::ValueRegister()); |
| 2212 Handle<Code> ic = | 2241 Handle<Code> ic = |
| 2213 CodeFactory::KeyedStoreIC(isolate(), strict_mode()).code(); | 2242 CodeFactory::KeyedStoreIC(isolate(), strict_mode()).code(); |
| 2214 CallIC(ic); | 2243 CallIC(ic); |
| (...skipping 2966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5181 return previous_; | 5210 return previous_; |
| 5182 } | 5211 } |
| 5183 | 5212 |
| 5184 | 5213 |
| 5185 #undef __ | 5214 #undef __ |
| 5186 | 5215 |
| 5187 | 5216 |
| 5188 } } // namespace v8::internal | 5217 } } // namespace v8::internal |
| 5189 | 5218 |
| 5190 #endif // V8_TARGET_ARCH_ARM64 | 5219 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |