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 7484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7495 HInstruction* result = | 7495 HInstruction* result = |
7496 new(zone()) HApplyArguments(function, | 7496 new(zone()) HApplyArguments(function, |
7497 wrapped_receiver, | 7497 wrapped_receiver, |
7498 length, | 7498 length, |
7499 elements); | 7499 elements); |
7500 result->set_position(expr->position()); | 7500 result->set_position(expr->position()); |
7501 ast_context()->ReturnInstruction(result, expr->id()); | 7501 ast_context()->ReturnInstruction(result, expr->id()); |
7502 return true; | 7502 return true; |
7503 } else { | 7503 } else { |
7504 // We are inside inlined function and we know exactly what is inside | 7504 // We are inside inlined function and we know exactly what is inside |
7505 // arguments object. | 7505 // arguments object. But we need to be able to materialize at deopt. |
| 7506 // TODO(mstarzinger): For now we just ensure arguments are pushed |
| 7507 // right after HEnterInlined, but we could be smarter about this. |
| 7508 EnsureArgumentsArePushedForAccess(); |
7506 HValue* context = environment()->LookupContext(); | 7509 HValue* context = environment()->LookupContext(); |
7507 | 7510 |
7508 HValue* wrapped_receiver = | 7511 HValue* wrapped_receiver = |
7509 AddInstruction(new(zone()) HWrapReceiver(receiver, function)); | 7512 AddInstruction(new(zone()) HWrapReceiver(receiver, function)); |
7510 PushAndAdd(new(zone()) HPushArgument(wrapped_receiver)); | 7513 PushAndAdd(new(zone()) HPushArgument(wrapped_receiver)); |
7511 | 7514 |
7512 HEnvironment* arguments_env = environment()->arguments_environment(); | 7515 HEnvironment* arguments_env = environment()->arguments_environment(); |
7513 | 7516 |
7514 int parameter_count = arguments_env->parameter_count(); | 7517 int parameter_count = arguments_env->parameter_count(); |
7515 for (int i = 1; i < arguments_env->parameter_count(); i++) { | 7518 for (int i = 1; i < arguments_env->parameter_count(); i++) { |
(...skipping 2457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9973 } | 9976 } |
9974 } | 9977 } |
9975 | 9978 |
9976 #ifdef DEBUG | 9979 #ifdef DEBUG |
9977 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 9980 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
9978 if (allocator_ != NULL) allocator_->Verify(); | 9981 if (allocator_ != NULL) allocator_->Verify(); |
9979 #endif | 9982 #endif |
9980 } | 9983 } |
9981 | 9984 |
9982 } } // namespace v8::internal | 9985 } } // namespace v8::internal |
OLD | NEW |