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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 { Comment cmnt(masm_, "[ Allocate locals"); | 156 { Comment cmnt(masm_, "[ Allocate locals"); |
157 int locals_count = info->scope()->num_stack_slots(); | 157 int locals_count = info->scope()->num_stack_slots(); |
158 // Generators allocate locals, if any, in context slots. | 158 // Generators allocate locals, if any, in context slots. |
159 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); | 159 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); |
160 if (locals_count > 0) { | 160 if (locals_count > 0) { |
161 if (locals_count >= 128) { | 161 if (locals_count >= 128) { |
162 Label ok; | 162 Label ok; |
163 __ Subu(t5, sp, Operand(locals_count * kPointerSize)); | 163 __ Subu(t5, sp, Operand(locals_count * kPointerSize)); |
164 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex); | 164 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex); |
165 __ Branch(&ok, hs, t5, Operand(a2)); | 165 __ Branch(&ok, hs, t5, Operand(a2)); |
166 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); | 166 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); |
167 __ bind(&ok); | 167 __ bind(&ok); |
168 } | 168 } |
169 __ LoadRoot(t5, Heap::kUndefinedValueRootIndex); | 169 __ LoadRoot(t5, Heap::kUndefinedValueRootIndex); |
170 int kMaxPushes = FLAG_optimize_for_size ? 4 : 32; | 170 int kMaxPushes = FLAG_optimize_for_size ? 4 : 32; |
171 if (locals_count >= kMaxPushes) { | 171 if (locals_count >= kMaxPushes) { |
172 int loop_iterations = locals_count / kMaxPushes; | 172 int loop_iterations = locals_count / kMaxPushes; |
173 __ li(a2, Operand(loop_iterations)); | 173 __ li(a2, Operand(loop_iterations)); |
174 Label loop_header; | 174 Label loop_header; |
175 __ bind(&loop_header); | 175 __ bind(&loop_header); |
176 // Do pushes. | 176 // Do pushes. |
(...skipping 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1900 __ Pop(); // literal index | 1900 __ Pop(); // literal index |
1901 __ Pop(v0); | 1901 __ Pop(v0); |
1902 result_saved = false; | 1902 result_saved = false; |
1903 } | 1903 } |
1904 for (; array_index < length; array_index++) { | 1904 for (; array_index < length; array_index++) { |
1905 Expression* subexpr = subexprs->at(array_index); | 1905 Expression* subexpr = subexprs->at(array_index); |
1906 | 1906 |
1907 __ Push(v0); | 1907 __ Push(v0); |
1908 if (subexpr->IsSpread()) { | 1908 if (subexpr->IsSpread()) { |
1909 VisitForStackValue(subexpr->AsSpread()->expression()); | 1909 VisitForStackValue(subexpr->AsSpread()->expression()); |
1910 __ InvokeBuiltin(Builtins::CONCAT_ITERABLE_TO_ARRAY, CALL_FUNCTION); | 1910 __ InvokeBuiltin(Context::CONCAT_ITERABLE_TO_ARRAY_BUILTIN_INDEX, |
| 1911 CALL_FUNCTION); |
1911 } else { | 1912 } else { |
1912 VisitForStackValue(subexpr); | 1913 VisitForStackValue(subexpr); |
1913 __ CallRuntime(Runtime::kAppendElement, 2); | 1914 __ CallRuntime(Runtime::kAppendElement, 2); |
1914 } | 1915 } |
1915 | 1916 |
1916 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); | 1917 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); |
1917 } | 1918 } |
1918 | 1919 |
1919 if (result_saved) { | 1920 if (result_saved) { |
1920 __ Pop(); // literal index | 1921 __ Pop(); // literal index |
(...skipping 3148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5069 Label* if_false = NULL; | 5070 Label* if_false = NULL; |
5070 Label* fall_through = NULL; | 5071 Label* fall_through = NULL; |
5071 context()->PrepareTest(&materialize_true, &materialize_false, | 5072 context()->PrepareTest(&materialize_true, &materialize_false, |
5072 &if_true, &if_false, &fall_through); | 5073 &if_true, &if_false, &fall_through); |
5073 | 5074 |
5074 Token::Value op = expr->op(); | 5075 Token::Value op = expr->op(); |
5075 VisitForStackValue(expr->left()); | 5076 VisitForStackValue(expr->left()); |
5076 switch (op) { | 5077 switch (op) { |
5077 case Token::IN: | 5078 case Token::IN: |
5078 VisitForStackValue(expr->right()); | 5079 VisitForStackValue(expr->right()); |
5079 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION); | 5080 __ InvokeBuiltin(Context::IN_BUILTIN_INDEX, CALL_FUNCTION); |
5080 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 5081 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
5081 __ LoadRoot(t0, Heap::kTrueValueRootIndex); | 5082 __ LoadRoot(t0, Heap::kTrueValueRootIndex); |
5082 Split(eq, v0, Operand(t0), if_true, if_false, fall_through); | 5083 Split(eq, v0, Operand(t0), if_true, if_false, fall_through); |
5083 break; | 5084 break; |
5084 | 5085 |
5085 case Token::INSTANCEOF: { | 5086 case Token::INSTANCEOF: { |
5086 VisitForAccumulatorValue(expr->right()); | 5087 VisitForAccumulatorValue(expr->right()); |
5087 __ mov(a0, result_register()); | 5088 __ mov(a0, result_register()); |
5088 __ pop(a1); | 5089 __ pop(a1); |
5089 InstanceOfStub stub(isolate()); | 5090 InstanceOfStub stub(isolate()); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5343 reinterpret_cast<uint32_t>( | 5344 reinterpret_cast<uint32_t>( |
5344 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5345 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5345 return OSR_AFTER_STACK_CHECK; | 5346 return OSR_AFTER_STACK_CHECK; |
5346 } | 5347 } |
5347 | 5348 |
5348 | 5349 |
5349 } // namespace internal | 5350 } // namespace internal |
5350 } // namespace v8 | 5351 } // namespace v8 |
5351 | 5352 |
5352 #endif // V8_TARGET_ARCH_MIPS | 5353 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |