| 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_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 __ push(Immediate(isolate()->factory()->undefined_value())); | 144 __ push(Immediate(isolate()->factory()->undefined_value())); |
| 145 } else if (locals_count > 1) { | 145 } else if (locals_count > 1) { |
| 146 if (locals_count >= 128) { | 146 if (locals_count >= 128) { |
| 147 Label ok; | 147 Label ok; |
| 148 __ mov(ecx, esp); | 148 __ mov(ecx, esp); |
| 149 __ sub(ecx, Immediate(locals_count * kPointerSize)); | 149 __ sub(ecx, Immediate(locals_count * kPointerSize)); |
| 150 ExternalReference stack_limit = | 150 ExternalReference stack_limit = |
| 151 ExternalReference::address_of_real_stack_limit(isolate()); | 151 ExternalReference::address_of_real_stack_limit(isolate()); |
| 152 __ cmp(ecx, Operand::StaticVariable(stack_limit)); | 152 __ cmp(ecx, Operand::StaticVariable(stack_limit)); |
| 153 __ j(above_equal, &ok, Label::kNear); | 153 __ j(above_equal, &ok, Label::kNear); |
| 154 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); | 154 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); |
| 155 __ bind(&ok); | 155 __ bind(&ok); |
| 156 } | 156 } |
| 157 __ mov(eax, Immediate(isolate()->factory()->undefined_value())); | 157 __ mov(eax, Immediate(isolate()->factory()->undefined_value())); |
| 158 const int kMaxPushes = 32; | 158 const int kMaxPushes = 32; |
| 159 if (locals_count >= kMaxPushes) { | 159 if (locals_count >= kMaxPushes) { |
| 160 int loop_iterations = locals_count / kMaxPushes; | 160 int loop_iterations = locals_count / kMaxPushes; |
| 161 __ mov(ecx, loop_iterations); | 161 __ mov(ecx, loop_iterations); |
| 162 Label loop_header; | 162 Label loop_header; |
| 163 __ bind(&loop_header); | 163 __ bind(&loop_header); |
| 164 // Do pushes. | 164 // Do pushes. |
| (...skipping 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1825 __ Drop(1); // literal index | 1825 __ Drop(1); // literal index |
| 1826 __ Pop(eax); | 1826 __ Pop(eax); |
| 1827 result_saved = false; | 1827 result_saved = false; |
| 1828 } | 1828 } |
| 1829 for (; array_index < length; array_index++) { | 1829 for (; array_index < length; array_index++) { |
| 1830 Expression* subexpr = subexprs->at(array_index); | 1830 Expression* subexpr = subexprs->at(array_index); |
| 1831 | 1831 |
| 1832 __ Push(eax); | 1832 __ Push(eax); |
| 1833 if (subexpr->IsSpread()) { | 1833 if (subexpr->IsSpread()) { |
| 1834 VisitForStackValue(subexpr->AsSpread()->expression()); | 1834 VisitForStackValue(subexpr->AsSpread()->expression()); |
| 1835 __ InvokeBuiltin(Builtins::CONCAT_ITERABLE_TO_ARRAY, CALL_FUNCTION); | 1835 __ InvokeBuiltin(Context::CONCAT_ITERABLE_TO_ARRAY_BUILTIN_INDEX, |
| 1836 CALL_FUNCTION); |
| 1836 } else { | 1837 } else { |
| 1837 VisitForStackValue(subexpr); | 1838 VisitForStackValue(subexpr); |
| 1838 __ CallRuntime(Runtime::kAppendElement, 2); | 1839 __ CallRuntime(Runtime::kAppendElement, 2); |
| 1839 } | 1840 } |
| 1840 | 1841 |
| 1841 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); | 1842 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); |
| 1842 } | 1843 } |
| 1843 | 1844 |
| 1844 if (result_saved) { | 1845 if (result_saved) { |
| 1845 __ Drop(1); // literal index | 1846 __ Drop(1); // literal index |
| (...skipping 3127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4973 Label* if_false = NULL; | 4974 Label* if_false = NULL; |
| 4974 Label* fall_through = NULL; | 4975 Label* fall_through = NULL; |
| 4975 context()->PrepareTest(&materialize_true, &materialize_false, | 4976 context()->PrepareTest(&materialize_true, &materialize_false, |
| 4976 &if_true, &if_false, &fall_through); | 4977 &if_true, &if_false, &fall_through); |
| 4977 | 4978 |
| 4978 Token::Value op = expr->op(); | 4979 Token::Value op = expr->op(); |
| 4979 VisitForStackValue(expr->left()); | 4980 VisitForStackValue(expr->left()); |
| 4980 switch (op) { | 4981 switch (op) { |
| 4981 case Token::IN: | 4982 case Token::IN: |
| 4982 VisitForStackValue(expr->right()); | 4983 VisitForStackValue(expr->right()); |
| 4983 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION); | 4984 __ InvokeBuiltin(Context::IN_BUILTIN_INDEX, CALL_FUNCTION); |
| 4984 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 4985 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
| 4985 __ cmp(eax, isolate()->factory()->true_value()); | 4986 __ cmp(eax, isolate()->factory()->true_value()); |
| 4986 Split(equal, if_true, if_false, fall_through); | 4987 Split(equal, if_true, if_false, fall_through); |
| 4987 break; | 4988 break; |
| 4988 | 4989 |
| 4989 case Token::INSTANCEOF: { | 4990 case Token::INSTANCEOF: { |
| 4990 VisitForAccumulatorValue(expr->right()); | 4991 VisitForAccumulatorValue(expr->right()); |
| 4991 __ Pop(edx); | 4992 __ Pop(edx); |
| 4992 InstanceOfStub stub(isolate()); | 4993 InstanceOfStub stub(isolate()); |
| 4993 __ CallStub(&stub); | 4994 __ CallStub(&stub); |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5246 Assembler::target_address_at(call_target_address, | 5247 Assembler::target_address_at(call_target_address, |
| 5247 unoptimized_code)); | 5248 unoptimized_code)); |
| 5248 return OSR_AFTER_STACK_CHECK; | 5249 return OSR_AFTER_STACK_CHECK; |
| 5249 } | 5250 } |
| 5250 | 5251 |
| 5251 | 5252 |
| 5252 } // namespace internal | 5253 } // namespace internal |
| 5253 } // namespace v8 | 5254 } // namespace v8 |
| 5254 | 5255 |
| 5255 #endif // V8_TARGET_ARCH_X87 | 5256 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |