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

Side by Side Diff: src/code-stubs.cc

Issue 2031753003: [stubs] Introducing LoadICTFStub and LoadICTrampolineTFStub and a switch to enable them instead of … (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressing comments Created 4 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
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/code-stubs.h" 5 #include "src/code-stubs.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 case CompareICState::KNOWN_RECEIVER: 436 case CompareICState::KNOWN_RECEIVER:
437 DCHECK(*known_map_ != NULL); 437 DCHECK(*known_map_ != NULL);
438 GenerateKnownReceivers(masm); 438 GenerateKnownReceivers(masm);
439 break; 439 break;
440 case CompareICState::GENERIC: 440 case CompareICState::GENERIC:
441 GenerateGeneric(masm); 441 GenerateGeneric(masm);
442 break; 442 break;
443 } 443 }
444 } 444 }
445 445
446
447 Handle<Code> TurboFanCodeStub::GenerateCode() { 446 Handle<Code> TurboFanCodeStub::GenerateCode() {
448 const char* name = CodeStub::MajorName(MajorKey()); 447 const char* name = CodeStub::MajorName(MajorKey());
449 Zone zone(isolate()->allocator()); 448 Zone zone(isolate()->allocator());
450 CallInterfaceDescriptor descriptor(GetCallInterfaceDescriptor()); 449 CallInterfaceDescriptor descriptor(GetCallInterfaceDescriptor());
451 CodeStubAssembler assembler(isolate(), &zone, descriptor, GetCodeFlags(), 450 CodeStubAssembler assembler(isolate(), &zone, descriptor, GetCodeFlags(),
452 name); 451 name);
453 GenerateAssembly(&assembler); 452 GenerateAssembly(&assembler);
454 return assembler.GenerateCode(); 453 return assembler.GenerateCode();
455 } 454 }
456 455
456 void LoadICTrampolineTFStub::GenerateAssembly(
457 CodeStubAssembler* assembler) const {
458 typedef compiler::Node Node;
459 typedef CodeStubAssembler::Label Label;
460
461 Node* receiver = assembler->Parameter(0);
462 Node* name = assembler->Parameter(1);
463 Node* slot = assembler->Parameter(2);
464 Node* context = assembler->Parameter(3);
465 Node* vector = assembler->LoadTypeFeedbackVectorForStub();
466
467 CodeStubAssembler::LoadICParameters p(context, receiver, name, slot, vector);
468 Label miss(assembler);
469 assembler->LoadIC(&p, &miss);
470
471 assembler->Bind(&miss);
472 assembler->TailCallRuntime(Runtime::kLoadIC_Miss, context, receiver, name,
473 slot, vector);
474 }
475
476 void LoadICTFStub::GenerateAssembly(CodeStubAssembler* assembler) const {
477 typedef compiler::Node Node;
478 typedef CodeStubAssembler::Label Label;
479
480 Node* receiver = assembler->Parameter(0);
481 Node* name = assembler->Parameter(1);
482 Node* slot = assembler->Parameter(2);
483 Node* vector = assembler->Parameter(3);
484 Node* context = assembler->Parameter(4);
485
486 CodeStubAssembler::LoadICParameters p(context, receiver, name, slot, vector);
487 Label miss(assembler);
488 assembler->LoadIC(&p, &miss);
489
490 assembler->Bind(&miss);
491 assembler->TailCallRuntime(Runtime::kLoadIC_Miss, context, receiver, name,
492 slot, vector);
493 }
494
457 void AllocateHeapNumberStub::GenerateAssembly( 495 void AllocateHeapNumberStub::GenerateAssembly(
458 CodeStubAssembler* assembler) const { 496 CodeStubAssembler* assembler) const {
459 typedef compiler::Node Node; 497 typedef compiler::Node Node;
460 498
461 Node* result = assembler->AllocateHeapNumber(); 499 Node* result = assembler->AllocateHeapNumber();
462 assembler->Return(result); 500 assembler->Return(result);
463 } 501 }
464 502
465 #define SIMD128_GEN_ASM(TYPE, Type, type, lane_count, lane_type) \ 503 #define SIMD128_GEN_ASM(TYPE, Type, type, lane_count, lane_type) \
466 void Allocate##Type##Stub::GenerateAssembly(CodeStubAssembler* assembler) \ 504 void Allocate##Type##Stub::GenerateAssembly(CodeStubAssembler* assembler) \
(...skipping 4272 matching lines...) Expand 10 before | Expand all | Expand 10 after
4739 if (type->Is(Type::UntaggedPointer())) { 4777 if (type->Is(Type::UntaggedPointer())) {
4740 return Representation::External(); 4778 return Representation::External();
4741 } 4779 }
4742 4780
4743 DCHECK(!type->Is(Type::Untagged())); 4781 DCHECK(!type->Is(Type::Untagged()));
4744 return Representation::Tagged(); 4782 return Representation::Tagged();
4745 } 4783 }
4746 4784
4747 } // namespace internal 4785 } // namespace internal
4748 } // namespace v8 4786 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler.cc » ('j') | test/cctest/test-code-stub-assembler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698