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