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

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

Issue 2065113002: [ic] LoadGlobalIC caches PropertyCells in the feedback vector. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing 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
« no previous file with comments | « src/code-stubs.h ('k') | src/flag-definitions.h » ('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/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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 CallInterfaceDescriptor descriptor(GetCallInterfaceDescriptor()); 414 CallInterfaceDescriptor descriptor(GetCallInterfaceDescriptor());
415 CodeStubAssembler assembler(isolate(), &zone, descriptor, GetCodeFlags(), 415 CodeStubAssembler assembler(isolate(), &zone, descriptor, GetCodeFlags(),
416 name); 416 name);
417 GenerateAssembly(&assembler); 417 GenerateAssembly(&assembler);
418 return assembler.GenerateCode(); 418 return assembler.GenerateCode();
419 } 419 }
420 420
421 void LoadICTrampolineTFStub::GenerateAssembly( 421 void LoadICTrampolineTFStub::GenerateAssembly(
422 CodeStubAssembler* assembler) const { 422 CodeStubAssembler* assembler) const {
423 typedef compiler::Node Node; 423 typedef compiler::Node Node;
424 typedef CodeStubAssembler::Label Label;
425 424
426 Node* receiver = assembler->Parameter(0); 425 Node* receiver = assembler->Parameter(0);
427 Node* name = assembler->Parameter(1); 426 Node* name = assembler->Parameter(1);
428 Node* slot = assembler->Parameter(2); 427 Node* slot = assembler->Parameter(2);
429 Node* context = assembler->Parameter(3); 428 Node* context = assembler->Parameter(3);
430 Node* vector = assembler->LoadTypeFeedbackVectorForStub(); 429 Node* vector = assembler->LoadTypeFeedbackVectorForStub();
431 430
432 CodeStubAssembler::LoadICParameters p(context, receiver, name, slot, vector); 431 CodeStubAssembler::LoadICParameters p(context, receiver, name, slot, vector);
433 Label miss(assembler); 432 assembler->LoadIC(&p);
434 assembler->LoadIC(&p, &miss);
435
436 assembler->Bind(&miss);
437 assembler->TailCallRuntime(Runtime::kLoadIC_Miss, context, receiver, name,
438 slot, vector);
439 } 433 }
440 434
441 void LoadICTFStub::GenerateAssembly(CodeStubAssembler* assembler) const { 435 void LoadICTFStub::GenerateAssembly(CodeStubAssembler* assembler) const {
442 typedef compiler::Node Node; 436 typedef compiler::Node Node;
443 typedef CodeStubAssembler::Label Label;
444 437
445 Node* receiver = assembler->Parameter(0); 438 Node* receiver = assembler->Parameter(0);
446 Node* name = assembler->Parameter(1); 439 Node* name = assembler->Parameter(1);
447 Node* slot = assembler->Parameter(2); 440 Node* slot = assembler->Parameter(2);
448 Node* vector = assembler->Parameter(3); 441 Node* vector = assembler->Parameter(3);
449 Node* context = assembler->Parameter(4); 442 Node* context = assembler->Parameter(4);
450 443
451 CodeStubAssembler::LoadICParameters p(context, receiver, name, slot, vector); 444 CodeStubAssembler::LoadICParameters p(context, receiver, name, slot, vector);
452 Label miss(assembler); 445 assembler->LoadIC(&p);
453 assembler->LoadIC(&p, &miss); 446 }
454 447
455 assembler->Bind(&miss); 448 void LoadGlobalICTrampolineStub::GenerateAssembly(
456 assembler->TailCallRuntime(Runtime::kLoadIC_Miss, context, receiver, name, 449 CodeStubAssembler* assembler) const {
457 slot, vector); 450 if (!FLAG_new_load_global_ic) {
451 return LoadICTrampolineTFStub::GenerateAssembly(assembler);
452 }
453 typedef compiler::Node Node;
454
455 Node* name = assembler->Parameter(0);
456 Node* slot = assembler->Parameter(1);
457 Node* context = assembler->Parameter(2);
458 Node* vector = assembler->LoadTypeFeedbackVectorForStub();
459
460 CodeStubAssembler::LoadICParameters p(context, nullptr, name, slot, vector);
461 assembler->LoadGlobalIC(&p);
462 }
463
464 void LoadGlobalICStub::GenerateAssembly(CodeStubAssembler* assembler) const {
465 if (!FLAG_new_load_global_ic) {
466 return LoadICTFStub::GenerateAssembly(assembler);
467 }
468 typedef compiler::Node Node;
469
470 Node* name = assembler->Parameter(0);
471 Node* slot = assembler->Parameter(1);
472 Node* vector = assembler->Parameter(2);
473 Node* context = assembler->Parameter(3);
474
475 CodeStubAssembler::LoadICParameters p(context, nullptr, name, slot, vector);
476 assembler->LoadGlobalIC(&p);
458 } 477 }
459 478
460 void AllocateHeapNumberStub::GenerateAssembly( 479 void AllocateHeapNumberStub::GenerateAssembly(
461 CodeStubAssembler* assembler) const { 480 CodeStubAssembler* assembler) const {
462 typedef compiler::Node Node; 481 typedef compiler::Node Node;
463 482
464 Node* result = assembler->AllocateHeapNumber(); 483 Node* result = assembler->AllocateHeapNumber();
465 assembler->Return(result); 484 assembler->Return(result);
466 } 485 }
467 486
(...skipping 4250 matching lines...) Expand 10 before | Expand all | Expand 10 after
4718 if (type->Is(Type::UntaggedPointer())) { 4737 if (type->Is(Type::UntaggedPointer())) {
4719 return Representation::External(); 4738 return Representation::External();
4720 } 4739 }
4721 4740
4722 DCHECK(!type->Is(Type::Untagged())); 4741 DCHECK(!type->Is(Type::Untagged()));
4723 return Representation::Tagged(); 4742 return Representation::Tagged();
4724 } 4743 }
4725 4744
4726 } // namespace internal 4745 } // namespace internal
4727 } // namespace v8 4746 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698