| 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 // Emit code to pop values from the stack associated with nested statements | 476 // Emit code to pop values from the stack associated with nested statements |
| 477 // like try/catch, try/finally, etc, running the finallies and unwinding the | 477 // like try/catch, try/finally, etc, running the finallies and unwinding the |
| 478 // handlers as needed. | 478 // handlers as needed. |
| 479 void EmitUnwindBeforeReturn(); | 479 void EmitUnwindBeforeReturn(); |
| 480 | 480 |
| 481 // Platform-specific return sequence | 481 // Platform-specific return sequence |
| 482 void EmitReturnSequence(); | 482 void EmitReturnSequence(); |
| 483 | 483 |
| 484 // Platform-specific code sequences for calls | 484 // Platform-specific code sequences for calls |
| 485 void EmitCallWithStub(Call* expr, CallFunctionFlags flags); | 485 void EmitCallWithStub(Call* expr, CallFunctionFlags flags); |
| 486 void EmitCallWithIC(Call* expr, Handle<Object> name, RelocInfo::Mode mode); | 486 void EmitCallWithIC(Call* expr, Handle<Object> name, ContextualMode mode); |
| 487 void EmitKeyedCallWithIC(Call* expr, Expression* key); | 487 void EmitKeyedCallWithIC(Call* expr, Expression* key); |
| 488 | 488 |
| 489 // Platform-specific code for inline runtime calls. | 489 // Platform-specific code for inline runtime calls. |
| 490 InlineFunctionGenerator FindInlineFunctionGenerator(Runtime::FunctionId id); | 490 InlineFunctionGenerator FindInlineFunctionGenerator(Runtime::FunctionId id); |
| 491 | 491 |
| 492 void EmitInlineRuntimeCall(CallRuntime* expr); | 492 void EmitInlineRuntimeCall(CallRuntime* expr); |
| 493 | 493 |
| 494 #define EMIT_INLINE_RUNTIME_CALL(name, x, y) \ | 494 #define EMIT_INLINE_RUNTIME_CALL(name, x, y) \ |
| 495 void Emit##name(CallRuntime* expr); | 495 void Emit##name(CallRuntime* expr); |
| 496 INLINE_FUNCTION_LIST(EMIT_INLINE_RUNTIME_CALL) | 496 INLINE_FUNCTION_LIST(EMIT_INLINE_RUNTIME_CALL) |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 // Complete a named property assignment. The receiver is expected on top | 558 // Complete a named property assignment. The receiver is expected on top |
| 559 // of the stack and the right-hand-side value in the accumulator. | 559 // of the stack and the right-hand-side value in the accumulator. |
| 560 void EmitNamedPropertyAssignment(Assignment* expr); | 560 void EmitNamedPropertyAssignment(Assignment* expr); |
| 561 | 561 |
| 562 // Complete a keyed property assignment. The receiver and key are | 562 // Complete a keyed property assignment. The receiver and key are |
| 563 // expected on top of the stack and the right-hand-side value in the | 563 // expected on top of the stack and the right-hand-side value in the |
| 564 // accumulator. | 564 // accumulator. |
| 565 void EmitKeyedPropertyAssignment(Assignment* expr); | 565 void EmitKeyedPropertyAssignment(Assignment* expr); |
| 566 | 566 |
| 567 void CallIC(Handle<Code> code, | 567 void CallIC(Handle<Code> code, |
| 568 RelocInfo::Mode rmode = RelocInfo::CODE_TARGET, | 568 ContextualMode mode = NOT_CONTEXTUAL, |
| 569 TypeFeedbackId id = TypeFeedbackId::None()); | 569 TypeFeedbackId id = TypeFeedbackId::None()); |
| 570 | 570 |
| 571 void CallLoadIC(ContextualMode mode, |
| 572 TypeFeedbackId id = TypeFeedbackId::None()); |
| 573 void CallStoreIC(ContextualMode mode, |
| 574 TypeFeedbackId id = TypeFeedbackId::None()); |
| 575 |
| 571 void SetFunctionPosition(FunctionLiteral* fun); | 576 void SetFunctionPosition(FunctionLiteral* fun); |
| 572 void SetReturnPosition(FunctionLiteral* fun); | 577 void SetReturnPosition(FunctionLiteral* fun); |
| 573 void SetStatementPosition(Statement* stmt); | 578 void SetStatementPosition(Statement* stmt); |
| 574 void SetExpressionPosition(Expression* expr); | 579 void SetExpressionPosition(Expression* expr); |
| 575 void SetStatementPosition(int pos); | 580 void SetStatementPosition(int pos); |
| 576 void SetSourcePosition(int pos); | 581 void SetSourcePosition(int pos); |
| 577 | 582 |
| 578 // Non-local control flow support. | 583 // Non-local control flow support. |
| 579 void EnterFinallyBlock(); | 584 void EnterFinallyBlock(); |
| 580 void ExitFinallyBlock(); | 585 void ExitFinallyBlock(); |
| 581 | 586 |
| 582 // Loop nesting counter. | 587 // Loop nesting counter. |
| 583 int loop_depth() { return loop_depth_; } | 588 int loop_depth() { return loop_depth_; } |
| 584 void increment_loop_depth() { loop_depth_++; } | 589 void increment_loop_depth() { loop_depth_++; } |
| 585 void decrement_loop_depth() { | 590 void decrement_loop_depth() { |
| 586 ASSERT(loop_depth_ > 0); | 591 ASSERT(loop_depth_ > 0); |
| 587 loop_depth_--; | 592 loop_depth_--; |
| 588 } | 593 } |
| 589 | 594 |
| 590 MacroAssembler* masm() { return masm_; } | 595 MacroAssembler* masm() { return masm_; } |
| 591 | 596 |
| 592 class ExpressionContext; | 597 class ExpressionContext; |
| 593 const ExpressionContext* context() { return context_; } | 598 const ExpressionContext* context() { return context_; } |
| 594 void set_new_context(const ExpressionContext* context) { context_ = context; } | 599 void set_new_context(const ExpressionContext* context) { context_ = context; } |
| 595 | 600 |
| 596 Handle<Script> script() { return info_->script(); } | 601 Handle<Script> script() { return info_->script(); } |
| 597 bool is_eval() { return info_->is_eval(); } | 602 bool is_eval() { return info_->is_eval(); } |
| 598 bool is_native() { return info_->is_native(); } | 603 bool is_native() { return info_->is_native(); } |
| 599 bool is_classic_mode() { return language_mode() == CLASSIC_MODE; } | 604 bool is_classic_mode() { return language_mode() == CLASSIC_MODE; } |
| 605 StrictModeFlag strict_mode() { |
| 606 return is_classic_mode() ? kNonStrictMode : kStrictMode; |
| 607 } |
| 600 LanguageMode language_mode() { return function()->language_mode(); } | 608 LanguageMode language_mode() { return function()->language_mode(); } |
| 601 FunctionLiteral* function() { return info_->function(); } | 609 FunctionLiteral* function() { return info_->function(); } |
| 602 Scope* scope() { return scope_; } | 610 Scope* scope() { return scope_; } |
| 603 | 611 |
| 604 static Register result_register(); | 612 static Register result_register(); |
| 605 static Register context_register(); | 613 static Register context_register(); |
| 606 | 614 |
| 607 // Set fields in the stack frame. Offsets are the frame pointer relative | 615 // Set fields in the stack frame. Offsets are the frame pointer relative |
| 608 // offsets defined in, e.g., StandardFrameConstants. | 616 // offsets defined in, e.g., StandardFrameConstants. |
| 609 void StoreToFrameField(int frame_offset, Register value); | 617 void StoreToFrameField(int frame_offset, Register value); |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 | 967 |
| 960 Address start_; | 968 Address start_; |
| 961 Address instruction_start_; | 969 Address instruction_start_; |
| 962 uint32_t length_; | 970 uint32_t length_; |
| 963 }; | 971 }; |
| 964 | 972 |
| 965 | 973 |
| 966 } } // namespace v8::internal | 974 } } // namespace v8::internal |
| 967 | 975 |
| 968 #endif // V8_FULL_CODEGEN_H_ | 976 #endif // V8_FULL_CODEGEN_H_ |
| OLD | NEW |