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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 Expression* sub_expr, | 410 Expression* sub_expr, |
411 Handle<String> check); | 411 Handle<String> check); |
412 | 412 |
413 // Platform-specific code for equality comparison with a nil-like value. | 413 // Platform-specific code for equality comparison with a nil-like value. |
414 void EmitLiteralCompareNil(CompareOperation* expr, | 414 void EmitLiteralCompareNil(CompareOperation* expr, |
415 Expression* sub_expr, | 415 Expression* sub_expr, |
416 NilValue nil); | 416 NilValue nil); |
417 | 417 |
418 // Bailout support. | 418 // Bailout support. |
419 void PrepareForBailout(Expression* node, State state); | 419 void PrepareForBailout(Expression* node, State state); |
420 void PrepareForBailoutForId(unsigned id, State state); | 420 void PrepareForBailoutForId(BailoutId id, State state); |
421 | 421 |
422 // Cache cell support. This associates AST ids with global property cells | 422 // Cache cell support. This associates AST ids with global property cells |
423 // that will be cleared during GC and collected by the type-feedback oracle. | 423 // that will be cleared during GC and collected by the type-feedback oracle. |
424 void RecordTypeFeedbackCell(unsigned id, Handle<JSGlobalPropertyCell> cell); | 424 void RecordTypeFeedbackCell(TypeFeedbackId id, |
| 425 Handle<JSGlobalPropertyCell> cell); |
425 | 426 |
426 // Record a call's return site offset, used to rebuild the frame if the | 427 // Record a call's return site offset, used to rebuild the frame if the |
427 // called function was inlined at the site. | 428 // called function was inlined at the site. |
428 void RecordJSReturnSite(Call* call); | 429 void RecordJSReturnSite(Call* call); |
429 | 430 |
430 // Prepare for bailout before a test (or compare) and branch. If | 431 // Prepare for bailout before a test (or compare) and branch. If |
431 // should_normalize, then the following comparison will not handle the | 432 // should_normalize, then the following comparison will not handle the |
432 // canonical JS true value so we will insert a (dead) test against true at | 433 // canonical JS true value so we will insert a (dead) test against true at |
433 // the actual bailout target from the optimized code. If not | 434 // the actual bailout target from the optimized code. If not |
434 // should_normalize, the true and false labels are ignored. | 435 // should_normalize, the true and false labels are ignored. |
435 void PrepareForBailoutBeforeSplit(Expression* expr, | 436 void PrepareForBailoutBeforeSplit(Expression* expr, |
436 bool should_normalize, | 437 bool should_normalize, |
437 Label* if_true, | 438 Label* if_true, |
438 Label* if_false); | 439 Label* if_false); |
439 | 440 |
440 // If enabled, emit debug code for checking that the current context is | 441 // If enabled, emit debug code for checking that the current context is |
441 // neither a with nor a catch context. | 442 // neither a with nor a catch context. |
442 void EmitDebugCheckDeclarationContext(Variable* variable); | 443 void EmitDebugCheckDeclarationContext(Variable* variable); |
443 | 444 |
444 // Platform-specific code for checking the stack limit at the back edge of | 445 // Platform-specific code for checking the stack limit at the back edge of |
445 // a loop. | 446 // a loop. |
446 // This is meant to be called at loop back edges, |back_edge_target| is | 447 // This is meant to be called at loop back edges, |back_edge_target| is |
447 // the jump target of the back edge and is used to approximate the amount | 448 // the jump target of the back edge and is used to approximate the amount |
448 // of code inside the loop. | 449 // of code inside the loop. |
449 void EmitStackCheck(IterationStatement* stmt, Label* back_edge_target); | 450 void EmitStackCheck(IterationStatement* stmt, Label* back_edge_target); |
450 // Record the OSR AST id corresponding to a stack check in the code. | 451 // Record the OSR AST id corresponding to a stack check in the code. |
451 void RecordStackCheck(unsigned osr_ast_id); | 452 void RecordStackCheck(BailoutId osr_ast_id); |
452 // Emit a table of stack check ids and pcs into the code stream. Return | 453 // Emit a table of stack check ids and pcs into the code stream. Return |
453 // the offset of the start of the table. | 454 // the offset of the start of the table. |
454 unsigned EmitStackCheckTable(); | 455 unsigned EmitStackCheckTable(); |
455 | 456 |
456 void EmitProfilingCounterDecrement(int delta); | 457 void EmitProfilingCounterDecrement(int delta); |
457 void EmitProfilingCounterReset(); | 458 void EmitProfilingCounterReset(); |
458 | 459 |
459 // Platform-specific return sequence | 460 // Platform-specific return sequence |
460 void EmitReturnSequence(); | 461 void EmitReturnSequence(); |
461 | 462 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 // of the stack and the right-hand-side value in the accumulator. | 533 // of the stack and the right-hand-side value in the accumulator. |
533 void EmitNamedPropertyAssignment(Assignment* expr); | 534 void EmitNamedPropertyAssignment(Assignment* expr); |
534 | 535 |
535 // Complete a keyed property assignment. The receiver and key are | 536 // Complete a keyed property assignment. The receiver and key are |
536 // expected on top of the stack and the right-hand-side value in the | 537 // expected on top of the stack and the right-hand-side value in the |
537 // accumulator. | 538 // accumulator. |
538 void EmitKeyedPropertyAssignment(Assignment* expr); | 539 void EmitKeyedPropertyAssignment(Assignment* expr); |
539 | 540 |
540 void CallIC(Handle<Code> code, | 541 void CallIC(Handle<Code> code, |
541 RelocInfo::Mode rmode = RelocInfo::CODE_TARGET, | 542 RelocInfo::Mode rmode = RelocInfo::CODE_TARGET, |
542 unsigned ast_id = kNoASTId); | 543 TypeFeedbackId id = TypeFeedbackId::None()); |
543 | 544 |
544 void SetFunctionPosition(FunctionLiteral* fun); | 545 void SetFunctionPosition(FunctionLiteral* fun); |
545 void SetReturnPosition(FunctionLiteral* fun); | 546 void SetReturnPosition(FunctionLiteral* fun); |
546 void SetStatementPosition(Statement* stmt); | 547 void SetStatementPosition(Statement* stmt); |
547 void SetExpressionPosition(Expression* expr, int pos); | 548 void SetExpressionPosition(Expression* expr, int pos); |
548 void SetStatementPosition(int pos); | 549 void SetStatementPosition(int pos); |
549 void SetSourcePosition(int pos); | 550 void SetSourcePosition(int pos); |
550 | 551 |
551 // Non-local control flow support. | 552 // Non-local control flow support. |
552 void EnterFinallyBlock(); | 553 void EnterFinallyBlock(); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 void VisitForTypeofValue(Expression* expr); | 604 void VisitForTypeofValue(Expression* expr); |
604 | 605 |
605 void Generate(); | 606 void Generate(); |
606 void PopulateDeoptimizationData(Handle<Code> code); | 607 void PopulateDeoptimizationData(Handle<Code> code); |
607 void PopulateTypeFeedbackInfo(Handle<Code> code); | 608 void PopulateTypeFeedbackInfo(Handle<Code> code); |
608 void PopulateTypeFeedbackCells(Handle<Code> code); | 609 void PopulateTypeFeedbackCells(Handle<Code> code); |
609 | 610 |
610 Handle<FixedArray> handler_table() { return handler_table_; } | 611 Handle<FixedArray> handler_table() { return handler_table_; } |
611 | 612 |
612 struct BailoutEntry { | 613 struct BailoutEntry { |
613 unsigned id; | 614 BailoutId id; |
614 unsigned pc_and_state; | 615 unsigned pc_and_state; |
615 }; | 616 }; |
616 | 617 |
617 struct TypeFeedbackCellEntry { | 618 struct TypeFeedbackCellEntry { |
618 unsigned ast_id; | 619 TypeFeedbackId ast_id; |
619 Handle<JSGlobalPropertyCell> cell; | 620 Handle<JSGlobalPropertyCell> cell; |
620 }; | 621 }; |
621 | 622 |
622 | 623 |
623 class ExpressionContext BASE_EMBEDDED { | 624 class ExpressionContext BASE_EMBEDDED { |
624 public: | 625 public: |
625 explicit ExpressionContext(FullCodeGenerator* codegen) | 626 explicit ExpressionContext(FullCodeGenerator* codegen) |
626 : masm_(codegen->masm()), old_(codegen->context()), codegen_(codegen) { | 627 : masm_(codegen->masm()), old_(codegen->context()), codegen_(codegen) { |
627 codegen->set_new_context(this); | 628 codegen->set_new_context(this); |
628 } | 629 } |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 } | 838 } |
838 | 839 |
839 private: | 840 private: |
840 Zone* zone_; | 841 Zone* zone_; |
841 }; | 842 }; |
842 | 843 |
843 | 844 |
844 } } // namespace v8::internal | 845 } } // namespace v8::internal |
845 | 846 |
846 #endif // V8_FULL_CODEGEN_H_ | 847 #endif // V8_FULL_CODEGEN_H_ |
OLD | NEW |