Chromium Code Reviews

Side by Side Diff: src/compiler/ppc/code-generator-ppc.cc

Issue 2921473003: PPC/S390: [compiler] Delay allocation of code-embedded heap numbers.
Patch Set: additional changes for s390 Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | src/compiler/s390/code-generator-s390.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/compilation-info.h" 7 #include "src/compilation-info.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 43 matching lines...)
54 } 54 }
55 UNREACHABLE(); 55 UNREACHABLE();
56 } 56 }
57 57
58 Operand InputImmediate(size_t index) { 58 Operand InputImmediate(size_t index) {
59 Constant constant = ToConstant(instr_->InputAt(index)); 59 Constant constant = ToConstant(instr_->InputAt(index));
60 switch (constant.type()) { 60 switch (constant.type()) {
61 case Constant::kInt32: 61 case Constant::kInt32:
62 return Operand(constant.ToInt32()); 62 return Operand(constant.ToInt32());
63 case Constant::kFloat32: 63 case Constant::kFloat32:
64 return Operand( 64 return Operand::EmbeddedNumber(constant.ToFloat32());
65 isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED));
66 case Constant::kFloat64: 65 case Constant::kFloat64:
67 return Operand( 66 return Operand::EmbeddedNumber(constant.ToFloat64());
68 isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED));
69 case Constant::kInt64: 67 case Constant::kInt64:
70 #if V8_TARGET_ARCH_PPC64 68 #if V8_TARGET_ARCH_PPC64
71 return Operand(constant.ToInt64()); 69 return Operand(constant.ToInt64());
72 #endif 70 #endif
73 case Constant::kExternalReference: 71 case Constant::kExternalReference:
74 case Constant::kHeapObject: 72 case Constant::kHeapObject:
75 case Constant::kRpoNumber: 73 case Constant::kRpoNumber:
76 break; 74 break;
77 } 75 }
78 UNREACHABLE(); 76 UNREACHABLE();
(...skipping 2333 matching lines...)
2412 __ mov(dst, Operand(src.ToInt64(), src.rmode())); 2410 __ mov(dst, Operand(src.ToInt64(), src.rmode()));
2413 } else { 2411 } else {
2414 DCHECK(!RelocInfo::IsWasmSizeReference(src.rmode())); 2412 DCHECK(!RelocInfo::IsWasmSizeReference(src.rmode()));
2415 #endif 2413 #endif
2416 __ mov(dst, Operand(src.ToInt64())); 2414 __ mov(dst, Operand(src.ToInt64()));
2417 #if V8_TARGET_ARCH_PPC64 2415 #if V8_TARGET_ARCH_PPC64
2418 } 2416 }
2419 #endif 2417 #endif
2420 break; 2418 break;
2421 case Constant::kFloat32: 2419 case Constant::kFloat32:
2422 __ Move(dst, 2420 __ mov(dst, Operand::EmbeddedNumber(src.ToFloat32()));
2423 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED));
2424 break; 2421 break;
2425 case Constant::kFloat64: 2422 case Constant::kFloat64:
2426 __ Move(dst, 2423 __ mov(dst, Operand::EmbeddedNumber(src.ToFloat64()));
2427 isolate()->factory()->NewNumber(src.ToFloat64(), TENURED));
2428 break; 2424 break;
2429 case Constant::kExternalReference: 2425 case Constant::kExternalReference:
2430 __ mov(dst, Operand(src.ToExternalReference())); 2426 __ mov(dst, Operand(src.ToExternalReference()));
2431 break; 2427 break;
2432 case Constant::kHeapObject: { 2428 case Constant::kHeapObject: {
2433 Handle<HeapObject> src_object = src.ToHeapObject(); 2429 Handle<HeapObject> src_object = src.ToHeapObject();
2434 Heap::RootListIndex index; 2430 Heap::RootListIndex index;
2435 if (IsMaterializableFromRoot(src_object, &index)) { 2431 if (IsMaterializableFromRoot(src_object, &index)) {
2436 __ LoadRoot(dst, index); 2432 __ LoadRoot(dst, index);
2437 } else { 2433 } else {
(...skipping 180 matching lines...)
2618 padding_size -= v8::internal::Assembler::kInstrSize; 2614 padding_size -= v8::internal::Assembler::kInstrSize;
2619 } 2615 }
2620 } 2616 }
2621 } 2617 }
2622 2618
2623 #undef __ 2619 #undef __
2624 2620
2625 } // namespace compiler 2621 } // namespace compiler
2626 } // namespace internal 2622 } // namespace internal
2627 } // namespace v8 2623 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/s390/code-generator-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine