OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 3343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3354 if (kFrameAlignment > 0) { | 3354 if (kFrameAlignment > 0) { |
3355 __ movq(rsp, rbx); | 3355 __ movq(rsp, rbx); |
3356 } | 3356 } |
3357 | 3357 |
3358 Result result = allocator_->Allocate(rax); | 3358 Result result = allocator_->Allocate(rax); |
3359 frame_->Push(&result); | 3359 frame_->Push(&result); |
3360 } | 3360 } |
3361 | 3361 |
3362 | 3362 |
3363 void CodeGenerator::GenerateFastMathOp(MathOp op, ZoneList<Expression*>* args) { | 3363 void CodeGenerator::GenerateFastMathOp(MathOp op, ZoneList<Expression*>* args) { |
3364 UNIMPLEMENTED(); | 3364 // TODO(X64): Use inline floating point in the fast case. |
| 3365 ASSERT(args->length() == 1); |
| 3366 |
| 3367 // Load number. |
| 3368 Load(args->at(0)); |
| 3369 Result answer; |
| 3370 switch (op) { |
| 3371 case SIN: |
| 3372 answer = frame_->CallRuntime(Runtime::kMath_sin, 1); |
| 3373 break; |
| 3374 case COS: |
| 3375 answer = frame_->CallRuntime(Runtime::kMath_cos, 1); |
| 3376 break; |
| 3377 } |
| 3378 frame_->Push(&answer); |
3365 } | 3379 } |
3366 | 3380 |
3367 | 3381 |
3368 void CodeGenerator::GenerateClassOf(ZoneList<Expression*>* args) { | 3382 void CodeGenerator::GenerateClassOf(ZoneList<Expression*>* args) { |
3369 ASSERT(args->length() == 1); | 3383 ASSERT(args->length() == 1); |
3370 JumpTarget leave, null, function, non_function_constructor; | 3384 JumpTarget leave, null, function, non_function_constructor; |
3371 Load(args->at(0)); // Load the object. | 3385 Load(args->at(0)); // Load the object. |
3372 Result obj = frame_->Pop(); | 3386 Result obj = frame_->Pop(); |
3373 obj.ToRegister(); | 3387 obj.ToRegister(); |
3374 frame_->Spill(obj.reg()); | 3388 frame_->Spill(obj.reg()); |
(...skipping 3558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6933 int CompareStub::MinorKey() { | 6947 int CompareStub::MinorKey() { |
6934 // Encode the two parameters in a unique 16 bit value. | 6948 // Encode the two parameters in a unique 16 bit value. |
6935 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); | 6949 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); |
6936 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); | 6950 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); |
6937 } | 6951 } |
6938 | 6952 |
6939 | 6953 |
6940 #undef __ | 6954 #undef __ |
6941 | 6955 |
6942 } } // namespace v8::internal | 6956 } } // namespace v8::internal |
OLD | NEW |