| OLD | NEW |
| 1 // Copyright 2010 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 4675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4687 } else { | 4687 } else { |
| 4688 ASSERT(var->is_global()); | 4688 ASSERT(var->is_global()); |
| 4689 Reference ref(this, node); | 4689 Reference ref(this, node); |
| 4690 ref.GetValue(); | 4690 ref.GetValue(); |
| 4691 } | 4691 } |
| 4692 } | 4692 } |
| 4693 | 4693 |
| 4694 | 4694 |
| 4695 void CodeGenerator::VisitLiteral(Literal* node) { | 4695 void CodeGenerator::VisitLiteral(Literal* node) { |
| 4696 Comment cmnt(masm_, "[ Literal"); | 4696 Comment cmnt(masm_, "[ Literal"); |
| 4697 frame_->Push(node->handle()); | 4697 if (frame_->ConstantPoolOverflowed()) { |
| 4698 Result temp = allocator_->Allocate(); |
| 4699 ASSERT(temp.is_valid()); |
| 4700 if (node->handle()->IsSmi()) { |
| 4701 __ Move(temp.reg(), Smi::cast(*node->handle())); |
| 4702 } else { |
| 4703 __ movq(temp.reg(), node->handle(), RelocInfo::EMBEDDED_OBJECT); |
| 4704 } |
| 4705 frame_->Push(&temp); |
| 4706 } else { |
| 4707 frame_->Push(node->handle()); |
| 4708 } |
| 4698 } | 4709 } |
| 4699 | 4710 |
| 4700 | 4711 |
| 4701 void CodeGenerator::LoadUnsafeSmi(Register target, Handle<Object> value) { | 4712 void CodeGenerator::LoadUnsafeSmi(Register target, Handle<Object> value) { |
| 4702 UNIMPLEMENTED(); | 4713 UNIMPLEMENTED(); |
| 4703 // TODO(X64): Implement security policy for loads of smis. | 4714 // TODO(X64): Implement security policy for loads of smis. |
| 4704 } | 4715 } |
| 4705 | 4716 |
| 4706 | 4717 |
| 4707 bool CodeGenerator::IsUnsafeSmi(Handle<Object> value) { | 4718 bool CodeGenerator::IsUnsafeSmi(Handle<Object> value) { |
| (...skipping 2315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7023 answer = frame()->CallRuntime(Runtime::kMath_pow_cfunction, 2); | 7034 answer = frame()->CallRuntime(Runtime::kMath_pow_cfunction, 2); |
| 7024 | 7035 |
| 7025 done.Bind(&answer); | 7036 done.Bind(&answer); |
| 7026 frame()->Push(&answer); | 7037 frame()->Push(&answer); |
| 7027 } | 7038 } |
| 7028 | 7039 |
| 7029 | 7040 |
| 7030 void CodeGenerator::GenerateMathSin(ZoneList<Expression*>* args) { | 7041 void CodeGenerator::GenerateMathSin(ZoneList<Expression*>* args) { |
| 7031 ASSERT_EQ(args->length(), 1); | 7042 ASSERT_EQ(args->length(), 1); |
| 7032 Load(args->at(0)); | 7043 Load(args->at(0)); |
| 7033 TranscendentalCacheStub stub(TranscendentalCache::SIN); | 7044 TranscendentalCacheStub stub(TranscendentalCache::SIN, |
| 7045 TranscendentalCacheStub::TAGGED); |
| 7034 Result result = frame_->CallStub(&stub, 1); | 7046 Result result = frame_->CallStub(&stub, 1); |
| 7035 frame_->Push(&result); | 7047 frame_->Push(&result); |
| 7036 } | 7048 } |
| 7037 | 7049 |
| 7038 | 7050 |
| 7039 void CodeGenerator::GenerateMathCos(ZoneList<Expression*>* args) { | 7051 void CodeGenerator::GenerateMathCos(ZoneList<Expression*>* args) { |
| 7040 ASSERT_EQ(args->length(), 1); | 7052 ASSERT_EQ(args->length(), 1); |
| 7041 Load(args->at(0)); | 7053 Load(args->at(0)); |
| 7042 TranscendentalCacheStub stub(TranscendentalCache::COS); | 7054 TranscendentalCacheStub stub(TranscendentalCache::COS, |
| 7055 TranscendentalCacheStub::TAGGED); |
| 7043 Result result = frame_->CallStub(&stub, 1); | 7056 Result result = frame_->CallStub(&stub, 1); |
| 7044 frame_->Push(&result); | 7057 frame_->Push(&result); |
| 7045 } | 7058 } |
| 7046 | 7059 |
| 7047 | 7060 |
| 7048 void CodeGenerator::GenerateMathLog(ZoneList<Expression*>* args) { | 7061 void CodeGenerator::GenerateMathLog(ZoneList<Expression*>* args) { |
| 7049 ASSERT_EQ(args->length(), 1); | 7062 ASSERT_EQ(args->length(), 1); |
| 7050 Load(args->at(0)); | 7063 Load(args->at(0)); |
| 7051 TranscendentalCacheStub stub(TranscendentalCache::LOG); | 7064 TranscendentalCacheStub stub(TranscendentalCache::LOG, |
| 7065 TranscendentalCacheStub::TAGGED); |
| 7052 Result result = frame_->CallStub(&stub, 1); | 7066 Result result = frame_->CallStub(&stub, 1); |
| 7053 frame_->Push(&result); | 7067 frame_->Push(&result); |
| 7054 } | 7068 } |
| 7055 | 7069 |
| 7056 | 7070 |
| 7057 // Generates the Math.sqrt method. Please note - this function assumes that | 7071 // Generates the Math.sqrt method. Please note - this function assumes that |
| 7058 // the callsite has executed ToNumber on the argument. | 7072 // the callsite has executed ToNumber on the argument. |
| 7059 void CodeGenerator::GenerateMathSqrt(ZoneList<Expression*>* args) { | 7073 void CodeGenerator::GenerateMathSqrt(ZoneList<Expression*>* args) { |
| 7060 ASSERT(args->length() == 1); | 7074 ASSERT(args->length() == 1); |
| 7061 Load(args->at(0)); | 7075 Load(args->at(0)); |
| (...skipping 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8812 } | 8826 } |
| 8813 | 8827 |
| 8814 #endif | 8828 #endif |
| 8815 | 8829 |
| 8816 | 8830 |
| 8817 #undef __ | 8831 #undef __ |
| 8818 | 8832 |
| 8819 } } // namespace v8::internal | 8833 } } // namespace v8::internal |
| 8820 | 8834 |
| 8821 #endif // V8_TARGET_ARCH_X64 | 8835 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |