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

Side by Side Diff: src/full-codegen.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/full-codegen.h ('k') | src/ia32/codegen-ia32.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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 Handle<Script> script, 455 Handle<Script> script,
456 bool is_eval) { 456 bool is_eval) {
457 if (!script->IsUndefined() && !script->source()->IsUndefined()) { 457 if (!script->IsUndefined() && !script->source()->IsUndefined()) {
458 int len = String::cast(script->source())->length(); 458 int len = String::cast(script->source())->length();
459 Counters::total_full_codegen_source_size.Increment(len); 459 Counters::total_full_codegen_source_size.Increment(len);
460 } 460 }
461 CodeGenerator::MakeCodePrologue(fun); 461 CodeGenerator::MakeCodePrologue(fun);
462 const int kInitialBufferSize = 4 * KB; 462 const int kInitialBufferSize = 4 * KB;
463 MacroAssembler masm(NULL, kInitialBufferSize); 463 MacroAssembler masm(NULL, kInitialBufferSize);
464 FullCodeGenerator cgen(&masm, script, is_eval); 464 FullCodeGenerator cgen(&masm, script, is_eval);
465 cgen.Generate(fun); 465 cgen.Generate(fun, PRIMARY);
466 if (cgen.HasStackOverflow()) { 466 if (cgen.HasStackOverflow()) {
467 ASSERT(!Top::has_pending_exception()); 467 ASSERT(!Top::has_pending_exception());
468 return Handle<Code>::null(); 468 return Handle<Code>::null();
469 } 469 }
470 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION, NOT_IN_LOOP); 470 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION, NOT_IN_LOOP);
471 return CodeGenerator::MakeCodeEpilogue(fun, &masm, flags, script); 471 return CodeGenerator::MakeCodeEpilogue(fun, &masm, flags, script);
472 } 472 }
473 473
474 474
475 int FullCodeGenerator::SlotOffset(Slot* slot) { 475 int FullCodeGenerator::SlotOffset(Slot* slot) {
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 } 1154 }
1155 1155
1156 1156
1157 int FullCodeGenerator::TryCatch::Exit(int stack_depth) { 1157 int FullCodeGenerator::TryCatch::Exit(int stack_depth) {
1158 // The macros used here must preserve the result register. 1158 // The macros used here must preserve the result register.
1159 __ Drop(stack_depth); 1159 __ Drop(stack_depth);
1160 __ PopTryHandler(); 1160 __ PopTryHandler();
1161 return 0; 1161 return 0;
1162 } 1162 }
1163 1163
1164
1165 #undef __ 1164 #undef __
1166 1165
1167 1166
1168 } } // namespace v8::internal 1167 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/full-codegen.h ('k') | src/ia32/codegen-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698