OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 // the code generator is being transformed. | 364 // the code generator is being transformed. |
365 void VisitAndSpill(Statement* statement); | 365 void VisitAndSpill(Statement* statement); |
366 | 366 |
367 // Visit a list of statements and then spill the virtual frame if control | 367 // Visit a list of statements and then spill the virtual frame if control |
368 // flow can reach the end of the list. | 368 // flow can reach the end of the list. |
369 void VisitStatementsAndSpill(ZoneList<Statement*>* statements); | 369 void VisitStatementsAndSpill(ZoneList<Statement*>* statements); |
370 | 370 |
371 // Main code generation function | 371 // Main code generation function |
372 void GenCode(FunctionLiteral* fun); | 372 void GenCode(FunctionLiteral* fun); |
373 | 373 |
374 // Generate the return sequence code. Should be called no more than once | 374 // Generate the return sequence code. Should be called no more than |
375 // per compiled function (it binds the return target, which can not be | 375 // once per compiled function, immediately after binding the return |
376 // done more than once). The return value is assumed to be in eax by the | 376 // target (which can not be done more than once). |
377 // code generated. | 377 void GenerateReturnSequence(Result* return_value); |
378 void GenerateReturnSequence(); | |
379 | 378 |
380 // The following are used by class Reference. | 379 // The following are used by class Reference. |
381 void LoadReference(Reference* ref); | 380 void LoadReference(Reference* ref); |
382 void UnloadReference(Reference* ref); | 381 void UnloadReference(Reference* ref); |
383 | 382 |
384 Operand ContextOperand(Register context, int index) const { | 383 Operand ContextOperand(Register context, int index) const { |
385 return Operand(context, Context::SlotOffset(index)); | 384 return Operand(context, Context::SlotOffset(index)); |
386 } | 385 } |
387 | 386 |
388 Operand SlotOperand(Slot* slot, Register tmp); | 387 Operand SlotOperand(Slot* slot, Register tmp); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 | 559 |
561 // Fast support for constant-Smi switches. Tests whether switch statement | 560 // Fast support for constant-Smi switches. Tests whether switch statement |
562 // permits optimization and calls GenerateFastCaseSwitch if it does. | 561 // permits optimization and calls GenerateFastCaseSwitch if it does. |
563 // Returns true if the fast-case switch was generated, and false if not. | 562 // Returns true if the fast-case switch was generated, and false if not. |
564 bool TryGenerateFastCaseSwitchStatement(SwitchStatement* node); | 563 bool TryGenerateFastCaseSwitchStatement(SwitchStatement* node); |
565 | 564 |
566 // Methods used to indicate which source code is generated for. Source | 565 // Methods used to indicate which source code is generated for. Source |
567 // positions are collected by the assembler and emitted with the relocation | 566 // positions are collected by the assembler and emitted with the relocation |
568 // information. | 567 // information. |
569 void CodeForFunctionPosition(FunctionLiteral* fun); | 568 void CodeForFunctionPosition(FunctionLiteral* fun); |
| 569 void CodeForReturnPosition(FunctionLiteral* fun); |
570 void CodeForStatementPosition(Node* node); | 570 void CodeForStatementPosition(Node* node); |
571 void CodeForSourcePosition(int pos); | 571 void CodeForSourcePosition(int pos); |
572 | 572 |
573 #ifdef DEBUG | 573 #ifdef DEBUG |
574 // True if the registers are valid for entry to a block. There should be | 574 // True if the registers are valid for entry to a block. There should be |
575 // no frame-external references to eax, ebx, ecx, edx, or edi. | 575 // no frame-external references to eax, ebx, ecx, edx, or edi. |
576 bool HasValidEntryRegisters(); | 576 bool HasValidEntryRegisters(); |
577 #endif | 577 #endif |
578 | 578 |
579 bool is_eval_; // Tells whether code is generated for eval. | 579 bool is_eval_; // Tells whether code is generated for eval. |
(...skipping 30 matching lines...) Expand all Loading... |
610 friend class Reference; | 610 friend class Reference; |
611 friend class Result; | 611 friend class Result; |
612 | 612 |
613 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | 613 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
614 }; | 614 }; |
615 | 615 |
616 | 616 |
617 } } // namespace v8::internal | 617 } } // namespace v8::internal |
618 | 618 |
619 #endif // V8_CODEGEN_IA32_H_ | 619 #endif // V8_CODEGEN_IA32_H_ |
OLD | NEW |