OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |