| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 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 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1834 __ Drop(1); // literal index | 1834 __ Drop(1); // literal index |
| 1835 __ Pop(eax); | 1835 __ Pop(eax); |
| 1836 result_saved = false; | 1836 result_saved = false; |
| 1837 } | 1837 } |
| 1838 for (; array_index < length; array_index++) { | 1838 for (; array_index < length; array_index++) { |
| 1839 Expression* subexpr = subexprs->at(array_index); | 1839 Expression* subexpr = subexprs->at(array_index); |
| 1840 | 1840 |
| 1841 __ Push(eax); | 1841 __ Push(eax); |
| 1842 if (subexpr->IsSpread()) { | 1842 if (subexpr->IsSpread()) { |
| 1843 VisitForStackValue(subexpr->AsSpread()->expression()); | 1843 VisitForStackValue(subexpr->AsSpread()->expression()); |
| 1844 __ InvokeBuiltin(Builtins::CONCAT_ITERABLE_TO_ARRAY, CALL_FUNCTION); | 1844 __ InvokeBuiltin(Context::CONCAT_ITERABLE_TO_ARRAY_BUILTIN_INDEX, |
| 1845 CALL_FUNCTION); |
| 1845 } else { | 1846 } else { |
| 1846 VisitForStackValue(subexpr); | 1847 VisitForStackValue(subexpr); |
| 1847 __ CallRuntime(Runtime::kAppendElement, 2); | 1848 __ CallRuntime(Runtime::kAppendElement, 2); |
| 1848 } | 1849 } |
| 1849 | 1850 |
| 1850 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); | 1851 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); |
| 1851 } | 1852 } |
| 1852 | 1853 |
| 1853 if (result_saved) { | 1854 if (result_saved) { |
| 1854 __ Drop(1); // literal index | 1855 __ Drop(1); // literal index |
| (...skipping 3127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4982 Label* if_false = NULL; | 4983 Label* if_false = NULL; |
| 4983 Label* fall_through = NULL; | 4984 Label* fall_through = NULL; |
| 4984 context()->PrepareTest(&materialize_true, &materialize_false, | 4985 context()->PrepareTest(&materialize_true, &materialize_false, |
| 4985 &if_true, &if_false, &fall_through); | 4986 &if_true, &if_false, &fall_through); |
| 4986 | 4987 |
| 4987 Token::Value op = expr->op(); | 4988 Token::Value op = expr->op(); |
| 4988 VisitForStackValue(expr->left()); | 4989 VisitForStackValue(expr->left()); |
| 4989 switch (op) { | 4990 switch (op) { |
| 4990 case Token::IN: | 4991 case Token::IN: |
| 4991 VisitForStackValue(expr->right()); | 4992 VisitForStackValue(expr->right()); |
| 4992 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION); | 4993 __ InvokeBuiltin(Context::IN_BUILTIN_INDEX, CALL_FUNCTION); |
| 4993 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 4994 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
| 4994 __ cmp(eax, isolate()->factory()->true_value()); | 4995 __ cmp(eax, isolate()->factory()->true_value()); |
| 4995 Split(equal, if_true, if_false, fall_through); | 4996 Split(equal, if_true, if_false, fall_through); |
| 4996 break; | 4997 break; |
| 4997 | 4998 |
| 4998 case Token::INSTANCEOF: { | 4999 case Token::INSTANCEOF: { |
| 4999 VisitForAccumulatorValue(expr->right()); | 5000 VisitForAccumulatorValue(expr->right()); |
| 5000 __ Pop(edx); | 5001 __ Pop(edx); |
| 5001 InstanceOfStub stub(isolate()); | 5002 InstanceOfStub stub(isolate()); |
| 5002 __ CallStub(&stub); | 5003 __ CallStub(&stub); |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5255 Assembler::target_address_at(call_target_address, | 5256 Assembler::target_address_at(call_target_address, |
| 5256 unoptimized_code)); | 5257 unoptimized_code)); |
| 5257 return OSR_AFTER_STACK_CHECK; | 5258 return OSR_AFTER_STACK_CHECK; |
| 5258 } | 5259 } |
| 5259 | 5260 |
| 5260 | 5261 |
| 5261 } // namespace internal | 5262 } // namespace internal |
| 5262 } // namespace v8 | 5263 } // namespace v8 |
| 5263 | 5264 |
| 5264 #endif // V8_TARGET_ARCH_IA32 | 5265 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |