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

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

Issue 1178363002: Vector ICs: Turbofan vector store ic support (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix mips64 compile error. Created 5 years, 6 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
« no previous file with comments | « src/mips64/full-codegen-mips64.cc ('k') | test/unittests/compiler/js-operator-unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
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 2440 matching lines...) Expand 10 before | Expand all | Expand 10 after
2451 default: 2451 default:
2452 UNREACHABLE(); 2452 UNREACHABLE();
2453 break; 2453 break;
2454 } 2454 }
2455 2455
2456 __ bind(&done); 2456 __ bind(&done);
2457 context()->Plug(rax); 2457 context()->Plug(rax);
2458 } 2458 }
2459 2459
2460 2460
2461 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { 2461 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit,
2462 int* used_store_slots) {
2462 // Constructor is in rax. 2463 // Constructor is in rax.
2463 DCHECK(lit != NULL); 2464 DCHECK(lit != NULL);
2464 __ Push(rax); 2465 __ Push(rax);
2465 2466
2466 // No access check is needed here since the constructor is created by the 2467 // No access check is needed here since the constructor is created by the
2467 // class literal. 2468 // class literal.
2468 Register scratch = rbx; 2469 Register scratch = rbx;
2469 __ movp(scratch, FieldOperand(rax, JSFunction::kPrototypeOrInitialMapOffset)); 2470 __ movp(scratch, FieldOperand(rax, JSFunction::kPrototypeOrInitialMapOffset));
2470 __ Push(scratch); 2471 __ Push(scratch);
2471 2472
2472 // store_slot_index points to the vector IC slot for the next store IC used.
2473 // ClassLiteral::ComputeFeedbackRequirements controls the allocation of slots
2474 // and must be updated if the number of store ICs emitted here changes.
2475 int store_slot_index = 0;
2476 for (int i = 0; i < lit->properties()->length(); i++) { 2473 for (int i = 0; i < lit->properties()->length(); i++) {
2477 ObjectLiteral::Property* property = lit->properties()->at(i); 2474 ObjectLiteral::Property* property = lit->properties()->at(i);
2478 Expression* value = property->value(); 2475 Expression* value = property->value();
2479 2476
2480 if (property->is_static()) { 2477 if (property->is_static()) {
2481 __ Push(Operand(rsp, kPointerSize)); // constructor 2478 __ Push(Operand(rsp, kPointerSize)); // constructor
2482 } else { 2479 } else {
2483 __ Push(Operand(rsp, 0)); // prototype 2480 __ Push(Operand(rsp, 0)); // prototype
2484 } 2481 }
2485 EmitPropertyKey(property, lit->GetIdForProperty(i)); 2482 EmitPropertyKey(property, lit->GetIdForProperty(i));
2486 2483
2487 // The static prototype property is read only. We handle the non computed 2484 // The static prototype property is read only. We handle the non computed
2488 // property name case in the parser. Since this is the only case where we 2485 // property name case in the parser. Since this is the only case where we
2489 // need to check for an own read only property we special case this so we do 2486 // need to check for an own read only property we special case this so we do
2490 // not need to do this for every property. 2487 // not need to do this for every property.
2491 if (property->is_static() && property->is_computed_name()) { 2488 if (property->is_static() && property->is_computed_name()) {
2492 __ CallRuntime(Runtime::kThrowIfStaticPrototype, 1); 2489 __ CallRuntime(Runtime::kThrowIfStaticPrototype, 1);
2493 __ Push(rax); 2490 __ Push(rax);
2494 } 2491 }
2495 2492
2496 VisitForStackValue(value); 2493 VisitForStackValue(value);
2497 EmitSetHomeObjectIfNeeded(value, 2, 2494 EmitSetHomeObjectIfNeeded(value, 2,
2498 lit->SlotForHomeObject(value, &store_slot_index)); 2495 lit->SlotForHomeObject(value, used_store_slots));
2499 2496
2500 switch (property->kind()) { 2497 switch (property->kind()) {
2501 case ObjectLiteral::Property::CONSTANT: 2498 case ObjectLiteral::Property::CONSTANT:
2502 case ObjectLiteral::Property::MATERIALIZED_LITERAL: 2499 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
2503 case ObjectLiteral::Property::PROTOTYPE: 2500 case ObjectLiteral::Property::PROTOTYPE:
2504 UNREACHABLE(); 2501 UNREACHABLE();
2505 case ObjectLiteral::Property::COMPUTED: 2502 case ObjectLiteral::Property::COMPUTED:
2506 __ CallRuntime(Runtime::kDefineClassMethod, 3); 2503 __ CallRuntime(Runtime::kDefineClassMethod, 3);
2507 break; 2504 break;
2508 2505
(...skipping 10 matching lines...) Expand all
2519 default: 2516 default:
2520 UNREACHABLE(); 2517 UNREACHABLE();
2521 } 2518 }
2522 } 2519 }
2523 2520
2524 // prototype 2521 // prototype
2525 __ CallRuntime(Runtime::kToFastProperties, 1); 2522 __ CallRuntime(Runtime::kToFastProperties, 1);
2526 2523
2527 // constructor 2524 // constructor
2528 __ CallRuntime(Runtime::kToFastProperties, 1); 2525 __ CallRuntime(Runtime::kToFastProperties, 1);
2529
2530 // Verify that compilation exactly consumed the number of store ic slots that
2531 // the ClassLiteral node had to offer.
2532 DCHECK(!FLAG_vector_stores || store_slot_index == lit->slot_count());
2533 } 2526 }
2534 2527
2535 2528
2536 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { 2529 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
2537 __ Pop(rdx); 2530 __ Pop(rdx);
2538 Handle<Code> code = 2531 Handle<Code> code =
2539 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); 2532 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code();
2540 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 2533 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
2541 CallIC(code, expr->BinaryOperationFeedbackId()); 2534 CallIC(code, expr->BinaryOperationFeedbackId());
2542 patch_site.EmitPatchInfo(); 2535 patch_site.EmitPatchInfo();
(...skipping 2960 matching lines...) Expand 10 before | Expand all | Expand 10 after
5503 Assembler::target_address_at(call_target_address, 5496 Assembler::target_address_at(call_target_address,
5504 unoptimized_code)); 5497 unoptimized_code));
5505 return OSR_AFTER_STACK_CHECK; 5498 return OSR_AFTER_STACK_CHECK;
5506 } 5499 }
5507 5500
5508 5501
5509 } // namespace internal 5502 } // namespace internal
5510 } // namespace v8 5503 } // namespace v8
5511 5504
5512 #endif // V8_TARGET_ARCH_X64 5505 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/mips64/full-codegen-mips64.cc ('k') | test/unittests/compiler/js-operator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698