| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 #ifdef DEBUG | 613 #ifdef DEBUG |
| 614 instr->VerifyCall(); | 614 instr->VerifyCall(); |
| 615 #endif | 615 #endif |
| 616 instr->MarkAsCall(); | 616 instr->MarkAsCall(); |
| 617 instr = AssignPointerMap(instr); | 617 instr = AssignPointerMap(instr); |
| 618 | 618 |
| 619 if (hinstr->HasObservableSideEffects()) { | 619 if (hinstr->HasObservableSideEffects()) { |
| 620 ASSERT(hinstr->next()->IsSimulate()); | 620 ASSERT(hinstr->next()->IsSimulate()); |
| 621 HSimulate* sim = HSimulate::cast(hinstr->next()); | 621 HSimulate* sim = HSimulate::cast(hinstr->next()); |
| 622 ASSERT(instruction_pending_deoptimization_environment_ == NULL); | 622 ASSERT(instruction_pending_deoptimization_environment_ == NULL); |
| 623 ASSERT(pending_deoptimization_ast_id_ == AstNode::kNoNumber); | 623 ASSERT(pending_deoptimization_ast_id_.IsNone()); |
| 624 instruction_pending_deoptimization_environment_ = instr; | 624 instruction_pending_deoptimization_environment_ = instr; |
| 625 pending_deoptimization_ast_id_ = sim->ast_id(); | 625 pending_deoptimization_ast_id_ = sim->ast_id(); |
| 626 } | 626 } |
| 627 | 627 |
| 628 // If instruction does not have side-effects lazy deoptimization | 628 // If instruction does not have side-effects lazy deoptimization |
| 629 // after the call will try to deoptimize to the point before the call. | 629 // after the call will try to deoptimize to the point before the call. |
| 630 // Thus we still need to attach environment to this call even if | 630 // Thus we still need to attach environment to this call even if |
| 631 // call sequence can not deoptimize eagerly. | 631 // call sequence can not deoptimize eagerly. |
| 632 bool needs_environment = | 632 bool needs_environment = |
| 633 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) || | 633 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) || |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 } | 847 } |
| 848 | 848 |
| 849 | 849 |
| 850 LEnvironment* LChunkBuilder::CreateEnvironment( | 850 LEnvironment* LChunkBuilder::CreateEnvironment( |
| 851 HEnvironment* hydrogen_env, | 851 HEnvironment* hydrogen_env, |
| 852 int* argument_index_accumulator) { | 852 int* argument_index_accumulator) { |
| 853 if (hydrogen_env == NULL) return NULL; | 853 if (hydrogen_env == NULL) return NULL; |
| 854 | 854 |
| 855 LEnvironment* outer = | 855 LEnvironment* outer = |
| 856 CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator); | 856 CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator); |
| 857 int ast_id = hydrogen_env->ast_id(); | 857 BailoutId ast_id = hydrogen_env->ast_id(); |
| 858 ASSERT(ast_id != AstNode::kNoNumber || | 858 ASSERT(!ast_id.IsNone() || |
| 859 hydrogen_env->frame_type() != JS_FUNCTION); | 859 hydrogen_env->frame_type() != JS_FUNCTION); |
| 860 int value_count = hydrogen_env->length(); | 860 int value_count = hydrogen_env->length(); |
| 861 LEnvironment* result = new(zone()) LEnvironment( | 861 LEnvironment* result = new(zone()) LEnvironment( |
| 862 hydrogen_env->closure(), | 862 hydrogen_env->closure(), |
| 863 hydrogen_env->frame_type(), | 863 hydrogen_env->frame_type(), |
| 864 ast_id, | 864 ast_id, |
| 865 hydrogen_env->parameter_count(), | 865 hydrogen_env->parameter_count(), |
| 866 argument_count_, | 866 argument_count_, |
| 867 value_count, | 867 value_count, |
| 868 outer, | 868 outer, |
| (...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2187 // If there is an instruction pending deoptimization environment create a | 2187 // If there is an instruction pending deoptimization environment create a |
| 2188 // lazy bailout instruction to capture the environment. | 2188 // lazy bailout instruction to capture the environment. |
| 2189 if (pending_deoptimization_ast_id_ == instr->ast_id()) { | 2189 if (pending_deoptimization_ast_id_ == instr->ast_id()) { |
| 2190 LInstruction* result = new(zone()) LLazyBailout; | 2190 LInstruction* result = new(zone()) LLazyBailout; |
| 2191 result = AssignEnvironment(result); | 2191 result = AssignEnvironment(result); |
| 2192 // Store the lazy deopt environment with the instruction if needed. Right | 2192 // Store the lazy deopt environment with the instruction if needed. Right |
| 2193 // now it is only used for LInstanceOfKnownGlobal. | 2193 // now it is only used for LInstanceOfKnownGlobal. |
| 2194 instruction_pending_deoptimization_environment_-> | 2194 instruction_pending_deoptimization_environment_-> |
| 2195 SetDeferredLazyDeoptimizationEnvironment(result->environment()); | 2195 SetDeferredLazyDeoptimizationEnvironment(result->environment()); |
| 2196 instruction_pending_deoptimization_environment_ = NULL; | 2196 instruction_pending_deoptimization_environment_ = NULL; |
| 2197 pending_deoptimization_ast_id_ = AstNode::kNoNumber; | 2197 pending_deoptimization_ast_id_ = BailoutId::None(); |
| 2198 return result; | 2198 return result; |
| 2199 } | 2199 } |
| 2200 | 2200 |
| 2201 return NULL; | 2201 return NULL; |
| 2202 } | 2202 } |
| 2203 | 2203 |
| 2204 | 2204 |
| 2205 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) { | 2205 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) { |
| 2206 if (instr->is_function_entry()) { | 2206 if (instr->is_function_entry()) { |
| 2207 return MarkAsCall(new(zone()) LStackCheck, instr); | 2207 return MarkAsCall(new(zone()) LStackCheck, instr); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2280 | 2280 |
| 2281 | 2281 |
| 2282 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2282 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2283 LOperand* object = UseRegister(instr->object()); | 2283 LOperand* object = UseRegister(instr->object()); |
| 2284 LOperand* index = UseRegister(instr->index()); | 2284 LOperand* index = UseRegister(instr->index()); |
| 2285 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2285 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
| 2286 } | 2286 } |
| 2287 | 2287 |
| 2288 | 2288 |
| 2289 } } // namespace v8::internal | 2289 } } // namespace v8::internal |
| OLD | NEW |