OLD | NEW |
---|---|
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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
534 | 534 |
535 | 535 |
536 int32_t LCodeGen::ToInteger32(LConstantOperand* op) const { | 536 int32_t LCodeGen::ToInteger32(LConstantOperand* op) const { |
537 return ToRepresentation(op, Representation::Integer32()); | 537 return ToRepresentation(op, Representation::Integer32()); |
538 } | 538 } |
539 | 539 |
540 | 540 |
541 int32_t LCodeGen::ToRepresentation(LConstantOperand* op, | 541 int32_t LCodeGen::ToRepresentation(LConstantOperand* op, |
542 const Representation& r) const { | 542 const Representation& r) const { |
543 HConstant* constant = chunk_->LookupConstant(op); | 543 HConstant* constant = chunk_->LookupConstant(op); |
544 if (r.IsExternal()) { | |
545 return reinterpret_cast<int32_t>( | |
546 constant->ExternalReferenceValue().address()); | |
547 } | |
544 int32_t value = constant->Integer32Value(); | 548 int32_t value = constant->Integer32Value(); |
545 if (r.IsInteger32()) return value; | 549 if (r.IsInteger32()) return value; |
546 DCHECK(r.IsSmiOrTagged()); | 550 DCHECK(r.IsSmiOrTagged()); |
547 return reinterpret_cast<int32_t>(Smi::FromInt(value)); | 551 return reinterpret_cast<int32_t>(Smi::FromInt(value)); |
548 } | 552 } |
549 | 553 |
550 | 554 |
551 Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const { | 555 Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const { |
552 HConstant* constant = chunk_->LookupConstant(op); | 556 HConstant* constant = chunk_->LookupConstant(op); |
553 DCHECK(chunk_->LookupLiteralRepresentation(op).IsSmiOrTagged()); | 557 DCHECK(chunk_->LookupLiteralRepresentation(op).IsSmiOrTagged()); |
(...skipping 3526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4080 write_register = ToRegister(instr->temp()); | 4084 write_register = ToRegister(instr->temp()); |
4081 __ mov(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); | 4085 __ mov(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); |
4082 } | 4086 } |
4083 | 4087 |
4084 MemOperand operand = FieldOperand(write_register, offset); | 4088 MemOperand operand = FieldOperand(write_register, offset); |
4085 if (instr->value()->IsConstantOperand()) { | 4089 if (instr->value()->IsConstantOperand()) { |
4086 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 4090 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
4087 if (operand_value->IsRegister()) { | 4091 if (operand_value->IsRegister()) { |
4088 Register value = ToRegister(operand_value); | 4092 Register value = ToRegister(operand_value); |
4089 __ Store(value, operand, representation); | 4093 __ Store(value, operand, representation); |
4090 } else if (representation.IsInteger32()) { | 4094 } else if (representation.IsInteger32() || representation.IsExternal()) { |
4091 Immediate immediate = ToImmediate(operand_value, representation); | 4095 Immediate immediate = ToImmediate(operand_value, representation); |
4092 DCHECK(!instr->hydrogen()->NeedsWriteBarrier()); | 4096 DCHECK(!instr->hydrogen()->NeedsWriteBarrier()); |
4097 Comment(";;; LOL Store"); | |
Jarin
2015/07/22 09:00:20
What is LOL?
jochen (gone - plz use gerrit)
2015/07/22 09:08:13
I, uhm, just wanted to check whether you actually
| |
4093 __ mov(operand, immediate); | 4098 __ mov(operand, immediate); |
4094 } else { | 4099 } else { |
4095 Handle<Object> handle_value = ToHandle(operand_value); | 4100 Handle<Object> handle_value = ToHandle(operand_value); |
4096 DCHECK(!instr->hydrogen()->NeedsWriteBarrier()); | 4101 DCHECK(!instr->hydrogen()->NeedsWriteBarrier()); |
4097 __ mov(operand, handle_value); | 4102 __ mov(operand, handle_value); |
4098 } | 4103 } |
4099 } else { | 4104 } else { |
4100 Register value = ToRegister(instr->value()); | 4105 Register value = ToRegister(instr->value()); |
4101 __ Store(value, operand, representation); | 4106 __ Store(value, operand, representation); |
4102 } | 4107 } |
(...skipping 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5853 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5858 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5854 } | 5859 } |
5855 | 5860 |
5856 | 5861 |
5857 #undef __ | 5862 #undef __ |
5858 | 5863 |
5859 } // namespace internal | 5864 } // namespace internal |
5860 } // namespace v8 | 5865 } // namespace v8 |
5861 | 5866 |
5862 #endif // V8_TARGET_ARCH_IA32 | 5867 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |