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