| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2208 Handle<Code> ic = | 2208 Handle<Code> ic = |
| 2209 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | 2209 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); |
| 2210 EmitLoadStoreICSlot(expr->AssignmentSlot()); | 2210 EmitLoadStoreICSlot(expr->AssignmentSlot()); |
| 2211 CallIC(ic); | 2211 CallIC(ic); |
| 2212 | 2212 |
| 2213 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 2213 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
| 2214 context()->Plug(rax); | 2214 context()->Plug(rax); |
| 2215 } | 2215 } |
| 2216 | 2216 |
| 2217 | 2217 |
| 2218 void FullCodeGenerator::VisitProperty(Property* expr) { | |
| 2219 Comment cmnt(masm_, "[ Property"); | |
| 2220 SetExpressionPosition(expr); | |
| 2221 | |
| 2222 Expression* key = expr->key(); | |
| 2223 | |
| 2224 if (key->IsPropertyName()) { | |
| 2225 if (!expr->IsSuperAccess()) { | |
| 2226 VisitForAccumulatorValue(expr->obj()); | |
| 2227 DCHECK(!rax.is(LoadDescriptor::ReceiverRegister())); | |
| 2228 __ movp(LoadDescriptor::ReceiverRegister(), rax); | |
| 2229 EmitNamedPropertyLoad(expr); | |
| 2230 } else { | |
| 2231 VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var()); | |
| 2232 VisitForStackValue( | |
| 2233 expr->obj()->AsSuperPropertyReference()->home_object()); | |
| 2234 EmitNamedSuperPropertyLoad(expr); | |
| 2235 } | |
| 2236 } else { | |
| 2237 if (!expr->IsSuperAccess()) { | |
| 2238 VisitForStackValue(expr->obj()); | |
| 2239 VisitForAccumulatorValue(expr->key()); | |
| 2240 __ Move(LoadDescriptor::NameRegister(), rax); | |
| 2241 PopOperand(LoadDescriptor::ReceiverRegister()); | |
| 2242 EmitKeyedPropertyLoad(expr); | |
| 2243 } else { | |
| 2244 VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var()); | |
| 2245 VisitForStackValue( | |
| 2246 expr->obj()->AsSuperPropertyReference()->home_object()); | |
| 2247 VisitForStackValue(expr->key()); | |
| 2248 EmitKeyedSuperPropertyLoad(expr); | |
| 2249 } | |
| 2250 } | |
| 2251 PrepareForBailoutForId(expr->LoadId(), TOS_REG); | |
| 2252 context()->Plug(rax); | |
| 2253 } | |
| 2254 | |
| 2255 | |
| 2256 void FullCodeGenerator::CallIC(Handle<Code> code, | 2218 void FullCodeGenerator::CallIC(Handle<Code> code, |
| 2257 TypeFeedbackId ast_id) { | 2219 TypeFeedbackId ast_id) { |
| 2258 ic_total_count_++; | 2220 ic_total_count_++; |
| 2259 __ call(code, RelocInfo::CODE_TARGET, ast_id); | 2221 __ call(code, RelocInfo::CODE_TARGET, ast_id); |
| 2260 } | 2222 } |
| 2261 | 2223 |
| 2262 | 2224 |
| 2263 // Code common for calls using the IC. | 2225 // Code common for calls using the IC. |
| 2264 void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) { | 2226 void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) { |
| 2265 Expression* callee = expr->expression(); | 2227 Expression* callee = expr->expression(); |
| (...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3849 DCHECK_EQ( | 3811 DCHECK_EQ( |
| 3850 isolate->builtins()->OnStackReplacement()->entry(), | 3812 isolate->builtins()->OnStackReplacement()->entry(), |
| 3851 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3813 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 3852 return ON_STACK_REPLACEMENT; | 3814 return ON_STACK_REPLACEMENT; |
| 3853 } | 3815 } |
| 3854 | 3816 |
| 3855 } // namespace internal | 3817 } // namespace internal |
| 3856 } // namespace v8 | 3818 } // namespace v8 |
| 3857 | 3819 |
| 3858 #endif // V8_TARGET_ARCH_X64 | 3820 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |