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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2222 DCHECK(StoreDescriptor::ValueRegister().is(eax)); | 2222 DCHECK(StoreDescriptor::ValueRegister().is(eax)); |
2223 Handle<Code> ic = | 2223 Handle<Code> ic = |
2224 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | 2224 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); |
2225 EmitLoadStoreICSlot(expr->AssignmentSlot()); | 2225 EmitLoadStoreICSlot(expr->AssignmentSlot()); |
2226 CallIC(ic); | 2226 CallIC(ic); |
2227 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 2227 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
2228 context()->Plug(eax); | 2228 context()->Plug(eax); |
2229 } | 2229 } |
2230 | 2230 |
2231 | 2231 |
2232 void FullCodeGenerator::VisitProperty(Property* expr) { | |
2233 Comment cmnt(masm_, "[ Property"); | |
2234 SetExpressionPosition(expr); | |
2235 | |
2236 Expression* key = expr->key(); | |
2237 | |
2238 if (key->IsPropertyName()) { | |
2239 if (!expr->IsSuperAccess()) { | |
2240 VisitForAccumulatorValue(expr->obj()); | |
2241 __ Move(LoadDescriptor::ReceiverRegister(), result_register()); | |
2242 EmitNamedPropertyLoad(expr); | |
2243 } else { | |
2244 VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var()); | |
2245 VisitForStackValue( | |
2246 expr->obj()->AsSuperPropertyReference()->home_object()); | |
2247 EmitNamedSuperPropertyLoad(expr); | |
2248 } | |
2249 } else { | |
2250 if (!expr->IsSuperAccess()) { | |
2251 VisitForStackValue(expr->obj()); | |
2252 VisitForAccumulatorValue(expr->key()); | |
2253 PopOperand(LoadDescriptor::ReceiverRegister()); // Object. | |
2254 __ Move(LoadDescriptor::NameRegister(), result_register()); // Key. | |
2255 EmitKeyedPropertyLoad(expr); | |
2256 } else { | |
2257 VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var()); | |
2258 VisitForStackValue( | |
2259 expr->obj()->AsSuperPropertyReference()->home_object()); | |
2260 VisitForStackValue(expr->key()); | |
2261 EmitKeyedSuperPropertyLoad(expr); | |
2262 } | |
2263 } | |
2264 PrepareForBailoutForId(expr->LoadId(), TOS_REG); | |
2265 context()->Plug(eax); | |
2266 } | |
2267 | |
2268 | |
2269 void FullCodeGenerator::CallIC(Handle<Code> code, | 2232 void FullCodeGenerator::CallIC(Handle<Code> code, |
2270 TypeFeedbackId ast_id) { | 2233 TypeFeedbackId ast_id) { |
2271 ic_total_count_++; | 2234 ic_total_count_++; |
2272 __ call(code, RelocInfo::CODE_TARGET, ast_id); | 2235 __ call(code, RelocInfo::CODE_TARGET, ast_id); |
2273 } | 2236 } |
2274 | 2237 |
2275 | 2238 |
2276 // Code common for calls using the IC. | 2239 // Code common for calls using the IC. |
2277 void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) { | 2240 void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) { |
2278 Expression* callee = expr->expression(); | 2241 Expression* callee = expr->expression(); |
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3865 isolate->builtins()->OnStackReplacement()->entry(), | 3828 isolate->builtins()->OnStackReplacement()->entry(), |
3866 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3829 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3867 return ON_STACK_REPLACEMENT; | 3830 return ON_STACK_REPLACEMENT; |
3868 } | 3831 } |
3869 | 3832 |
3870 | 3833 |
3871 } // namespace internal | 3834 } // namespace internal |
3872 } // namespace v8 | 3835 } // namespace v8 |
3873 | 3836 |
3874 #endif // V8_TARGET_ARCH_IA32 | 3837 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |