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 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 hydrogen_env->frame_type() != JS_FUNCTION); | 855 hydrogen_env->frame_type() != JS_FUNCTION); |
856 int value_count = hydrogen_env->length(); | 856 int value_count = hydrogen_env->length(); |
857 LEnvironment* result = new(zone()) LEnvironment( | 857 LEnvironment* result = new(zone()) LEnvironment( |
858 hydrogen_env->closure(), | 858 hydrogen_env->closure(), |
859 hydrogen_env->frame_type(), | 859 hydrogen_env->frame_type(), |
860 ast_id, | 860 ast_id, |
861 hydrogen_env->parameter_count(), | 861 hydrogen_env->parameter_count(), |
862 argument_count_, | 862 argument_count_, |
863 value_count, | 863 value_count, |
864 outer, | 864 outer, |
865 hydrogen_env->entry(), | |
866 zone()); | 865 zone()); |
867 int argument_index = *argument_index_accumulator; | 866 int argument_index = *argument_index_accumulator; |
868 for (int i = 0; i < value_count; ++i) { | 867 for (int i = 0; i < value_count; ++i) { |
869 if (hydrogen_env->is_special_index(i)) continue; | 868 if (hydrogen_env->is_special_index(i)) continue; |
870 | 869 |
871 HValue* value = hydrogen_env->values()->at(i); | 870 HValue* value = hydrogen_env->values()->at(i); |
872 LOperand* op = NULL; | 871 LOperand* op = NULL; |
873 if (value->IsArgumentsObject()) { | 872 if (value->IsArgumentsObject()) { |
874 op = NULL; | 873 op = NULL; |
875 } else if (value->IsPushArgument()) { | 874 } else if (value->IsPushArgument()) { |
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2062 | 2061 |
2063 LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) { | 2062 LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) { |
2064 LOperand* object = UseFixed(instr->object(), a0); | 2063 LOperand* object = UseFixed(instr->object(), a0); |
2065 LOperand* key = UseFixed(instr->key(), a1); | 2064 LOperand* key = UseFixed(instr->key(), a1); |
2066 LDeleteProperty* result = new(zone()) LDeleteProperty(object, key); | 2065 LDeleteProperty* result = new(zone()) LDeleteProperty(object, key); |
2067 return MarkAsCall(DefineFixed(result, v0), instr); | 2066 return MarkAsCall(DefineFixed(result, v0), instr); |
2068 } | 2067 } |
2069 | 2068 |
2070 | 2069 |
2071 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { | 2070 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { |
2072 ASSERT(argument_count_ == 0); | |
2073 allocator_->MarkAsOsrEntry(); | 2071 allocator_->MarkAsOsrEntry(); |
2074 current_block_->last_environment()->set_ast_id(instr->ast_id()); | 2072 current_block_->last_environment()->set_ast_id(instr->ast_id()); |
2075 return AssignEnvironment(new(zone()) LOsrEntry); | 2073 return AssignEnvironment(new(zone()) LOsrEntry); |
2076 } | 2074 } |
2077 | 2075 |
2078 | 2076 |
2079 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { | 2077 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { |
2080 int spill_index = chunk()->GetParameterStackSlot(instr->index()); | 2078 int spill_index = chunk()->GetParameterStackSlot(instr->index()); |
2081 return DefineAsSpilled(new(zone()) LParameter, spill_index); | 2079 return DefineAsSpilled(new(zone()) LParameter, spill_index); |
2082 } | 2080 } |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2190 HConstant* undefined = graph()->GetConstantUndefined(); | 2188 HConstant* undefined = graph()->GetConstantUndefined(); |
2191 HEnvironment* inner = outer->CopyForInlining(instr->closure(), | 2189 HEnvironment* inner = outer->CopyForInlining(instr->closure(), |
2192 instr->arguments_count(), | 2190 instr->arguments_count(), |
2193 instr->function(), | 2191 instr->function(), |
2194 undefined, | 2192 undefined, |
2195 instr->call_kind(), | 2193 instr->call_kind(), |
2196 instr->inlining_kind()); | 2194 instr->inlining_kind()); |
2197 if (instr->arguments_var() != NULL) { | 2195 if (instr->arguments_var() != NULL) { |
2198 inner->Bind(instr->arguments_var(), graph()->GetArgumentsObject()); | 2196 inner->Bind(instr->arguments_var(), graph()->GetArgumentsObject()); |
2199 } | 2197 } |
2200 inner->set_entry(instr); | |
2201 current_block_->UpdateEnvironment(inner); | 2198 current_block_->UpdateEnvironment(inner); |
2202 chunk_->AddInlinedClosure(instr->closure()); | 2199 chunk_->AddInlinedClosure(instr->closure()); |
2203 return NULL; | 2200 return NULL; |
2204 } | 2201 } |
2205 | 2202 |
2206 | 2203 |
2207 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2204 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
2208 LInstruction* pop = NULL; | 2205 LInstruction* pop = NULL; |
2209 | 2206 |
2210 HEnvironment* env = current_block_->last_environment(); | 2207 HEnvironment* env = current_block_->last_environment(); |
2211 | 2208 |
2212 if (env->entry()->arguments_pushed()) { | 2209 if (instr->arguments_pushed()) { |
2213 int argument_count = env->arguments_environment()->parameter_count(); | 2210 int argument_count = env->arguments_environment()->parameter_count(); |
2214 pop = new(zone()) LDrop(argument_count); | 2211 pop = new(zone()) LDrop(argument_count); |
2215 argument_count_ -= argument_count; | 2212 argument_count_ -= argument_count; |
2216 } | 2213 } |
2217 | 2214 |
2218 HEnvironment* outer = current_block_->last_environment()-> | 2215 HEnvironment* outer = current_block_->last_environment()-> |
2219 DiscardInlined(false); | 2216 DiscardInlined(false); |
2220 current_block_->UpdateEnvironment(outer); | 2217 current_block_->UpdateEnvironment(outer); |
2221 | 2218 |
2222 return pop; | 2219 return pop; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2254 | 2251 |
2255 | 2252 |
2256 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2253 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2257 LOperand* object = UseRegister(instr->object()); | 2254 LOperand* object = UseRegister(instr->object()); |
2258 LOperand* index = UseRegister(instr->index()); | 2255 LOperand* index = UseRegister(instr->index()); |
2259 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2256 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2260 } | 2257 } |
2261 | 2258 |
2262 | 2259 |
2263 } } // namespace v8::internal | 2260 } } // namespace v8::internal |
OLD | NEW |