| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 DCHECK(op->IsDoubleRegister()); | 451 DCHECK(op->IsDoubleRegister()); |
| 452 return ToDoubleRegister(op->index()); | 452 return ToDoubleRegister(op->index()); |
| 453 } | 453 } |
| 454 | 454 |
| 455 | 455 |
| 456 bool LCodeGen::IsInteger32Constant(LConstantOperand* op) const { | 456 bool LCodeGen::IsInteger32Constant(LConstantOperand* op) const { |
| 457 return chunk_->LookupLiteralRepresentation(op).IsSmiOrInteger32(); | 457 return chunk_->LookupLiteralRepresentation(op).IsSmiOrInteger32(); |
| 458 } | 458 } |
| 459 | 459 |
| 460 | 460 |
| 461 bool LCodeGen::IsExternalConstant(LConstantOperand* op) const { |
| 462 return chunk_->LookupLiteralRepresentation(op).IsExternal(); |
| 463 } |
| 464 |
| 465 |
| 461 bool LCodeGen::IsDehoistedKeyConstant(LConstantOperand* op) const { | 466 bool LCodeGen::IsDehoistedKeyConstant(LConstantOperand* op) const { |
| 462 return op->IsConstantOperand() && | 467 return op->IsConstantOperand() && |
| 463 chunk_->IsDehoistedKey(chunk_->LookupConstant(op)); | 468 chunk_->IsDehoistedKey(chunk_->LookupConstant(op)); |
| 464 } | 469 } |
| 465 | 470 |
| 466 | 471 |
| 467 bool LCodeGen::IsSmiConstant(LConstantOperand* op) const { | 472 bool LCodeGen::IsSmiConstant(LConstantOperand* op) const { |
| 468 return chunk_->LookupLiteralRepresentation(op).IsSmi(); | 473 return chunk_->LookupLiteralRepresentation(op).IsSmi(); |
| 469 } | 474 } |
| 470 | 475 |
| (...skipping 3740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4211 if (IsInteger32Constant(operand_value)) { | 4216 if (IsInteger32Constant(operand_value)) { |
| 4212 DCHECK(!hinstr->NeedsWriteBarrier()); | 4217 DCHECK(!hinstr->NeedsWriteBarrier()); |
| 4213 int32_t value = ToInteger32(operand_value); | 4218 int32_t value = ToInteger32(operand_value); |
| 4214 if (representation.IsSmi()) { | 4219 if (representation.IsSmi()) { |
| 4215 __ Move(operand, Smi::FromInt(value)); | 4220 __ Move(operand, Smi::FromInt(value)); |
| 4216 | 4221 |
| 4217 } else { | 4222 } else { |
| 4218 __ movl(operand, Immediate(value)); | 4223 __ movl(operand, Immediate(value)); |
| 4219 } | 4224 } |
| 4220 | 4225 |
| 4226 } else if (IsExternalConstant(operand_value)) { |
| 4227 DCHECK(!hinstr->NeedsWriteBarrier()); |
| 4228 ExternalReference ptr = ToExternalReference(operand_value); |
| 4229 __ Move(kScratchRegister, ptr); |
| 4230 __ movp(operand, kScratchRegister); |
| 4221 } else { | 4231 } else { |
| 4222 Handle<Object> handle_value = ToHandle(operand_value); | 4232 Handle<Object> handle_value = ToHandle(operand_value); |
| 4223 DCHECK(!hinstr->NeedsWriteBarrier()); | 4233 DCHECK(!hinstr->NeedsWriteBarrier()); |
| 4224 __ Move(operand, handle_value); | 4234 __ Move(operand, handle_value); |
| 4225 } | 4235 } |
| 4226 } | 4236 } |
| 4227 | 4237 |
| 4228 if (hinstr->NeedsWriteBarrier()) { | 4238 if (hinstr->NeedsWriteBarrier()) { |
| 4229 Register value = ToRegister(instr->value()); | 4239 Register value = ToRegister(instr->value()); |
| 4230 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; | 4240 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; |
| (...skipping 1822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6053 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6063 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6054 } | 6064 } |
| 6055 | 6065 |
| 6056 | 6066 |
| 6057 #undef __ | 6067 #undef __ |
| 6058 | 6068 |
| 6059 } // namespace internal | 6069 } // namespace internal |
| 6060 } // namespace v8 | 6070 } // namespace v8 |
| 6061 | 6071 |
| 6062 #endif // V8_TARGET_ARCH_X64 | 6072 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |