Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: src/compiler.cc

Issue 300037: Fast compiler support for regexp literals.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/fast-codegen-arm.cc ('k') | src/fast-codegen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 CodeGenSelector::CodeGenTag CodeGenSelector::Select(FunctionLiteral* fun) { 451 CodeGenSelector::CodeGenTag CodeGenSelector::Select(FunctionLiteral* fun) {
452 Scope* scope = fun->scope(); 452 Scope* scope = fun->scope();
453 453
454 if (!scope->is_global_scope()) { 454 if (!scope->is_global_scope()) {
455 if (FLAG_trace_bailout) PrintF("Non-global scope\n"); 455 if (FLAG_trace_bailout) PrintF("Non-global scope\n");
456 return NORMAL; 456 return NORMAL;
457 } 457 }
458 ASSERT(scope->num_heap_slots() == 0); 458 ASSERT(scope->num_heap_slots() == 0);
459 ASSERT(scope->arguments() == NULL); 459 ASSERT(scope->arguments() == NULL);
460 460
461 if (fun->materialized_literal_count() > 0) {
462 if (FLAG_trace_bailout) PrintF("Unsupported literal\n");
463 return NORMAL;
464 }
465
466 has_supported_syntax_ = true; 461 has_supported_syntax_ = true;
467 VisitDeclarations(fun->scope()->declarations()); 462 VisitDeclarations(fun->scope()->declarations());
468 if (!has_supported_syntax_) return NORMAL; 463 if (!has_supported_syntax_) return NORMAL;
469 464
470 VisitStatements(fun->body()); 465 VisitStatements(fun->body());
471 return has_supported_syntax_ ? FAST : NORMAL; 466 return has_supported_syntax_ ? FAST : NORMAL;
472 } 467 }
473 468
474 469
475 #define BAILOUT(reason) \ 470 #define BAILOUT(reason) \
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 } 627 }
633 628
634 629
635 void CodeGenSelector::VisitLiteral(Literal* expr) { 630 void CodeGenSelector::VisitLiteral(Literal* expr) {
636 // All literals are supported. 631 // All literals are supported.
637 expr->set_location(Location::Constant()); 632 expr->set_location(Location::Constant());
638 } 633 }
639 634
640 635
641 void CodeGenSelector::VisitRegExpLiteral(RegExpLiteral* expr) { 636 void CodeGenSelector::VisitRegExpLiteral(RegExpLiteral* expr) {
642 BAILOUT("RegExpLiteral"); 637 // RegexpLiterals are supported.
643 } 638 }
644 639
645 640
646 void CodeGenSelector::VisitObjectLiteral(ObjectLiteral* expr) { 641 void CodeGenSelector::VisitObjectLiteral(ObjectLiteral* expr) {
647 BAILOUT("ObjectLiteral"); 642 BAILOUT("ObjectLiteral");
648 } 643 }
649 644
650 645
651 void CodeGenSelector::VisitArrayLiteral(ArrayLiteral* expr) { 646 void CodeGenSelector::VisitArrayLiteral(ArrayLiteral* expr) {
652 BAILOUT("ArrayLiteral"); 647 BAILOUT("ArrayLiteral");
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 754
760 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { 755 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) {
761 BAILOUT("ThisFunction"); 756 BAILOUT("ThisFunction");
762 } 757 }
763 758
764 #undef BAILOUT 759 #undef BAILOUT
765 #undef CHECK_BAILOUT 760 #undef CHECK_BAILOUT
766 761
767 762
768 } } // namespace v8::internal 763 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/fast-codegen-arm.cc ('k') | src/fast-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698