| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 __ CallRuntime(fun, argc); | 483 __ CallRuntime(fun, argc); |
| 484 | 484 |
| 485 RegisterLazyDeoptimization(instr, RECORD_SIMPLE_SAFEPOINT); | 485 RegisterLazyDeoptimization(instr, RECORD_SIMPLE_SAFEPOINT); |
| 486 } | 486 } |
| 487 | 487 |
| 488 | 488 |
| 489 void LCodeGen::CallRuntimeFromDeferred(Runtime::FunctionId id, | 489 void LCodeGen::CallRuntimeFromDeferred(Runtime::FunctionId id, |
| 490 int argc, | 490 int argc, |
| 491 LInstruction* instr, | 491 LInstruction* instr, |
| 492 LOperand* context) { | 492 LOperand* context) { |
| 493 ASSERT(context->IsRegister() || context->IsStackSlot()); | |
| 494 if (context->IsRegister()) { | 493 if (context->IsRegister()) { |
| 495 if (!ToRegister(context).is(esi)) { | 494 if (!ToRegister(context).is(esi)) { |
| 496 __ mov(esi, ToRegister(context)); | 495 __ mov(esi, ToRegister(context)); |
| 497 } | 496 } |
| 497 } else if (context->IsStackSlot()) { |
| 498 __ mov(esi, ToOperand(context)); |
| 499 } else if (context->IsConstantOperand()) { |
| 500 Handle<Object> literal = |
| 501 chunk_->LookupLiteral(LConstantOperand::cast(context)); |
| 502 LoadHeapObject(esi, Handle<Context>::cast(literal)); |
| 498 } else { | 503 } else { |
| 499 // Context is stack slot. | 504 UNREACHABLE(); |
| 500 __ mov(esi, ToOperand(context)); | |
| 501 } | 505 } |
| 502 | 506 |
| 503 __ CallRuntimeSaveDoubles(id); | 507 __ CallRuntimeSaveDoubles(id); |
| 504 RecordSafepointWithRegisters( | 508 RecordSafepointWithRegisters( |
| 505 instr->pointer_map(), argc, Safepoint::kNoDeoptimizationIndex); | 509 instr->pointer_map(), argc, Safepoint::kNoDeoptimizationIndex); |
| 506 } | 510 } |
| 507 | 511 |
| 508 | 512 |
| 509 void LCodeGen::RegisterLazyDeoptimization(LInstruction* instr, | 513 void LCodeGen::RegisterLazyDeoptimization(LInstruction* instr, |
| 510 SafepointMode safepoint_mode) { | 514 SafepointMode safepoint_mode) { |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 __ Set(temp, Immediate(lower)); | 1206 __ Set(temp, Immediate(lower)); |
| 1203 __ movd(xmm0, Operand(temp)); | 1207 __ movd(xmm0, Operand(temp)); |
| 1204 __ por(res, xmm0); | 1208 __ por(res, xmm0); |
| 1205 } | 1209 } |
| 1206 } | 1210 } |
| 1207 } | 1211 } |
| 1208 } | 1212 } |
| 1209 | 1213 |
| 1210 | 1214 |
| 1211 void LCodeGen::DoConstantT(LConstantT* instr) { | 1215 void LCodeGen::DoConstantT(LConstantT* instr) { |
| 1212 ASSERT(instr->result()->IsRegister()); | 1216 Register reg = ToRegister(instr->result()); |
| 1213 __ Set(ToRegister(instr->result()), Immediate(instr->value())); | 1217 Handle<Object> handle = instr->value(); |
| 1218 if (handle->IsHeapObject()) { |
| 1219 LoadHeapObject(reg, Handle<HeapObject>::cast(handle)); |
| 1220 } else { |
| 1221 __ Set(reg, Immediate(handle)); |
| 1222 } |
| 1214 } | 1223 } |
| 1215 | 1224 |
| 1216 | 1225 |
| 1217 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { | 1226 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { |
| 1218 Register result = ToRegister(instr->result()); | 1227 Register result = ToRegister(instr->result()); |
| 1219 Register array = ToRegister(instr->InputAt(0)); | 1228 Register array = ToRegister(instr->InputAt(0)); |
| 1220 __ mov(result, FieldOperand(array, JSArray::kLengthOffset)); | 1229 __ mov(result, FieldOperand(array, JSArray::kLengthOffset)); |
| 1221 } | 1230 } |
| 1222 | 1231 |
| 1223 | 1232 |
| (...skipping 3197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4421 env->deoptimization_index()); | 4430 env->deoptimization_index()); |
| 4422 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4431 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
| 4423 } | 4432 } |
| 4424 | 4433 |
| 4425 | 4434 |
| 4426 #undef __ | 4435 #undef __ |
| 4427 | 4436 |
| 4428 } } // namespace v8::internal | 4437 } } // namespace v8::internal |
| 4429 | 4438 |
| 4430 #endif // V8_TARGET_ARCH_IA32 | 4439 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |