OLD | NEW |
---|---|
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
438 // Load a value from a named property. | 438 // Load a value from a named property. |
439 // The receiver is left on the stack by the IC. | 439 // The receiver is left on the stack by the IC. |
440 void EmitNamedPropertyLoad(Property* expr); | 440 void EmitNamedPropertyLoad(Property* expr); |
441 | 441 |
442 // Load a value from a keyed property. | 442 // Load a value from a keyed property. |
443 // The receiver and the key is left on the stack by the IC. | 443 // The receiver and the key is left on the stack by the IC. |
444 void EmitKeyedPropertyLoad(Property* expr); | 444 void EmitKeyedPropertyLoad(Property* expr); |
445 | 445 |
446 // Apply the compound assignment operator. Expects the left operand on top | 446 // Apply the compound assignment operator. Expects the left operand on top |
447 // of the stack and the right one in the accumulator. | 447 // of the stack and the right one in the accumulator. |
448 void EmitBinaryOp(Token::Value op, | 448 void EmitBinaryOp(BinaryOperation* expr, |
449 Token::Value op, | |
449 OverwriteMode mode); | 450 OverwriteMode mode); |
450 | 451 |
451 // Helper functions for generating inlined smi code for certain | 452 // Helper functions for generating inlined smi code for certain |
452 // binary operations. | 453 // binary operations. |
453 void EmitInlineSmiBinaryOp(Expression* expr, | 454 void EmitInlineSmiBinaryOp(BinaryOperation* expr, |
454 Token::Value op, | 455 Token::Value op, |
455 OverwriteMode mode, | 456 OverwriteMode mode, |
456 Expression* left, | 457 Expression* left, |
457 Expression* right); | 458 Expression* right); |
458 | 459 |
459 // Assign to the given expression as if via '='. The right-hand-side value | 460 // Assign to the given expression as if via '='. The right-hand-side value |
460 // is expected in the accumulator. | 461 // is expected in the accumulator. |
461 void EmitAssignment(Expression* expr, int bailout_ast_id); | 462 void EmitAssignment(Expression* expr, int bailout_ast_id); |
462 | 463 |
463 // Complete a variable assignment. The right-hand-side value is expected | 464 // Complete a variable assignment. The right-hand-side value is expected |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
505 StrictModeFlag strict_mode_flag() { | 506 StrictModeFlag strict_mode_flag() { |
506 return is_strict_mode() ? kStrictMode : kNonStrictMode; | 507 return is_strict_mode() ? kStrictMode : kNonStrictMode; |
507 } | 508 } |
508 FunctionLiteral* function() { return info_->function(); } | 509 FunctionLiteral* function() { return info_->function(); } |
509 Scope* scope() { return info_->scope(); } | 510 Scope* scope() { return info_->scope(); } |
510 | 511 |
511 static Register result_register(); | 512 static Register result_register(); |
512 static Register context_register(); | 513 static Register context_register(); |
513 | 514 |
514 // Helper for calling an IC stub. | 515 // Helper for calling an IC stub. |
515 void EmitCallIC(Handle<Code> ic, RelocInfo::Mode mode); | 516 void EmitCallIC(Handle<Code> ic, |
fschneider
2011/04/15 12:27:14
I'd prefer a mandatory argument since forgetting t
| |
517 RelocInfo::Mode mode, | |
518 unsigned ast_id = AstNode::kNoNumber); | |
516 | 519 |
517 // Calling an IC stub with a patch site. Passing NULL for patch_site | 520 // Calling an IC stub with a patch site. Passing NULL for patch_site |
518 // or non NULL patch_site which is not activated indicates no inlined smi code | 521 // or non NULL patch_site which is not activated indicates no inlined smi code |
519 // and emits a nop after the IC call. | 522 // and emits a nop after the IC call. |
520 void EmitCallIC(Handle<Code> ic, JumpPatchSite* patch_site); | 523 void EmitCallIC(Handle<Code> ic, |
fschneider
2011/04/15 12:27:14
Same here.
| |
524 JumpPatchSite* patch_site, | |
525 unsigned ast_id = AstNode::kNoNumber); | |
521 | 526 |
522 // Set fields in the stack frame. Offsets are the frame pointer relative | 527 // Set fields in the stack frame. Offsets are the frame pointer relative |
523 // offsets defined in, e.g., StandardFrameConstants. | 528 // offsets defined in, e.g., StandardFrameConstants. |
524 void StoreToFrameField(int frame_offset, Register value); | 529 void StoreToFrameField(int frame_offset, Register value); |
525 | 530 |
526 // Load a value from the current context. Indices are defined as an enum | 531 // Load a value from the current context. Indices are defined as an enum |
527 // in v8::internal::Context. | 532 // in v8::internal::Context. |
528 void LoadContextField(Register dst, int context_index); | 533 void LoadContextField(Register dst, int context_index); |
529 | 534 |
530 // AST node visit functions. | 535 // AST node visit functions. |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
744 | 749 |
745 friend class NestedStatement; | 750 friend class NestedStatement; |
746 | 751 |
747 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); | 752 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); |
748 }; | 753 }; |
749 | 754 |
750 | 755 |
751 } } // namespace v8::internal | 756 } } // namespace v8::internal |
752 | 757 |
753 #endif // V8_FULL_CODEGEN_H_ | 758 #endif // V8_FULL_CODEGEN_H_ |
OLD | NEW |