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