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

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

Issue 2200713002: [turbofan] Use assembler->LoadMap(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@typeof
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 504
505 Node* result = assembler->AllocateHeapNumber(); 505 Node* result = assembler->AllocateHeapNumber();
506 assembler->Return(result); 506 assembler->Return(result);
507 } 507 }
508 508
509 #define SIMD128_GEN_ASM(TYPE, Type, type, lane_count, lane_type) \ 509 #define SIMD128_GEN_ASM(TYPE, Type, type, lane_count, lane_type) \
510 void Allocate##Type##Stub::GenerateAssembly(CodeStubAssembler* assembler) \ 510 void Allocate##Type##Stub::GenerateAssembly(CodeStubAssembler* assembler) \
511 const { \ 511 const { \
512 compiler::Node* result = \ 512 compiler::Node* result = \
513 assembler->Allocate(Simd128Value::kSize, CodeStubAssembler::kNone); \ 513 assembler->Allocate(Simd128Value::kSize, CodeStubAssembler::kNone); \
514 compiler::Node* map_offset = \ 514 compiler::Node* map = assembler->LoadMap(result); \
515 assembler->IntPtrConstant(HeapObject::kMapOffset - kHeapObjectTag); \
516 compiler::Node* map = assembler->IntPtrAdd(result, map_offset); \
517 assembler->StoreNoWriteBarrier( \ 515 assembler->StoreNoWriteBarrier( \
518 MachineRepresentation::kTagged, map, \ 516 MachineRepresentation::kTagged, map, \
519 assembler->HeapConstant(isolate()->factory()->type##_map())); \ 517 assembler->HeapConstant(isolate()->factory()->type##_map())); \
520 assembler->Return(result); \ 518 assembler->Return(result); \
521 } 519 }
522 SIMD128_TYPES(SIMD128_GEN_ASM) 520 SIMD128_TYPES(SIMD128_GEN_ASM)
523 #undef SIMD128_GEN_ASM 521 #undef SIMD128_GEN_ASM
524 522
525 void StringLengthStub::GenerateAssembly(CodeStubAssembler* assembler) const { 523 void StringLengthStub::GenerateAssembly(CodeStubAssembler* assembler) const {
526 compiler::Node* value = assembler->Parameter(0); 524 compiler::Node* value = assembler->Parameter(0);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 } 589 }
592 590
593 assembler->Bind(&if_notoverflow); 591 assembler->Bind(&if_notoverflow);
594 var_result.Bind(assembler->Projection(0, pair)); 592 var_result.Bind(assembler->Projection(0, pair));
595 assembler->Goto(&end); 593 assembler->Goto(&end);
596 } 594 }
597 595
598 assembler->Bind(&if_rhsisnotsmi); 596 assembler->Bind(&if_rhsisnotsmi);
599 { 597 {
600 // Load the map of {rhs}. 598 // Load the map of {rhs}.
601 Node* rhs_map = assembler->LoadObjectField(rhs, HeapObject::kMapOffset); 599 Node* rhs_map = assembler->LoadMap(rhs);
602 600
603 // Check if the {rhs} is a HeapNumber. 601 // Check if the {rhs} is a HeapNumber.
604 Label if_rhsisnumber(assembler), 602 Label if_rhsisnumber(assembler),
605 if_rhsisnotnumber(assembler, Label::kDeferred); 603 if_rhsisnotnumber(assembler, Label::kDeferred);
606 Node* number_map = assembler->HeapNumberMapConstant(); 604 Node* number_map = assembler->HeapNumberMapConstant();
607 assembler->Branch(assembler->WordEqual(rhs_map, number_map), 605 assembler->Branch(assembler->WordEqual(rhs_map, number_map),
608 &if_rhsisnumber, &if_rhsisnotnumber); 606 &if_rhsisnumber, &if_rhsisnotnumber);
609 607
610 assembler->Bind(&if_rhsisnumber); 608 assembler->Bind(&if_rhsisnumber);
611 { 609 {
(...skipping 4435 matching lines...) Expand 10 before | Expand all | Expand 10 after
5047 if (type->Is(Type::UntaggedPointer())) { 5045 if (type->Is(Type::UntaggedPointer())) {
5048 return Representation::External(); 5046 return Representation::External();
5049 } 5047 }
5050 5048
5051 DCHECK(!type->Is(Type::Untagged())); 5049 DCHECK(!type->Is(Type::Untagged()));
5052 return Representation::Tagged(); 5050 return Representation::Tagged();
5053 } 5051 }
5054 5052
5055 } // namespace internal 5053 } // namespace internal
5056 } // namespace v8 5054 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698