| 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_FULL_CODEGEN_H_ | 5 #ifndef V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
| 6 #define V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 6 #define V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
| 10 #include "src/ast.h" | 10 #include "src/ast.h" |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 // Platform-specific code for loading variables. | 545 // Platform-specific code for loading variables. |
| 546 void EmitLoadGlobalCheckExtensions(VariableProxy* proxy, | 546 void EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
| 547 TypeofMode typeof_mode, Label* slow); | 547 TypeofMode typeof_mode, Label* slow); |
| 548 MemOperand ContextSlotOperandCheckExtensions(Variable* var, Label* slow); | 548 MemOperand ContextSlotOperandCheckExtensions(Variable* var, Label* slow); |
| 549 void EmitDynamicLookupFastCase(VariableProxy* proxy, TypeofMode typeof_mode, | 549 void EmitDynamicLookupFastCase(VariableProxy* proxy, TypeofMode typeof_mode, |
| 550 Label* slow, Label* done); | 550 Label* slow, Label* done); |
| 551 void EmitGlobalVariableLoad(VariableProxy* proxy, TypeofMode typeof_mode); | 551 void EmitGlobalVariableLoad(VariableProxy* proxy, TypeofMode typeof_mode); |
| 552 void EmitVariableLoad(VariableProxy* proxy, | 552 void EmitVariableLoad(VariableProxy* proxy, |
| 553 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); | 553 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); |
| 554 | 554 |
| 555 void EmitAccessor(Expression* expression); | 555 void EmitAccessor(ObjectLiteralProperty* property); |
| 556 | 556 |
| 557 bool NeedsHoleCheckForLoad(VariableProxy* proxy); | 557 bool NeedsHoleCheckForLoad(VariableProxy* proxy); |
| 558 | 558 |
| 559 // Expects the arguments and the function already pushed. | 559 // Expects the arguments and the function already pushed. |
| 560 void EmitResolvePossiblyDirectEval(int arg_count); | 560 void EmitResolvePossiblyDirectEval(int arg_count); |
| 561 | 561 |
| 562 // Platform-specific support for allocating a new closure based on | 562 // Platform-specific support for allocating a new closure based on |
| 563 // the given function info. | 563 // the given function info. |
| 564 void EmitNewClosure(Handle<SharedFunctionInfo> info, bool pretenure); | 564 void EmitNewClosure(Handle<SharedFunctionInfo> info, bool pretenure); |
| 565 | 565 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 579 // Expect receiver ('this' value), home_object and key on the stack. | 579 // Expect receiver ('this' value), home_object and key on the stack. |
| 580 void EmitKeyedSuperPropertyLoad(Property* expr); | 580 void EmitKeyedSuperPropertyLoad(Property* expr); |
| 581 | 581 |
| 582 // Load a value from a keyed property. | 582 // Load a value from a keyed property. |
| 583 // The receiver and the key is left on the stack by the IC. | 583 // The receiver and the key is left on the stack by the IC. |
| 584 void EmitKeyedPropertyLoad(Property* expr); | 584 void EmitKeyedPropertyLoad(Property* expr); |
| 585 | 585 |
| 586 // Adds the properties to the class (function) object and to its prototype. | 586 // Adds the properties to the class (function) object and to its prototype. |
| 587 // Expects the class (function) in the accumulator. The class (function) is | 587 // Expects the class (function) in the accumulator. The class (function) is |
| 588 // in the accumulator after installing all the properties. | 588 // in the accumulator after installing all the properties. |
| 589 void EmitClassDefineProperties(ClassLiteral* lit, int* used_store_slots); | 589 void EmitClassDefineProperties(ClassLiteral* lit); |
| 590 | 590 |
| 591 // Pushes the property key as a Name on the stack. | 591 // Pushes the property key as a Name on the stack. |
| 592 void EmitPropertyKey(ObjectLiteralProperty* property, BailoutId bailout_id); | 592 void EmitPropertyKey(ObjectLiteralProperty* property, BailoutId bailout_id); |
| 593 | 593 |
| 594 // Apply the compound assignment operator. Expects the left operand on top | 594 // Apply the compound assignment operator. Expects the left operand on top |
| 595 // of the stack and the right one in the accumulator. | 595 // of the stack and the right one in the accumulator. |
| 596 void EmitBinaryOp(BinaryOperation* expr, Token::Value op); | 596 void EmitBinaryOp(BinaryOperation* expr, Token::Value op); |
| 597 | 597 |
| 598 // Helper functions for generating inlined smi code for certain | 598 // Helper functions for generating inlined smi code for certain |
| 599 // binary operations. | 599 // binary operations. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 // accumulator. | 633 // accumulator. |
| 634 void EmitKeyedPropertyAssignment(Assignment* expr); | 634 void EmitKeyedPropertyAssignment(Assignment* expr); |
| 635 | 635 |
| 636 static bool NeedsHomeObject(Expression* expr) { | 636 static bool NeedsHomeObject(Expression* expr) { |
| 637 return FunctionLiteral::NeedsHomeObject(expr); | 637 return FunctionLiteral::NeedsHomeObject(expr); |
| 638 } | 638 } |
| 639 | 639 |
| 640 // Adds the [[HomeObject]] to |initializer| if it is a FunctionLiteral. | 640 // Adds the [[HomeObject]] to |initializer| if it is a FunctionLiteral. |
| 641 // The value of the initializer is expected to be at the top of the stack. | 641 // The value of the initializer is expected to be at the top of the stack. |
| 642 // |offset| is the offset in the stack where the home object can be found. | 642 // |offset| is the offset in the stack where the home object can be found. |
| 643 void EmitSetHomeObjectIfNeeded( | 643 void EmitSetHomeObject(Expression* initializer, int offset, |
| 644 Expression* initializer, int offset, | 644 FeedbackVectorICSlot slot); |
| 645 FeedbackVectorICSlot slot = FeedbackVectorICSlot::Invalid()); | 645 |
| 646 void EmitSetHomeObjectAccumulator(Expression* initializer, int offset, |
| 647 FeedbackVectorICSlot slot); |
| 646 | 648 |
| 647 void EmitLoadSuperConstructor(SuperCallReference* super_call_ref); | 649 void EmitLoadSuperConstructor(SuperCallReference* super_call_ref); |
| 648 | 650 |
| 649 void CallIC(Handle<Code> code, | 651 void CallIC(Handle<Code> code, |
| 650 TypeFeedbackId id = TypeFeedbackId::None()); | 652 TypeFeedbackId id = TypeFeedbackId::None()); |
| 651 | 653 |
| 652 // Inside typeof reference errors are never thrown. | 654 // Inside typeof reference errors are never thrown. |
| 653 void CallLoadIC(TypeofMode typeof_mode, LanguageMode language_mode = SLOPPY, | 655 void CallLoadIC(TypeofMode typeof_mode, LanguageMode language_mode = SLOPPY, |
| 654 TypeFeedbackId id = TypeFeedbackId::None()); | 656 TypeFeedbackId id = TypeFeedbackId::None()); |
| 655 void CallStoreIC(TypeFeedbackId id = TypeFeedbackId::None()); | 657 void CallStoreIC(TypeFeedbackId id = TypeFeedbackId::None()); |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 | 1084 |
| 1083 Address start_; | 1085 Address start_; |
| 1084 Address instruction_start_; | 1086 Address instruction_start_; |
| 1085 uint32_t length_; | 1087 uint32_t length_; |
| 1086 }; | 1088 }; |
| 1087 | 1089 |
| 1088 | 1090 |
| 1089 } } // namespace v8::internal | 1091 } } // namespace v8::internal |
| 1090 | 1092 |
| 1091 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 1093 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
| OLD | NEW |