| 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 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 } | 1069 } |
| 1070 | 1070 |
| 1071 | 1071 |
| 1072 LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) { | 1072 LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) { |
| 1073 return DefineAsRegister( | 1073 return DefineAsRegister( |
| 1074 new(zone()) LArgumentsLength(UseRegister(length->value()))); | 1074 new(zone()) LArgumentsLength(UseRegister(length->value()))); |
| 1075 } | 1075 } |
| 1076 | 1076 |
| 1077 | 1077 |
| 1078 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { | 1078 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { |
| 1079 return DefineAsRegister(new(zone()) LArgumentsElements( | 1079 return DefineAsRegister(new(zone()) LArgumentsElements); |
| 1080 current_block_->last_environment()->outer() != NULL)); | |
| 1081 } | 1080 } |
| 1082 | 1081 |
| 1083 | 1082 |
| 1084 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { | 1083 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { |
| 1085 LInstanceOf* result = | 1084 LInstanceOf* result = |
| 1086 new(zone()) LInstanceOf(UseFixed(instr->left(), a0), | 1085 new(zone()) LInstanceOf(UseFixed(instr->left(), a0), |
| 1087 UseFixed(instr->right(), a1)); | 1086 UseFixed(instr->right(), a1)); |
| 1088 return MarkAsCall(DefineFixed(result, v0), instr); | 1087 return MarkAsCall(DefineFixed(result, v0), instr); |
| 1089 } | 1088 } |
| 1090 | 1089 |
| (...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2271 | 2270 |
| 2272 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { | 2271 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { |
| 2273 HEnvironment* outer = current_block_->last_environment(); | 2272 HEnvironment* outer = current_block_->last_environment(); |
| 2274 HConstant* undefined = graph()->GetConstantUndefined(); | 2273 HConstant* undefined = graph()->GetConstantUndefined(); |
| 2275 HEnvironment* inner = outer->CopyForInlining(instr->closure(), | 2274 HEnvironment* inner = outer->CopyForInlining(instr->closure(), |
| 2276 instr->arguments_count(), | 2275 instr->arguments_count(), |
| 2277 instr->function(), | 2276 instr->function(), |
| 2278 undefined, | 2277 undefined, |
| 2279 instr->call_kind(), | 2278 instr->call_kind(), |
| 2280 instr->is_construct()); | 2279 instr->is_construct()); |
| 2281 if (instr->materializes_arguments()) { | |
| 2282 inner->Bind(instr->arguments(), graph()->GetArgumentsObject()); | |
| 2283 } | |
| 2284 current_block_->UpdateEnvironment(inner); | 2280 current_block_->UpdateEnvironment(inner); |
| 2285 chunk_->AddInlinedClosure(instr->closure()); | 2281 chunk_->AddInlinedClosure(instr->closure()); |
| 2286 return NULL; | 2282 return NULL; |
| 2287 } | 2283 } |
| 2288 | 2284 |
| 2289 | 2285 |
| 2290 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2286 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
| 2291 LInstruction* pop = NULL; | |
| 2292 | |
| 2293 HEnvironment* env = current_block_->last_environment(); | |
| 2294 | |
| 2295 if (instr->arguments_pushed()) { | |
| 2296 int argument_count = env->arguments_environment()->parameter_count(); | |
| 2297 pop = new(zone()) LPop(argument_count); | |
| 2298 argument_count_ -= argument_count; | |
| 2299 } | |
| 2300 | |
| 2301 HEnvironment* outer = current_block_->last_environment()-> | 2287 HEnvironment* outer = current_block_->last_environment()-> |
| 2302 DiscardInlined(false); | 2288 DiscardInlined(false); |
| 2303 current_block_->UpdateEnvironment(outer); | 2289 current_block_->UpdateEnvironment(outer); |
| 2304 | 2290 return NULL; |
| 2305 return pop; | |
| 2306 } | 2291 } |
| 2307 | 2292 |
| 2308 | 2293 |
| 2309 LInstruction* LChunkBuilder::DoIn(HIn* instr) { | 2294 LInstruction* LChunkBuilder::DoIn(HIn* instr) { |
| 2310 LOperand* key = UseRegisterAtStart(instr->key()); | 2295 LOperand* key = UseRegisterAtStart(instr->key()); |
| 2311 LOperand* object = UseRegisterAtStart(instr->object()); | 2296 LOperand* object = UseRegisterAtStart(instr->object()); |
| 2312 LIn* result = new(zone()) LIn(key, object); | 2297 LIn* result = new(zone()) LIn(key, object); |
| 2313 return MarkAsCall(DefineFixed(result, v0), instr); | 2298 return MarkAsCall(DefineFixed(result, v0), instr); |
| 2314 } | 2299 } |
| 2315 | 2300 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2336 | 2321 |
| 2337 | 2322 |
| 2338 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2323 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2339 LOperand* object = UseRegister(instr->object()); | 2324 LOperand* object = UseRegister(instr->object()); |
| 2340 LOperand* index = UseRegister(instr->index()); | 2325 LOperand* index = UseRegister(instr->index()); |
| 2341 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2326 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
| 2342 } | 2327 } |
| 2343 | 2328 |
| 2344 | 2329 |
| 2345 } } // namespace v8::internal | 2330 } } // namespace v8::internal |
| OLD | NEW |