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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 // Prepare for bailout before a test (or compare) and branch. If | 411 // Prepare for bailout before a test (or compare) and branch. If |
412 // should_normalize, then the following comparison will not handle the | 412 // should_normalize, then the following comparison will not handle the |
413 // canonical JS true value so we will insert a (dead) test against true at | 413 // canonical JS true value so we will insert a (dead) test against true at |
414 // the actual bailout target from the optimized code. If not | 414 // the actual bailout target from the optimized code. If not |
415 // should_normalize, the true and false labels are ignored. | 415 // should_normalize, the true and false labels are ignored. |
416 void PrepareForBailoutBeforeSplit(Expression* expr, | 416 void PrepareForBailoutBeforeSplit(Expression* expr, |
417 bool should_normalize, | 417 bool should_normalize, |
418 Label* if_true, | 418 Label* if_true, |
419 Label* if_false); | 419 Label* if_false); |
420 | 420 |
421 // Platform-specific code for a variable, constant, or function | 421 // If enabled, emit debug code for checking that the current context is |
422 // declaration. Functions have an initial value. | 422 // neither a with nor a catch context. |
423 // Increments global_count_ for unallocated variables. | 423 void EmitDebugCheckDeclarationContext(Variable* variable); |
424 void EmitDeclaration(VariableProxy* proxy, | |
425 VariableMode mode, | |
426 FunctionLiteral* function); | |
427 | 424 |
428 // Platform-specific code for checking the stack limit at the back edge of | 425 // Platform-specific code for checking the stack limit at the back edge of |
429 // a loop. | 426 // a loop. |
430 // This is meant to be called at loop back edges, |back_edge_target| is | 427 // This is meant to be called at loop back edges, |back_edge_target| is |
431 // the jump target of the back edge and is used to approximate the amount | 428 // the jump target of the back edge and is used to approximate the amount |
432 // of code inside the loop. | 429 // of code inside the loop. |
433 void EmitStackCheck(IterationStatement* stmt, Label* back_edge_target); | 430 void EmitStackCheck(IterationStatement* stmt, Label* back_edge_target); |
434 // Record the OSR AST id corresponding to a stack check in the code. | 431 // Record the OSR AST id corresponding to a stack check in the code. |
435 void RecordStackCheck(unsigned osr_ast_id); | 432 void RecordStackCheck(unsigned osr_ast_id); |
436 // Emit a table of stack check ids and pcs into the code stream. Return | 433 // Emit a table of stack check ids and pcs into the code stream. Return |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 | 541 |
545 MacroAssembler* masm() { return masm_; } | 542 MacroAssembler* masm() { return masm_; } |
546 | 543 |
547 class ExpressionContext; | 544 class ExpressionContext; |
548 const ExpressionContext* context() { return context_; } | 545 const ExpressionContext* context() { return context_; } |
549 void set_new_context(const ExpressionContext* context) { context_ = context; } | 546 void set_new_context(const ExpressionContext* context) { context_ = context; } |
550 | 547 |
551 Handle<Script> script() { return info_->script(); } | 548 Handle<Script> script() { return info_->script(); } |
552 bool is_eval() { return info_->is_eval(); } | 549 bool is_eval() { return info_->is_eval(); } |
553 bool is_native() { return info_->is_native(); } | 550 bool is_native() { return info_->is_native(); } |
554 bool is_classic_mode() { | 551 bool is_classic_mode() { return language_mode() == CLASSIC_MODE; } |
555 return language_mode() == CLASSIC_MODE; | 552 LanguageMode language_mode() { return function()->language_mode(); } |
556 } | |
557 LanguageMode language_mode() { | |
558 return function()->language_mode(); | |
559 } | |
560 FunctionLiteral* function() { return info_->function(); } | 553 FunctionLiteral* function() { return info_->function(); } |
561 Scope* scope() { return scope_; } | 554 Scope* scope() { return scope_; } |
562 | 555 |
563 static Register result_register(); | 556 static Register result_register(); |
564 static Register context_register(); | 557 static Register context_register(); |
565 | 558 |
566 // Set fields in the stack frame. Offsets are the frame pointer relative | 559 // Set fields in the stack frame. Offsets are the frame pointer relative |
567 // offsets defined in, e.g., StandardFrameConstants. | 560 // offsets defined in, e.g., StandardFrameConstants. |
568 void StoreToFrameField(int frame_offset, Register value); | 561 void StoreToFrameField(int frame_offset, Register value); |
569 | 562 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 | 793 |
801 friend class NestedStatement; | 794 friend class NestedStatement; |
802 | 795 |
803 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); | 796 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); |
804 }; | 797 }; |
805 | 798 |
806 | 799 |
807 } } // namespace v8::internal | 800 } } // namespace v8::internal |
808 | 801 |
809 #endif // V8_FULL_CODEGEN_H_ | 802 #endif // V8_FULL_CODEGEN_H_ |
OLD | NEW |