OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_FULL_CODEGEN_H_ | 5 #ifndef V8_FULL_CODEGEN_H_ |
6 #define V8_FULL_CODEGEN_H_ | 6 #define V8_FULL_CODEGEN_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
363 Visit(expr); | 363 Visit(expr); |
364 PrepareForBailout(expr, NO_REGISTERS); | 364 PrepareForBailout(expr, NO_REGISTERS); |
365 } | 365 } |
366 | 366 |
367 void VisitForAccumulatorValue(Expression* expr) { | 367 void VisitForAccumulatorValue(Expression* expr) { |
368 AccumulatorValueContext context(this); | 368 AccumulatorValueContext context(this); |
369 Visit(expr); | 369 Visit(expr); |
370 PrepareForBailout(expr, TOS_REG); | 370 PrepareForBailout(expr, TOS_REG); |
371 } | 371 } |
372 | 372 |
373 void VisitForStackValue(Expression* expr) { | 373 void VisitForStackValue(Expression* expr, bool allow_super = false) { |
374 StackValueContext context(this); | 374 StackValueContext context(this); |
375 Visit(expr); | 375 if (allow_super && expr->IsSuperReference()) { |
Dmitry Lomov (no reviews)
2015/03/31 10:09:42
Do not do this.
Instead, call EmitLoadSuperConstr
| |
376 EmitLoadSuperConstructor(); | |
377 context.Plug(result_register()); | |
378 } else { | |
379 Visit(expr); | |
380 } | |
376 PrepareForBailout(expr, NO_REGISTERS); | 381 PrepareForBailout(expr, NO_REGISTERS); |
377 } | 382 } |
378 | 383 |
379 void VisitForControl(Expression* expr, | 384 void VisitForControl(Expression* expr, |
380 Label* if_true, | 385 Label* if_true, |
381 Label* if_false, | 386 Label* if_false, |
382 Label* fall_through) { | 387 Label* fall_through) { |
383 TestContext context(this, expr, if_true, if_false, fall_through); | 388 TestContext context(this, expr, if_true, if_false, fall_through); |
384 Visit(expr); | 389 Visit(expr); |
385 // For test contexts, we prepare for bailout before branching, not at | 390 // For test contexts, we prepare for bailout before branching, not at |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
652 static bool NeedsHomeObject(Expression* expr) { | 657 static bool NeedsHomeObject(Expression* expr) { |
653 return FunctionLiteral::NeedsHomeObject(expr); | 658 return FunctionLiteral::NeedsHomeObject(expr); |
654 } | 659 } |
655 | 660 |
656 // Adds the [[HomeObject]] to |initializer| if it is a FunctionLiteral. | 661 // Adds the [[HomeObject]] to |initializer| if it is a FunctionLiteral. |
657 // The value of the initializer is expected to be at the top of the stack. | 662 // The value of the initializer is expected to be at the top of the stack. |
658 // |offset| is the offset in the stack where the home object can be found. | 663 // |offset| is the offset in the stack where the home object can be found. |
659 void EmitSetHomeObjectIfNeeded(Expression* initializer, int offset); | 664 void EmitSetHomeObjectIfNeeded(Expression* initializer, int offset); |
660 | 665 |
661 void EmitLoadSuperConstructor(); | 666 void EmitLoadSuperConstructor(); |
667 void EmitInitializeThisAfterSuper(SuperReference* super_ref); | |
662 | 668 |
663 void CallIC(Handle<Code> code, | 669 void CallIC(Handle<Code> code, |
664 TypeFeedbackId id = TypeFeedbackId::None()); | 670 TypeFeedbackId id = TypeFeedbackId::None()); |
665 | 671 |
666 void CallLoadIC(ContextualMode mode, | 672 void CallLoadIC(ContextualMode mode, |
667 TypeFeedbackId id = TypeFeedbackId::None()); | 673 TypeFeedbackId id = TypeFeedbackId::None()); |
668 void CallGlobalLoadIC(Handle<String> name); | 674 void CallGlobalLoadIC(Handle<String> name); |
669 void CallStoreIC(TypeFeedbackId id = TypeFeedbackId::None()); | 675 void CallStoreIC(TypeFeedbackId id = TypeFeedbackId::None()); |
670 | 676 |
671 void SetFunctionPosition(FunctionLiteral* fun); | 677 void SetFunctionPosition(FunctionLiteral* fun); |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1060 | 1066 |
1061 Address start_; | 1067 Address start_; |
1062 Address instruction_start_; | 1068 Address instruction_start_; |
1063 uint32_t length_; | 1069 uint32_t length_; |
1064 }; | 1070 }; |
1065 | 1071 |
1066 | 1072 |
1067 } } // namespace v8::internal | 1073 } } // namespace v8::internal |
1068 | 1074 |
1069 #endif // V8_FULL_CODEGEN_H_ | 1075 #endif // V8_FULL_CODEGEN_H_ |
OLD | NEW |