| 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 4548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4559 MemOperand operand = FieldOperand(write_register, offset); | 4559 MemOperand operand = FieldOperand(write_register, offset); |
| 4560 if (instr->value()->IsConstantOperand()) { | 4560 if (instr->value()->IsConstantOperand()) { |
| 4561 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 4561 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
| 4562 if (operand_value->IsRegister()) { | 4562 if (operand_value->IsRegister()) { |
| 4563 Register value = ToRegister(operand_value); | 4563 Register value = ToRegister(operand_value); |
| 4564 if (representation.IsByte()) { | 4564 if (representation.IsByte()) { |
| 4565 __ mov_b(operand, value); | 4565 __ mov_b(operand, value); |
| 4566 } else { | 4566 } else { |
| 4567 __ mov(operand, value); | 4567 __ mov(operand, value); |
| 4568 } | 4568 } |
| 4569 } else if (representation.IsInteger32()) { |
| 4570 Immediate immediate = ToImmediate(operand_value, representation); |
| 4571 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
| 4572 __ mov(operand, immediate); |
| 4569 } else { | 4573 } else { |
| 4570 Handle<Object> handle_value = ToHandle(operand_value); | 4574 Handle<Object> handle_value = ToHandle(operand_value); |
| 4571 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4575 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
| 4572 __ mov(operand, handle_value); | 4576 __ mov(operand, handle_value); |
| 4573 } | 4577 } |
| 4574 } else { | 4578 } else { |
| 4575 Register value = ToRegister(instr->value()); | 4579 Register value = ToRegister(instr->value()); |
| 4576 if (representation.IsByte()) { | 4580 if (representation.IsByte()) { |
| 4577 __ mov_b(operand, value); | 4581 __ mov_b(operand, value); |
| 4578 } else { | 4582 } else { |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5008 | 5012 |
| 5009 PushSafepointRegistersScope scope(this); | 5013 PushSafepointRegistersScope scope(this); |
| 5010 __ SmiTag(char_code); | 5014 __ SmiTag(char_code); |
| 5011 __ push(char_code); | 5015 __ push(char_code); |
| 5012 CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr, instr->context()); | 5016 CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr, instr->context()); |
| 5013 __ StoreToSafepointRegisterSlot(result, eax); | 5017 __ StoreToSafepointRegisterSlot(result, eax); |
| 5014 } | 5018 } |
| 5015 | 5019 |
| 5016 | 5020 |
| 5017 void LCodeGen::DoStringAdd(LStringAdd* instr) { | 5021 void LCodeGen::DoStringAdd(LStringAdd* instr) { |
| 5018 EmitPushTaggedOperand(instr->left()); | 5022 if (FLAG_new_string_add) { |
| 5019 EmitPushTaggedOperand(instr->right()); | 5023 ASSERT(ToRegister(instr->left()).is(edx)); |
| 5020 StringAddStub stub(instr->hydrogen()->flags()); | 5024 ASSERT(ToRegister(instr->right()).is(eax)); |
| 5021 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 5025 NewStringAddStub stub(instr->hydrogen()->flags(), |
| 5026 isolate()->heap()->GetPretenureMode()); |
| 5027 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| 5028 } else { |
| 5029 EmitPushTaggedOperand(instr->left()); |
| 5030 EmitPushTaggedOperand(instr->right()); |
| 5031 StringAddStub stub(instr->hydrogen()->flags()); |
| 5032 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| 5033 } |
| 5022 } | 5034 } |
| 5023 | 5035 |
| 5024 | 5036 |
| 5025 void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { | 5037 void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { |
| 5026 LOperand* input = instr->value(); | 5038 LOperand* input = instr->value(); |
| 5027 LOperand* output = instr->result(); | 5039 LOperand* output = instr->result(); |
| 5028 ASSERT(input->IsRegister() || input->IsStackSlot()); | 5040 ASSERT(input->IsRegister() || input->IsStackSlot()); |
| 5029 ASSERT(output->IsDoubleRegister()); | 5041 ASSERT(output->IsDoubleRegister()); |
| 5030 if (CpuFeatures::IsSupported(SSE2)) { | 5042 if (CpuFeatures::IsSupported(SSE2)) { |
| 5031 CpuFeatureScope scope(masm(), SSE2); | 5043 CpuFeatureScope scope(masm(), SSE2); |
| (...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6447 FixedArray::kHeaderSize - kPointerSize)); | 6459 FixedArray::kHeaderSize - kPointerSize)); |
| 6448 __ bind(&done); | 6460 __ bind(&done); |
| 6449 } | 6461 } |
| 6450 | 6462 |
| 6451 | 6463 |
| 6452 #undef __ | 6464 #undef __ |
| 6453 | 6465 |
| 6454 } } // namespace v8::internal | 6466 } } // namespace v8::internal |
| 6455 | 6467 |
| 6456 #endif // V8_TARGET_ARCH_IA32 | 6468 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |