| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 20 matching lines...) Expand all Loading... |
| 31 #include "v8.h" | 31 #include "v8.h" |
| 32 | 32 |
| 33 #include "ast.h" | 33 #include "ast.h" |
| 34 #include "code-stubs.h" | 34 #include "code-stubs.h" |
| 35 #include "codegen.h" | 35 #include "codegen.h" |
| 36 #include "compiler.h" | 36 #include "compiler.h" |
| 37 | 37 |
| 38 namespace v8 { | 38 namespace v8 { |
| 39 namespace internal { | 39 namespace internal { |
| 40 | 40 |
| 41 // Forward declarations. | |
| 42 class JumpPatchSite; | |
| 43 | |
| 44 // AST node visitor which can tell whether a given statement will be breakable | 41 // AST node visitor which can tell whether a given statement will be breakable |
| 45 // when the code is compiled by the full compiler in the debugger. This means | 42 // when the code is compiled by the full compiler in the debugger. This means |
| 46 // that there will be an IC (load/store/call) in the code generated for the | 43 // that there will be an IC (load/store/call) in the code generated for the |
| 47 // debugger to piggybag on. | 44 // debugger to piggybag on. |
| 48 class BreakableStatementChecker: public AstVisitor { | 45 class BreakableStatementChecker: public AstVisitor { |
| 49 public: | 46 public: |
| 50 BreakableStatementChecker() : is_breakable_(false) {} | 47 BreakableStatementChecker() : is_breakable_(false) {} |
| 51 | 48 |
| 52 void Check(Statement* stmt); | 49 void Check(Statement* stmt); |
| 53 void Check(Expression* stmt); | 50 void Check(Expression* stmt); |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 bool is_eval() { return info_->is_eval(); } | 526 bool is_eval() { return info_->is_eval(); } |
| 530 FunctionLiteral* function() { return info_->function(); } | 527 FunctionLiteral* function() { return info_->function(); } |
| 531 Scope* scope() { return info_->scope(); } | 528 Scope* scope() { return info_->scope(); } |
| 532 | 529 |
| 533 static Register result_register(); | 530 static Register result_register(); |
| 534 static Register context_register(); | 531 static Register context_register(); |
| 535 | 532 |
| 536 // Helper for calling an IC stub. | 533 // Helper for calling an IC stub. |
| 537 void EmitCallIC(Handle<Code> ic, RelocInfo::Mode mode); | 534 void EmitCallIC(Handle<Code> ic, RelocInfo::Mode mode); |
| 538 | 535 |
| 539 // Calling an IC stub with a patch site. Passing NULL for patch_site | |
| 540 // indicates no inlined smi code and emits a nop after the IC call. | |
| 541 void EmitCallIC(Handle<Code> ic, JumpPatchSite* patch_site); | |
| 542 | |
| 543 // Set fields in the stack frame. Offsets are the frame pointer relative | 536 // Set fields in the stack frame. Offsets are the frame pointer relative |
| 544 // offsets defined in, e.g., StandardFrameConstants. | 537 // offsets defined in, e.g., StandardFrameConstants. |
| 545 void StoreToFrameField(int frame_offset, Register value); | 538 void StoreToFrameField(int frame_offset, Register value); |
| 546 | 539 |
| 547 // Load a value from the current context. Indices are defined as an enum | 540 // Load a value from the current context. Indices are defined as an enum |
| 548 // in v8::internal::Context. | 541 // in v8::internal::Context. |
| 549 void LoadContextField(Register dst, int context_index); | 542 void LoadContextField(Register dst, int context_index); |
| 550 | 543 |
| 551 // AST node visit functions. | 544 // AST node visit functions. |
| 552 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); | 545 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 | 756 |
| 764 friend class NestedStatement; | 757 friend class NestedStatement; |
| 765 | 758 |
| 766 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); | 759 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); |
| 767 }; | 760 }; |
| 768 | 761 |
| 769 | 762 |
| 770 } } // namespace v8::internal | 763 } } // namespace v8::internal |
| 771 | 764 |
| 772 #endif // V8_FULL_CODEGEN_H_ | 765 #endif // V8_FULL_CODEGEN_H_ |
| OLD | NEW |