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

Side by Side Diff: src/compiler.cc

Issue 553149: Implement simple fast-path code for functions containing this property stores and global variables. (Closed)
Patch Set: Incorporated codereview comments. Created 10 years, 10 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
« no previous file with comments | « src/compiler.h ('k') | src/data-flow.h » ('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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 FullCodeGenSyntaxChecker checker; 105 FullCodeGenSyntaxChecker checker;
106 checker.Check(literal); 106 checker.Check(literal);
107 if (checker.has_supported_syntax()) { 107 if (checker.has_supported_syntax()) {
108 return FullCodeGenerator::MakeCode(literal, script, is_eval); 108 return FullCodeGenerator::MakeCode(literal, script, is_eval);
109 } 109 }
110 } else if (FLAG_always_fast_compiler || 110 } else if (FLAG_always_fast_compiler ||
111 (FLAG_fast_compiler && !is_run_once)) { 111 (FLAG_fast_compiler && !is_run_once)) {
112 FastCodeGenSyntaxChecker checker; 112 FastCodeGenSyntaxChecker checker;
113 checker.Check(literal, info); 113 checker.Check(literal, info);
114 if (checker.has_supported_syntax()) { 114 if (checker.has_supported_syntax()) {
115 // Does not yet generate code. 115 return FastCodeGenerator::MakeCode(literal, script, is_eval, info);
116 FastCodeGenerator::MakeCode(literal, script, is_eval, info);
117 } 116 }
118 } 117 }
119 118
120 return CodeGenerator::MakeCode(literal, script, is_eval, info); 119 return CodeGenerator::MakeCode(literal, script, is_eval, info);
121 } 120 }
122 121
123 122
124 static Handle<JSFunction> MakeFunction(bool is_global, 123 static Handle<JSFunction> MakeFunction(bool is_global,
125 bool is_eval, 124 bool is_eval,
126 Compiler::ValidationState validate, 125 Compiler::ValidationState validate,
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 false); // Not eval. 482 false); // Not eval.
484 is_compiled = true; 483 is_compiled = true;
485 } 484 }
486 } else if (FLAG_always_fast_compiler || 485 } else if (FLAG_always_fast_compiler ||
487 (FLAG_fast_compiler && !is_run_once)) { 486 (FLAG_fast_compiler && !is_run_once)) {
488 // Since we are not lazily compiling we do not have a receiver to 487 // Since we are not lazily compiling we do not have a receiver to
489 // specialize for. 488 // specialize for.
490 FastCodeGenSyntaxChecker checker; 489 FastCodeGenSyntaxChecker checker;
491 checker.Check(literal, &info); 490 checker.Check(literal, &info);
492 if (checker.has_supported_syntax()) { 491 if (checker.has_supported_syntax()) {
493 // Does not yet generate code. 492 code = FastCodeGenerator::MakeCode(literal, script, false, &info);
494 FastCodeGenerator::MakeCode(literal, script, false, &info); 493 is_compiled = true;
495 } 494 }
496 } 495 }
497 496
498 if (!is_compiled) { 497 if (!is_compiled) {
499 // We fall back to the classic V8 code generator. 498 // We fall back to the classic V8 code generator.
500 code = CodeGenerator::MakeCode(literal, 499 code = CodeGenerator::MakeCode(literal,
501 script, 500 script,
502 false, // Not eval. 501 false, // Not eval.
503 &info); 502 &info);
504 } 503 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 fun->shared()->set_is_toplevel(is_toplevel); 556 fun->shared()->set_is_toplevel(is_toplevel);
558 fun->shared()->set_inferred_name(*lit->inferred_name()); 557 fun->shared()->set_inferred_name(*lit->inferred_name());
559 fun->shared()->SetThisPropertyAssignmentsInfo( 558 fun->shared()->SetThisPropertyAssignmentsInfo(
560 lit->has_only_simple_this_property_assignments(), 559 lit->has_only_simple_this_property_assignments(),
561 *lit->this_property_assignments()); 560 *lit->this_property_assignments());
562 fun->shared()->set_try_full_codegen(lit->try_full_codegen()); 561 fun->shared()->set_try_full_codegen(lit->try_full_codegen());
563 } 562 }
564 563
565 564
566 } } // namespace v8::internal 565 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.h ('k') | src/data-flow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698