OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 | 668 |
669 if (info()->IsOptimizing()) { | 669 if (info()->IsOptimizing()) { |
670 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 670 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
671 | 671 |
672 // TODO(all): Add support for stop_t FLAG in DEBUG mode. | 672 // TODO(all): Add support for stop_t FLAG in DEBUG mode. |
673 | 673 |
674 // Sloppy mode functions and builtins need to replace the receiver with the | 674 // Sloppy mode functions and builtins need to replace the receiver with the |
675 // global proxy when called as functions (without an explicit receiver | 675 // global proxy when called as functions (without an explicit receiver |
676 // object). | 676 // object). |
677 if (info_->this_has_uses() && | 677 if (info_->this_has_uses() && |
678 info_->is_sloppy_mode() && | 678 info_->strict_mode() == SLOPPY && |
679 !info_->is_native()) { | 679 !info_->is_native()) { |
680 Label ok; | 680 Label ok; |
681 int receiver_offset = info_->scope()->num_parameters() * kXRegSizeInBytes; | 681 int receiver_offset = info_->scope()->num_parameters() * kXRegSizeInBytes; |
682 __ Peek(x10, receiver_offset); | 682 __ Peek(x10, receiver_offset); |
683 __ JumpIfNotRoot(x10, Heap::kUndefinedValueRootIndex, &ok); | 683 __ JumpIfNotRoot(x10, Heap::kUndefinedValueRootIndex, &ok); |
684 | 684 |
685 __ Ldr(x10, GlobalObjectMemOperand()); | 685 __ Ldr(x10, GlobalObjectMemOperand()); |
686 __ Ldr(x10, FieldMemOperand(x10, GlobalObject::kGlobalReceiverOffset)); | 686 __ Ldr(x10, FieldMemOperand(x10, GlobalObject::kGlobalReceiverOffset)); |
687 __ Poke(x10, receiver_offset); | 687 __ Poke(x10, receiver_offset); |
688 | 688 |
(...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2729 | 2729 |
2730 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | 2730 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
2731 ASSERT(ToRegister(instr->context()).is(cp)); | 2731 ASSERT(ToRegister(instr->context()).is(cp)); |
2732 // FunctionLiteral instruction is marked as call, we can trash any register. | 2732 // FunctionLiteral instruction is marked as call, we can trash any register. |
2733 ASSERT(instr->IsMarkedAsCall()); | 2733 ASSERT(instr->IsMarkedAsCall()); |
2734 | 2734 |
2735 // Use the fast case closure allocation code that allocates in new | 2735 // Use the fast case closure allocation code that allocates in new |
2736 // space for nested functions that don't need literals cloning. | 2736 // space for nested functions that don't need literals cloning. |
2737 bool pretenure = instr->hydrogen()->pretenure(); | 2737 bool pretenure = instr->hydrogen()->pretenure(); |
2738 if (!pretenure && instr->hydrogen()->has_no_literals()) { | 2738 if (!pretenure && instr->hydrogen()->has_no_literals()) { |
2739 FastNewClosureStub stub(instr->hydrogen()->language_mode(), | 2739 FastNewClosureStub stub(instr->hydrogen()->strict_mode(), |
2740 instr->hydrogen()->is_generator()); | 2740 instr->hydrogen()->is_generator()); |
2741 __ Mov(x2, Operand(instr->hydrogen()->shared_info())); | 2741 __ Mov(x2, Operand(instr->hydrogen()->shared_info())); |
2742 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 2742 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
2743 } else { | 2743 } else { |
2744 __ Mov(x2, Operand(instr->hydrogen()->shared_info())); | 2744 __ Mov(x2, Operand(instr->hydrogen()->shared_info())); |
2745 __ Mov(x1, Operand(pretenure ? factory()->true_value() | 2745 __ Mov(x1, Operand(pretenure ? factory()->true_value() |
2746 : factory()->false_value())); | 2746 : factory()->false_value())); |
2747 __ Push(cp, x2, x1); | 2747 __ Push(cp, x2, x1); |
2748 CallRuntime(Runtime::kNewClosure, 3, instr); | 2748 CallRuntime(Runtime::kNewClosure, 3, instr); |
2749 } | 2749 } |
(...skipping 2274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5024 } | 5024 } |
5025 } | 5025 } |
5026 | 5026 |
5027 | 5027 |
5028 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 5028 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
5029 ASSERT(ToRegister(instr->context()).is(cp)); | 5029 ASSERT(ToRegister(instr->context()).is(cp)); |
5030 ASSERT(ToRegister(instr->object()).Is(x2)); | 5030 ASSERT(ToRegister(instr->object()).Is(x2)); |
5031 ASSERT(ToRegister(instr->key()).Is(x1)); | 5031 ASSERT(ToRegister(instr->key()).Is(x1)); |
5032 ASSERT(ToRegister(instr->value()).Is(x0)); | 5032 ASSERT(ToRegister(instr->value()).Is(x0)); |
5033 | 5033 |
5034 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) | 5034 Handle<Code> ic = instr->strict_mode() == STRICT |
5035 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() | 5035 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
5036 : isolate()->builtins()->KeyedStoreIC_Initialize(); | 5036 : isolate()->builtins()->KeyedStoreIC_Initialize(); |
5037 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 5037 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
5038 } | 5038 } |
5039 | 5039 |
5040 | 5040 |
5041 // TODO(jbramley): Once the merge is done and we're tracking bleeding_edge, try | 5041 // TODO(jbramley): Once the merge is done and we're tracking bleeding_edge, try |
5042 // to tidy up this function. | 5042 // to tidy up this function. |
5043 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { | 5043 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
5044 Representation representation = instr->representation(); | 5044 Representation representation = instr->representation(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5131 } | 5131 } |
5132 | 5132 |
5133 | 5133 |
5134 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 5134 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
5135 ASSERT(ToRegister(instr->context()).is(cp)); | 5135 ASSERT(ToRegister(instr->context()).is(cp)); |
5136 ASSERT(ToRegister(instr->value()).is(x0)); | 5136 ASSERT(ToRegister(instr->value()).is(x0)); |
5137 ASSERT(ToRegister(instr->object()).is(x1)); | 5137 ASSERT(ToRegister(instr->object()).is(x1)); |
5138 | 5138 |
5139 // Name must be in x2. | 5139 // Name must be in x2. |
5140 __ Mov(x2, Operand(instr->name())); | 5140 __ Mov(x2, Operand(instr->name())); |
5141 Handle<Code> ic = StoreIC::initialize_stub(isolate(), | 5141 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); |
5142 instr->strict_mode_flag()); | |
5143 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 5142 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
5144 } | 5143 } |
5145 | 5144 |
5146 | 5145 |
5147 void LCodeGen::DoStringAdd(LStringAdd* instr) { | 5146 void LCodeGen::DoStringAdd(LStringAdd* instr) { |
5148 ASSERT(ToRegister(instr->context()).is(cp)); | 5147 ASSERT(ToRegister(instr->context()).is(cp)); |
5149 ASSERT(ToRegister(instr->left()).Is(x1)); | 5148 ASSERT(ToRegister(instr->left()).Is(x1)); |
5150 ASSERT(ToRegister(instr->right()).Is(x0)); | 5149 ASSERT(ToRegister(instr->right()).Is(x0)); |
5151 StringAddStub stub(instr->hydrogen()->flags(), | 5150 StringAddStub stub(instr->hydrogen()->flags(), |
5152 instr->hydrogen()->pretenure_flag()); | 5151 instr->hydrogen()->pretenure_flag()); |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5699 __ Bind(&out_of_object); | 5698 __ Bind(&out_of_object); |
5700 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5699 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
5701 // Index is equal to negated out of object property index plus 1. | 5700 // Index is equal to negated out of object property index plus 1. |
5702 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5701 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5703 __ Ldr(result, FieldMemOperand(result, | 5702 __ Ldr(result, FieldMemOperand(result, |
5704 FixedArray::kHeaderSize - kPointerSize)); | 5703 FixedArray::kHeaderSize - kPointerSize)); |
5705 __ Bind(&done); | 5704 __ Bind(&done); |
5706 } | 5705 } |
5707 | 5706 |
5708 } } // namespace v8::internal | 5707 } } // namespace v8::internal |
OLD | NEW |