OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 5109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5120 } | 5120 } |
5121 __ jmp(&done_allocate); | 5121 __ jmp(&done_allocate); |
5122 | 5122 |
5123 // Fall back to %NewStrictArguments. | 5123 // Fall back to %NewStrictArguments. |
5124 __ bind(&too_big_for_new_space); | 5124 __ bind(&too_big_for_new_space); |
5125 __ Push(a1); | 5125 __ Push(a1); |
5126 __ TailCallRuntime(Runtime::kNewStrictArguments); | 5126 __ TailCallRuntime(Runtime::kNewStrictArguments); |
5127 } | 5127 } |
5128 | 5128 |
5129 | 5129 |
5130 void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) { | |
5131 Register context_reg = cp; | |
5132 Register slot_reg = a2; | |
5133 Register result_reg = v0; | |
5134 Label slow_case; | |
5135 | |
5136 // Go up context chain to the script context. | |
5137 for (int i = 0; i < depth(); ++i) { | |
5138 __ ld(result_reg, ContextMemOperand(context_reg, Context::PREVIOUS_INDEX)); | |
5139 context_reg = result_reg; | |
5140 } | |
5141 | |
5142 // Load the PropertyCell value at the specified slot. | |
5143 __ Dlsa(at, context_reg, slot_reg, kPointerSizeLog2); | |
5144 __ ld(result_reg, ContextMemOperand(at, 0)); | |
5145 __ ld(result_reg, FieldMemOperand(result_reg, PropertyCell::kValueOffset)); | |
5146 | |
5147 // Check that value is not the_hole. | |
5148 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | |
5149 __ Branch(&slow_case, eq, result_reg, Operand(at)); | |
5150 __ Ret(); | |
5151 | |
5152 // Fallback to the runtime. | |
5153 __ bind(&slow_case); | |
5154 __ SmiTag(slot_reg); | |
5155 __ Push(slot_reg); | |
5156 __ TailCallRuntime(Runtime::kLoadGlobalViaContext); | |
5157 } | |
5158 | |
5159 | |
5160 void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { | 5130 void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
5161 Register context_reg = cp; | 5131 Register context_reg = cp; |
5162 Register slot_reg = a2; | 5132 Register slot_reg = a2; |
5163 Register value_reg = a0; | 5133 Register value_reg = a0; |
5164 Register cell_reg = a4; | 5134 Register cell_reg = a4; |
5165 Register cell_value_reg = a5; | 5135 Register cell_value_reg = a5; |
5166 Register cell_details_reg = a6; | 5136 Register cell_details_reg = a6; |
5167 Label fast_heapobject_case, fast_smi_case, slow_case; | 5137 Label fast_heapobject_case, fast_smi_case, slow_case; |
5168 | 5138 |
5169 if (FLAG_debug_code) { | 5139 if (FLAG_debug_code) { |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5580 kStackUnwindSpace, kInvalidStackOffset, | 5550 kStackUnwindSpace, kInvalidStackOffset, |
5581 return_value_operand, NULL); | 5551 return_value_operand, NULL); |
5582 } | 5552 } |
5583 | 5553 |
5584 #undef __ | 5554 #undef __ |
5585 | 5555 |
5586 } // namespace internal | 5556 } // namespace internal |
5587 } // namespace v8 | 5557 } // namespace v8 |
5588 | 5558 |
5589 #endif // V8_TARGET_ARCH_MIPS64 | 5559 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |