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