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

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 1248483007: Store offset between fixed typed array base and data start in object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 5 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/hydrogen-instructions.h ('k') | src/ia32/lithium-ia32.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 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
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
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());
4093 __ mov(operand, immediate); 4097 __ mov(operand, immediate);
4094 } else { 4098 } else {
4095 Handle<Object> handle_value = ToHandle(operand_value); 4099 Handle<Object> handle_value = ToHandle(operand_value);
4096 DCHECK(!instr->hydrogen()->NeedsWriteBarrier()); 4100 DCHECK(!instr->hydrogen()->NeedsWriteBarrier());
4097 __ mov(operand, handle_value); 4101 __ mov(operand, handle_value);
4098 } 4102 }
4099 } else { 4103 } else {
4100 Register value = ToRegister(instr->value()); 4104 Register value = ToRegister(instr->value());
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after
5853 RecordSafepoint(Safepoint::kNoLazyDeopt); 5857 RecordSafepoint(Safepoint::kNoLazyDeopt);
5854 } 5858 }
5855 5859
5856 5860
5857 #undef __ 5861 #undef __
5858 5862
5859 } // namespace internal 5863 } // namespace internal
5860 } // namespace v8 5864 } // namespace v8
5861 5865
5862 #endif // V8_TARGET_ARCH_IA32 5866 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698