| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 } else if (is_uint32) { | 352 } else if (is_uint32) { |
| 353 translation->StoreUint32Register(reg); | 353 translation->StoreUint32Register(reg); |
| 354 } else { | 354 } else { |
| 355 translation->StoreInt32Register(reg); | 355 translation->StoreInt32Register(reg); |
| 356 } | 356 } |
| 357 } else if (op->IsDoubleRegister()) { | 357 } else if (op->IsDoubleRegister()) { |
| 358 DoubleRegister reg = ToDoubleRegister(op); | 358 DoubleRegister reg = ToDoubleRegister(op); |
| 359 translation->StoreDoubleRegister(reg); | 359 translation->StoreDoubleRegister(reg); |
| 360 } else if (op->IsConstantOperand()) { | 360 } else if (op->IsConstantOperand()) { |
| 361 HConstant* constant = chunk()->LookupConstant(LConstantOperand::cast(op)); | 361 HConstant* constant = chunk()->LookupConstant(LConstantOperand::cast(op)); |
| 362 int src_index = DefineDeoptimizationLiteral(constant->handle()); | 362 int src_index = DefineDeoptimizationLiteral(constant->handle(isolate())); |
| 363 translation->StoreLiteral(src_index); | 363 translation->StoreLiteral(src_index); |
| 364 } else { | 364 } else { |
| 365 UNREACHABLE(); | 365 UNREACHABLE(); |
| 366 } | 366 } |
| 367 } | 367 } |
| 368 | 368 |
| 369 | 369 |
| 370 int LCodeGen::DefineDeoptimizationLiteral(Handle<Object> literal) { | 370 int LCodeGen::DefineDeoptimizationLiteral(Handle<Object> literal) { |
| 371 int result = deoptimization_literals_.length(); | 371 int result = deoptimization_literals_.length(); |
| 372 for (int i = 0; i < deoptimization_literals_.length(); ++i) { | 372 for (int i = 0; i < deoptimization_literals_.length(); ++i) { |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 if (r.IsSmi()) { | 1128 if (r.IsSmi()) { |
| 1129 ASSERT(constant->HasSmiValue()); | 1129 ASSERT(constant->HasSmiValue()); |
| 1130 return Operand(Smi::FromInt(constant->Integer32Value())); | 1130 return Operand(Smi::FromInt(constant->Integer32Value())); |
| 1131 } else if (r.IsInteger32()) { | 1131 } else if (r.IsInteger32()) { |
| 1132 ASSERT(constant->HasInteger32Value()); | 1132 ASSERT(constant->HasInteger32Value()); |
| 1133 return Operand(constant->Integer32Value()); | 1133 return Operand(constant->Integer32Value()); |
| 1134 } else if (r.IsDouble()) { | 1134 } else if (r.IsDouble()) { |
| 1135 Abort(kToOperandUnsupportedDoubleImmediate); | 1135 Abort(kToOperandUnsupportedDoubleImmediate); |
| 1136 } | 1136 } |
| 1137 ASSERT(r.IsTagged()); | 1137 ASSERT(r.IsTagged()); |
| 1138 return Operand(constant->handle()); | 1138 return Operand(constant->handle(isolate())); |
| 1139 } else if (op->IsRegister()) { | 1139 } else if (op->IsRegister()) { |
| 1140 return Operand(ToRegister(op)); | 1140 return Operand(ToRegister(op)); |
| 1141 } else if (op->IsDoubleRegister()) { | 1141 } else if (op->IsDoubleRegister()) { |
| 1142 Abort(kToOperandIsDoubleRegisterUnimplemented); | 1142 Abort(kToOperandIsDoubleRegisterUnimplemented); |
| 1143 return Operand(0); | 1143 return Operand(0); |
| 1144 } | 1144 } |
| 1145 // Stack slots not implemented, use ToMemOperand instead. | 1145 // Stack slots not implemented, use ToMemOperand instead. |
| 1146 UNREACHABLE(); | 1146 UNREACHABLE(); |
| 1147 return Operand(0); | 1147 return Operand(0); |
| 1148 } | 1148 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 ASSERT(!op->IsRegister()); | 1189 ASSERT(!op->IsRegister()); |
| 1190 ASSERT(!op->IsDoubleRegister()); | 1190 ASSERT(!op->IsDoubleRegister()); |
| 1191 ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot()); | 1191 ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot()); |
| 1192 return MemOperand(fp, StackSlotOffset(op->index())); | 1192 return MemOperand(fp, StackSlotOffset(op->index())); |
| 1193 } | 1193 } |
| 1194 | 1194 |
| 1195 | 1195 |
| 1196 Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const { | 1196 Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const { |
| 1197 HConstant* constant = chunk_->LookupConstant(op); | 1197 HConstant* constant = chunk_->LookupConstant(op); |
| 1198 ASSERT(chunk_->LookupLiteralRepresentation(op).IsSmiOrTagged()); | 1198 ASSERT(chunk_->LookupLiteralRepresentation(op).IsSmiOrTagged()); |
| 1199 return constant->handle(); | 1199 return constant->handle(isolate()); |
| 1200 } | 1200 } |
| 1201 | 1201 |
| 1202 | 1202 |
| 1203 bool LCodeGen::IsSmi(LConstantOperand* op) const { | 1203 bool LCodeGen::IsSmi(LConstantOperand* op) const { |
| 1204 return chunk_->LookupLiteralRepresentation(op).IsSmi(); | 1204 return chunk_->LookupLiteralRepresentation(op).IsSmi(); |
| 1205 } | 1205 } |
| 1206 | 1206 |
| 1207 | 1207 |
| 1208 bool LCodeGen::IsInteger32Constant(LConstantOperand* op) const { | 1208 bool LCodeGen::IsInteger32Constant(LConstantOperand* op) const { |
| 1209 return op->IsConstantOperand() && | 1209 return op->IsConstantOperand() && |
| (...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2409 __ Mov(ToRegister(instr->result()), instr->value()); | 2409 __ Mov(ToRegister(instr->result()), instr->value()); |
| 2410 } | 2410 } |
| 2411 | 2411 |
| 2412 | 2412 |
| 2413 void LCodeGen::DoConstantS(LConstantS* instr) { | 2413 void LCodeGen::DoConstantS(LConstantS* instr) { |
| 2414 __ Mov(ToRegister(instr->result()), Operand(instr->value())); | 2414 __ Mov(ToRegister(instr->result()), Operand(instr->value())); |
| 2415 } | 2415 } |
| 2416 | 2416 |
| 2417 | 2417 |
| 2418 void LCodeGen::DoConstantT(LConstantT* instr) { | 2418 void LCodeGen::DoConstantT(LConstantT* instr) { |
| 2419 Handle<Object> value = instr->value(); | 2419 Handle<Object> value = instr->value(isolate()); |
| 2420 AllowDeferredHandleDereference smi_check; | 2420 AllowDeferredHandleDereference smi_check; |
| 2421 __ LoadObject(ToRegister(instr->result()), value); | 2421 __ LoadObject(ToRegister(instr->result()), value); |
| 2422 } | 2422 } |
| 2423 | 2423 |
| 2424 | 2424 |
| 2425 void LCodeGen::DoContext(LContext* instr) { | 2425 void LCodeGen::DoContext(LContext* instr) { |
| 2426 // If there is a non-return use, the context must be moved to a register. | 2426 // If there is a non-return use, the context must be moved to a register. |
| 2427 Register result = ToRegister(instr->result()); | 2427 Register result = ToRegister(instr->result()); |
| 2428 // TODO(jbramley): LContext is only generated if it meets this condition, so | 2428 // TODO(jbramley): LContext is only generated if it meets this condition, so |
| 2429 // why not move cp unconditionally? | 2429 // why not move cp unconditionally? |
| (...skipping 3173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5603 __ Bind(&out_of_object); | 5603 __ Bind(&out_of_object); |
| 5604 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5604 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| 5605 // Index is equal to negated out of object property index plus 1. | 5605 // Index is equal to negated out of object property index plus 1. |
| 5606 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5606 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 5607 __ Ldr(result, FieldMemOperand(result, | 5607 __ Ldr(result, FieldMemOperand(result, |
| 5608 FixedArray::kHeaderSize - kPointerSize)); | 5608 FixedArray::kHeaderSize - kPointerSize)); |
| 5609 __ Bind(&done); | 5609 __ Bind(&done); |
| 5610 } | 5610 } |
| 5611 | 5611 |
| 5612 } } // namespace v8::internal | 5612 } } // namespace v8::internal |
| OLD | NEW |