| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1217 | 1217 |
| 1218 LInstruction* LChunkBuilder::DoCallConstantFunction( | 1218 LInstruction* LChunkBuilder::DoCallConstantFunction( |
| 1219 HCallConstantFunction* instr) { | 1219 HCallConstantFunction* instr) { |
| 1220 argument_count_ -= instr->argument_count(); | 1220 argument_count_ -= instr->argument_count(); |
| 1221 return MarkAsCall(DefineFixed(new LCallConstantFunction, eax), instr); | 1221 return MarkAsCall(DefineFixed(new LCallConstantFunction, eax), instr); |
| 1222 } | 1222 } |
| 1223 | 1223 |
| 1224 | 1224 |
| 1225 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1225 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
| 1226 BuiltinFunctionId op = instr->op(); | 1226 BuiltinFunctionId op = instr->op(); |
| 1227 if (op == kMathLog || op == kMathSin || op == kMathCos) { | 1227 if (op == kMathLog) { |
| 1228 ASSERT(instr->representation().IsDouble()); |
| 1229 ASSERT(instr->value()->representation().IsDouble()); |
| 1230 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1231 LUnaryMathOperation* result = new LUnaryMathOperation(input); |
| 1232 return DefineSameAsFirst(result); |
| 1233 } else if (op == kMathSin || op == kMathCos) { |
| 1228 LOperand* input = UseFixedDouble(instr->value(), xmm1); | 1234 LOperand* input = UseFixedDouble(instr->value(), xmm1); |
| 1229 LUnaryMathOperation* result = new LUnaryMathOperation(input); | 1235 LUnaryMathOperation* result = new LUnaryMathOperation(input); |
| 1230 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); | 1236 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); |
| 1231 } else { | 1237 } else { |
| 1232 LOperand* input = UseRegisterAtStart(instr->value()); | 1238 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1233 LUnaryMathOperation* result = new LUnaryMathOperation(input); | 1239 LUnaryMathOperation* result = new LUnaryMathOperation(input); |
| 1234 switch (op) { | 1240 switch (op) { |
| 1235 case kMathAbs: | 1241 case kMathAbs: |
| 1236 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); | 1242 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); |
| 1237 case kMathFloor: | 1243 case kMathFloor: |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1754 | 1760 |
| 1755 | 1761 |
| 1756 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { | 1762 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { |
| 1757 LOperand* context = UseFixed(instr->context(), esi); | 1763 LOperand* context = UseFixed(instr->context(), esi); |
| 1758 LOperand* global_object = UseFixed(instr->global_object(), eax); | 1764 LOperand* global_object = UseFixed(instr->global_object(), eax); |
| 1759 LLoadGlobalGeneric* result = new LLoadGlobalGeneric(context, global_object); | 1765 LLoadGlobalGeneric* result = new LLoadGlobalGeneric(context, global_object); |
| 1760 return MarkAsCall(DefineFixed(result, eax), instr); | 1766 return MarkAsCall(DefineFixed(result, eax), instr); |
| 1761 } | 1767 } |
| 1762 | 1768 |
| 1763 | 1769 |
| 1764 LInstruction* LChunkBuilder::DoStoreGlobal(HStoreGlobal* instr) { | 1770 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { |
| 1765 LStoreGlobal* result = new LStoreGlobal(UseRegisterAtStart(instr->value())); | 1771 LStoreGlobalCell* result = |
| 1772 new LStoreGlobalCell(UseRegisterAtStart(instr->value())); |
| 1766 return instr->check_hole_value() ? AssignEnvironment(result) : result; | 1773 return instr->check_hole_value() ? AssignEnvironment(result) : result; |
| 1767 } | 1774 } |
| 1768 | 1775 |
| 1769 | 1776 |
| 1777 LInstruction* LChunkBuilder::DoStoreGlobalGeneric(HStoreGlobalGeneric* instr) { |
| 1778 LOperand* context = UseFixed(instr->context(), esi); |
| 1779 LOperand* global_object = UseFixed(instr->global_object(), edx); |
| 1780 LOperand* value = UseFixed(instr->value(), eax); |
| 1781 LStoreGlobalGeneric* result = |
| 1782 new LStoreGlobalGeneric(context, global_object, value); |
| 1783 return MarkAsCall(result, instr); |
| 1784 } |
| 1785 |
| 1786 |
| 1770 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { | 1787 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
| 1771 LOperand* context = UseRegisterAtStart(instr->value()); | 1788 LOperand* context = UseRegisterAtStart(instr->value()); |
| 1772 return DefineAsRegister(new LLoadContextSlot(context)); | 1789 return DefineAsRegister(new LLoadContextSlot(context)); |
| 1773 } | 1790 } |
| 1774 | 1791 |
| 1775 | 1792 |
| 1776 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { | 1793 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { |
| 1777 LOperand* context; | 1794 LOperand* context; |
| 1778 LOperand* value; | 1795 LOperand* value; |
| 1779 LOperand* temp; | 1796 LOperand* temp; |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2110 | 2127 |
| 2111 env->Drop(instr->pop_count()); | 2128 env->Drop(instr->pop_count()); |
| 2112 for (int i = 0; i < instr->values()->length(); ++i) { | 2129 for (int i = 0; i < instr->values()->length(); ++i) { |
| 2113 HValue* value = instr->values()->at(i); | 2130 HValue* value = instr->values()->at(i); |
| 2114 if (instr->HasAssignedIndexAt(i)) { | 2131 if (instr->HasAssignedIndexAt(i)) { |
| 2115 env->Bind(instr->GetAssignedIndexAt(i), value); | 2132 env->Bind(instr->GetAssignedIndexAt(i), value); |
| 2116 } else { | 2133 } else { |
| 2117 env->Push(value); | 2134 env->Push(value); |
| 2118 } | 2135 } |
| 2119 } | 2136 } |
| 2120 ASSERT(env->length() == instr->environment_length()); | |
| 2121 | 2137 |
| 2122 // If there is an instruction pending deoptimization environment create a | 2138 // If there is an instruction pending deoptimization environment create a |
| 2123 // lazy bailout instruction to capture the environment. | 2139 // lazy bailout instruction to capture the environment. |
| 2124 if (pending_deoptimization_ast_id_ != AstNode::kNoNumber) { | 2140 if (pending_deoptimization_ast_id_ != AstNode::kNoNumber) { |
| 2125 ASSERT(pending_deoptimization_ast_id_ == instr->ast_id()); | 2141 ASSERT(pending_deoptimization_ast_id_ == instr->ast_id()); |
| 2126 LLazyBailout* lazy_bailout = new LLazyBailout; | 2142 LLazyBailout* lazy_bailout = new LLazyBailout; |
| 2127 LInstruction* result = AssignEnvironment(lazy_bailout); | 2143 LInstruction* result = AssignEnvironment(lazy_bailout); |
| 2128 instruction_pending_deoptimization_environment_-> | 2144 instruction_pending_deoptimization_environment_-> |
| 2129 set_deoptimization_environment(result->environment()); | 2145 set_deoptimization_environment(result->environment()); |
| 2130 ClearInstructionPendingDeoptimizationEnvironment(); | 2146 ClearInstructionPendingDeoptimizationEnvironment(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 2156 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2172 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
| 2157 HEnvironment* outer = current_block_->last_environment()->outer(); | 2173 HEnvironment* outer = current_block_->last_environment()->outer(); |
| 2158 current_block_->UpdateEnvironment(outer); | 2174 current_block_->UpdateEnvironment(outer); |
| 2159 return NULL; | 2175 return NULL; |
| 2160 } | 2176 } |
| 2161 | 2177 |
| 2162 | 2178 |
| 2163 } } // namespace v8::internal | 2179 } } // namespace v8::internal |
| 2164 | 2180 |
| 2165 #endif // V8_TARGET_ARCH_IA32 | 2181 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |