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

Side by Side Diff: src/full-codegen/x87/full-codegen-x87.cc

Issue 1962663002: [fullcodegen] Factor out VisitProperty from architectures. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
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_X87 5 #if V8_TARGET_ARCH_X87
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 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after
2214 DCHECK(StoreDescriptor::ValueRegister().is(eax)); 2214 DCHECK(StoreDescriptor::ValueRegister().is(eax));
2215 Handle<Code> ic = 2215 Handle<Code> ic =
2216 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); 2216 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
2217 EmitLoadStoreICSlot(expr->AssignmentSlot()); 2217 EmitLoadStoreICSlot(expr->AssignmentSlot());
2218 CallIC(ic); 2218 CallIC(ic);
2219 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); 2219 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
2220 context()->Plug(eax); 2220 context()->Plug(eax);
2221 } 2221 }
2222 2222
2223 2223
2224 void FullCodeGenerator::VisitProperty(Property* expr) {
2225 Comment cmnt(masm_, "[ Property");
2226 SetExpressionPosition(expr);
2227
2228 Expression* key = expr->key();
2229
2230 if (key->IsPropertyName()) {
2231 if (!expr->IsSuperAccess()) {
2232 VisitForAccumulatorValue(expr->obj());
2233 __ Move(LoadDescriptor::ReceiverRegister(), result_register());
2234 EmitNamedPropertyLoad(expr);
2235 } else {
2236 VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
2237 VisitForStackValue(
2238 expr->obj()->AsSuperPropertyReference()->home_object());
2239 EmitNamedSuperPropertyLoad(expr);
2240 }
2241 } else {
2242 if (!expr->IsSuperAccess()) {
2243 VisitForStackValue(expr->obj());
2244 VisitForAccumulatorValue(expr->key());
2245 PopOperand(LoadDescriptor::ReceiverRegister()); // Object.
2246 __ Move(LoadDescriptor::NameRegister(), result_register()); // Key.
2247 EmitKeyedPropertyLoad(expr);
2248 } else {
2249 VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
2250 VisitForStackValue(
2251 expr->obj()->AsSuperPropertyReference()->home_object());
2252 VisitForStackValue(expr->key());
2253 EmitKeyedSuperPropertyLoad(expr);
2254 }
2255 }
2256 PrepareForBailoutForId(expr->LoadId(), TOS_REG);
2257 context()->Plug(eax);
2258 }
2259
2260
2261 void FullCodeGenerator::CallIC(Handle<Code> code, 2224 void FullCodeGenerator::CallIC(Handle<Code> code,
2262 TypeFeedbackId ast_id) { 2225 TypeFeedbackId ast_id) {
2263 ic_total_count_++; 2226 ic_total_count_++;
2264 __ call(code, RelocInfo::CODE_TARGET, ast_id); 2227 __ call(code, RelocInfo::CODE_TARGET, ast_id);
2265 } 2228 }
2266 2229
2267 2230
2268 // Code common for calls using the IC. 2231 // Code common for calls using the IC.
2269 void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) { 2232 void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) {
2270 Expression* callee = expr->expression(); 2233 Expression* callee = expr->expression();
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after
3857 isolate->builtins()->OnStackReplacement()->entry(), 3820 isolate->builtins()->OnStackReplacement()->entry(),
3858 Assembler::target_address_at(call_target_address, unoptimized_code)); 3821 Assembler::target_address_at(call_target_address, unoptimized_code));
3859 return ON_STACK_REPLACEMENT; 3822 return ON_STACK_REPLACEMENT;
3860 } 3823 }
3861 3824
3862 3825
3863 } // namespace internal 3826 } // namespace internal
3864 } // namespace v8 3827 } // namespace v8
3865 3828
3866 #endif // V8_TARGET_ARCH_X87 3829 #endif // V8_TARGET_ARCH_X87
OLDNEW
« src/full-codegen/full-codegen.cc ('K') | « src/full-codegen/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698