| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 int32_t value = constant->Integer32Value(); | 706 int32_t value = constant->Integer32Value(); |
| 707 if (r.IsInteger32()) return value; | 707 if (r.IsInteger32()) return value; |
| 708 ASSERT(r.IsSmiOrTagged()); | 708 ASSERT(r.IsSmiOrTagged()); |
| 709 return reinterpret_cast<int32_t>(Smi::FromInt(value)); | 709 return reinterpret_cast<int32_t>(Smi::FromInt(value)); |
| 710 } | 710 } |
| 711 | 711 |
| 712 | 712 |
| 713 Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const { | 713 Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const { |
| 714 HConstant* constant = chunk_->LookupConstant(op); | 714 HConstant* constant = chunk_->LookupConstant(op); |
| 715 ASSERT(chunk_->LookupLiteralRepresentation(op).IsSmiOrTagged()); | 715 ASSERT(chunk_->LookupLiteralRepresentation(op).IsSmiOrTagged()); |
| 716 return constant->handle(); | 716 return constant->handle(isolate()); |
| 717 } | 717 } |
| 718 | 718 |
| 719 | 719 |
| 720 double LCodeGen::ToDouble(LConstantOperand* op) const { | 720 double LCodeGen::ToDouble(LConstantOperand* op) const { |
| 721 HConstant* constant = chunk_->LookupConstant(op); | 721 HConstant* constant = chunk_->LookupConstant(op); |
| 722 ASSERT(constant->HasDoubleValue()); | 722 ASSERT(constant->HasDoubleValue()); |
| 723 return constant->DoubleValue(); | 723 return constant->DoubleValue(); |
| 724 } | 724 } |
| 725 | 725 |
| 726 | 726 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 } else if (is_uint32) { | 869 } else if (is_uint32) { |
| 870 translation->StoreUint32Register(reg); | 870 translation->StoreUint32Register(reg); |
| 871 } else { | 871 } else { |
| 872 translation->StoreInt32Register(reg); | 872 translation->StoreInt32Register(reg); |
| 873 } | 873 } |
| 874 } else if (op->IsDoubleRegister()) { | 874 } else if (op->IsDoubleRegister()) { |
| 875 XMMRegister reg = ToDoubleRegister(op); | 875 XMMRegister reg = ToDoubleRegister(op); |
| 876 translation->StoreDoubleRegister(reg); | 876 translation->StoreDoubleRegister(reg); |
| 877 } else if (op->IsConstantOperand()) { | 877 } else if (op->IsConstantOperand()) { |
| 878 HConstant* constant = chunk()->LookupConstant(LConstantOperand::cast(op)); | 878 HConstant* constant = chunk()->LookupConstant(LConstantOperand::cast(op)); |
| 879 int src_index = DefineDeoptimizationLiteral(constant->handle()); | 879 int src_index = DefineDeoptimizationLiteral(constant->handle(isolate())); |
| 880 translation->StoreLiteral(src_index); | 880 translation->StoreLiteral(src_index); |
| 881 } else { | 881 } else { |
| 882 UNREACHABLE(); | 882 UNREACHABLE(); |
| 883 } | 883 } |
| 884 } | 884 } |
| 885 | 885 |
| 886 | 886 |
| 887 void LCodeGen::CallCodeGeneric(Handle<Code> code, | 887 void LCodeGen::CallCodeGeneric(Handle<Code> code, |
| 888 RelocInfo::Mode mode, | 888 RelocInfo::Mode mode, |
| 889 LInstruction* instr, | 889 LInstruction* instr, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 void LCodeGen::LoadContextFromDeferred(LOperand* context) { | 929 void LCodeGen::LoadContextFromDeferred(LOperand* context) { |
| 930 if (context->IsRegister()) { | 930 if (context->IsRegister()) { |
| 931 if (!ToRegister(context).is(esi)) { | 931 if (!ToRegister(context).is(esi)) { |
| 932 __ mov(esi, ToRegister(context)); | 932 __ mov(esi, ToRegister(context)); |
| 933 } | 933 } |
| 934 } else if (context->IsStackSlot()) { | 934 } else if (context->IsStackSlot()) { |
| 935 __ mov(esi, ToOperand(context)); | 935 __ mov(esi, ToOperand(context)); |
| 936 } else if (context->IsConstantOperand()) { | 936 } else if (context->IsConstantOperand()) { |
| 937 HConstant* constant = | 937 HConstant* constant = |
| 938 chunk_->LookupConstant(LConstantOperand::cast(context)); | 938 chunk_->LookupConstant(LConstantOperand::cast(context)); |
| 939 __ LoadObject(esi, Handle<Object>::cast(constant->handle())); | 939 __ LoadObject(esi, Handle<Object>::cast(constant->handle(isolate()))); |
| 940 } else { | 940 } else { |
| 941 UNREACHABLE(); | 941 UNREACHABLE(); |
| 942 } | 942 } |
| 943 } | 943 } |
| 944 | 944 |
| 945 void LCodeGen::CallRuntimeFromDeferred(Runtime::FunctionId id, | 945 void LCodeGen::CallRuntimeFromDeferred(Runtime::FunctionId id, |
| 946 int argc, | 946 int argc, |
| 947 LInstruction* instr, | 947 LInstruction* instr, |
| 948 LOperand* context) { | 948 LOperand* context) { |
| 949 LoadContextFromDeferred(context); | 949 LoadContextFromDeferred(context); |
| (...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1936 } | 1936 } |
| 1937 | 1937 |
| 1938 | 1938 |
| 1939 void LCodeGen::DoConstantE(LConstantE* instr) { | 1939 void LCodeGen::DoConstantE(LConstantE* instr) { |
| 1940 __ lea(ToRegister(instr->result()), Operand::StaticVariable(instr->value())); | 1940 __ lea(ToRegister(instr->result()), Operand::StaticVariable(instr->value())); |
| 1941 } | 1941 } |
| 1942 | 1942 |
| 1943 | 1943 |
| 1944 void LCodeGen::DoConstantT(LConstantT* instr) { | 1944 void LCodeGen::DoConstantT(LConstantT* instr) { |
| 1945 Register reg = ToRegister(instr->result()); | 1945 Register reg = ToRegister(instr->result()); |
| 1946 Handle<Object> handle = instr->value(); | 1946 Handle<Object> handle = instr->value(isolate()); |
| 1947 AllowDeferredHandleDereference smi_check; | 1947 AllowDeferredHandleDereference smi_check; |
| 1948 __ LoadObject(reg, handle); | 1948 __ LoadObject(reg, handle); |
| 1949 } | 1949 } |
| 1950 | 1950 |
| 1951 | 1951 |
| 1952 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { | 1952 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { |
| 1953 Register result = ToRegister(instr->result()); | 1953 Register result = ToRegister(instr->result()); |
| 1954 Register map = ToRegister(instr->value()); | 1954 Register map = ToRegister(instr->value()); |
| 1955 __ EnumLength(result, map); | 1955 __ EnumLength(result, map); |
| 1956 } | 1956 } |
| (...skipping 4348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6305 FixedArray::kHeaderSize - kPointerSize)); | 6305 FixedArray::kHeaderSize - kPointerSize)); |
| 6306 __ bind(&done); | 6306 __ bind(&done); |
| 6307 } | 6307 } |
| 6308 | 6308 |
| 6309 | 6309 |
| 6310 #undef __ | 6310 #undef __ |
| 6311 | 6311 |
| 6312 } } // namespace v8::internal | 6312 } } // namespace v8::internal |
| 6313 | 6313 |
| 6314 #endif // V8_TARGET_ARCH_IA32 | 6314 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |