| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 2698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2709 | 2709 |
| 2710 void CodeGenerator::GenerateIsSmi(ZoneList<Expression*>* args) { | 2710 void CodeGenerator::GenerateIsSmi(ZoneList<Expression*>* args) { |
| 2711 ASSERT(args->length() == 1); | 2711 ASSERT(args->length() == 1); |
| 2712 Load(args->at(0)); | 2712 Load(args->at(0)); |
| 2713 frame_->Pop(r0); | 2713 frame_->Pop(r0); |
| 2714 __ tst(r0, Operand(kSmiTagMask)); | 2714 __ tst(r0, Operand(kSmiTagMask)); |
| 2715 cc_reg_ = eq; | 2715 cc_reg_ = eq; |
| 2716 } | 2716 } |
| 2717 | 2717 |
| 2718 | 2718 |
| 2719 void CodeGenerator::GenerateLog(ZoneList<Expression*>* args) { |
| 2720 // See comment in CodeGenerator::GenerateLog in codegen-ia32.cc. |
| 2721 ASSERT_EQ(args->length(), 3); |
| 2722 if (ShouldGenerateLog(args->at(0))) { |
| 2723 Load(args->at(1)); |
| 2724 Load(args->at(2)); |
| 2725 __ CallRuntime(Runtime::kLog, 2); |
| 2726 } |
| 2727 __ mov(r0, Operand(Factory::undefined_value())); |
| 2728 frame_->Push(r0); |
| 2729 } |
| 2730 |
| 2731 |
| 2719 void CodeGenerator::GenerateIsNonNegativeSmi(ZoneList<Expression*>* args) { | 2732 void CodeGenerator::GenerateIsNonNegativeSmi(ZoneList<Expression*>* args) { |
| 2720 ASSERT(args->length() == 1); | 2733 ASSERT(args->length() == 1); |
| 2721 Load(args->at(0)); | 2734 Load(args->at(0)); |
| 2722 frame_->Pop(r0); | 2735 frame_->Pop(r0); |
| 2723 __ tst(r0, Operand(kSmiTagMask | 0x80000000)); | 2736 __ tst(r0, Operand(kSmiTagMask | 0x80000000)); |
| 2724 cc_reg_ = eq; | 2737 cc_reg_ = eq; |
| 2725 } | 2738 } |
| 2726 | 2739 |
| 2727 | 2740 |
| 2728 // This should generate code that performs a charCodeAt() call or returns | 2741 // This should generate code that performs a charCodeAt() call or returns |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3438 } else { | 3451 } else { |
| 3439 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); | 3452 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); |
| 3440 } | 3453 } |
| 3441 frame->EmitPush(r0); | 3454 frame->EmitPush(r0); |
| 3442 break; | 3455 break; |
| 3443 } | 3456 } |
| 3444 | 3457 |
| 3445 case KEYED: { | 3458 case KEYED: { |
| 3446 // TODO(1241834): Make sure that this it is safe to ignore the | 3459 // TODO(1241834): Make sure that this it is safe to ignore the |
| 3447 // distinction between expressions in a typeof and not in a typeof. | 3460 // distinction between expressions in a typeof and not in a typeof. |
| 3461 |
| 3462 // TODO(181): Implement inlined version of array indexing once |
| 3463 // loop nesting is properly tracked on ARM. |
| 3448 Comment cmnt(masm, "[ Load from keyed Property"); | 3464 Comment cmnt(masm, "[ Load from keyed Property"); |
| 3449 ASSERT(property != NULL); | 3465 ASSERT(property != NULL); |
| 3450 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); | 3466 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); |
| 3451 | 3467 |
| 3452 Variable* var = expression_->AsVariableProxy()->AsVariable(); | 3468 Variable* var = expression_->AsVariableProxy()->AsVariable(); |
| 3453 if (var != NULL) { | 3469 if (var != NULL) { |
| 3454 ASSERT(var->is_global()); | 3470 ASSERT(var->is_global()); |
| 3455 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET_CONTEXT, 0); | 3471 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET_CONTEXT, 0); |
| 3456 } else { | 3472 } else { |
| 3457 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); | 3473 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); |
| (...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4495 __ mov(r2, Operand(0)); | 4511 __ mov(r2, Operand(0)); |
| 4496 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); | 4512 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); |
| 4497 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), | 4513 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), |
| 4498 RelocInfo::CODE_TARGET); | 4514 RelocInfo::CODE_TARGET); |
| 4499 } | 4515 } |
| 4500 | 4516 |
| 4501 | 4517 |
| 4502 #undef __ | 4518 #undef __ |
| 4503 | 4519 |
| 4504 } } // namespace v8::internal | 4520 } } // namespace v8::internal |
| OLD | NEW |