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)); | |
Kevin Millikin (Chromium)
2012/04/11 11:49:18
I'd be more comfortable if we set this flag on the
Vyacheslav Egorov (Chromium)
2012/04/11 12:47:28
Done.
| |
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()); |
2274 if (instr->arguments() != NULL) { | 2275 if (instr->arguments_var() != NULL) { |
2275 inner->Bind(instr->arguments(), graph()->GetArgumentsObject()); | 2276 inner->Bind(instr->arguments_var(), graph()->GetArgumentsObject()); |
2276 } | 2277 } |
2277 current_block_->UpdateEnvironment(inner); | 2278 current_block_->UpdateEnvironment(inner); |
2278 chunk_->AddInlinedClosure(instr->closure()); | 2279 chunk_->AddInlinedClosure(instr->closure()); |
2279 return NULL; | 2280 return NULL; |
2280 } | 2281 } |
2281 | 2282 |
2282 | 2283 |
2283 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 | |
2284 HEnvironment* outer = current_block_->last_environment()-> | 2295 HEnvironment* outer = current_block_->last_environment()-> |
2285 DiscardInlined(false); | 2296 DiscardInlined(false); |
2286 current_block_->UpdateEnvironment(outer); | 2297 current_block_->UpdateEnvironment(outer); |
2287 return NULL; | 2298 |
2299 return pop; | |
2288 } | 2300 } |
2289 | 2301 |
2290 | 2302 |
2291 LInstruction* LChunkBuilder::DoIn(HIn* instr) { | 2303 LInstruction* LChunkBuilder::DoIn(HIn* instr) { |
2292 LOperand* key = UseRegisterAtStart(instr->key()); | 2304 LOperand* key = UseRegisterAtStart(instr->key()); |
2293 LOperand* object = UseRegisterAtStart(instr->object()); | 2305 LOperand* object = UseRegisterAtStart(instr->object()); |
2294 LIn* result = new(zone()) LIn(key, object); | 2306 LIn* result = new(zone()) LIn(key, object); |
2295 return MarkAsCall(DefineFixed(result, r0), instr); | 2307 return MarkAsCall(DefineFixed(result, r0), instr); |
2296 } | 2308 } |
2297 | 2309 |
(...skipping 20 matching lines...) Expand all Loading... | |
2318 | 2330 |
2319 | 2331 |
2320 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2332 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2321 LOperand* object = UseRegister(instr->object()); | 2333 LOperand* object = UseRegister(instr->object()); |
2322 LOperand* index = UseRegister(instr->index()); | 2334 LOperand* index = UseRegister(instr->index()); |
2323 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2335 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2324 } | 2336 } |
2325 | 2337 |
2326 | 2338 |
2327 } } // namespace v8::internal | 2339 } } // namespace v8::internal |
OLD | NEW |