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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 | 443 |
444 Handle<Code> FullCodeGenerator::MakeCode(CompilationInfo* info) { | 444 Handle<Code> FullCodeGenerator::MakeCode(CompilationInfo* info) { |
445 Handle<Script> script = info->script(); | 445 Handle<Script> script = info->script(); |
446 if (!script->IsUndefined() && !script->source()->IsUndefined()) { | 446 if (!script->IsUndefined() && !script->source()->IsUndefined()) { |
447 int len = String::cast(script->source())->length(); | 447 int len = String::cast(script->source())->length(); |
448 Counters::total_full_codegen_source_size.Increment(len); | 448 Counters::total_full_codegen_source_size.Increment(len); |
449 } | 449 } |
450 CodeGenerator::MakeCodePrologue(info); | 450 CodeGenerator::MakeCodePrologue(info); |
451 const int kInitialBufferSize = 4 * KB; | 451 const int kInitialBufferSize = 4 * KB; |
452 MacroAssembler masm(NULL, kInitialBufferSize); | 452 MacroAssembler masm(NULL, kInitialBufferSize); |
453 LiveEditFunctionTracker live_edit_tracker(info->function()); | |
454 | 453 |
455 FullCodeGenerator cgen(&masm); | 454 FullCodeGenerator cgen(&masm); |
456 cgen.Generate(info, PRIMARY); | 455 cgen.Generate(info, PRIMARY); |
457 if (cgen.HasStackOverflow()) { | 456 if (cgen.HasStackOverflow()) { |
458 ASSERT(!Top::has_pending_exception()); | 457 ASSERT(!Top::has_pending_exception()); |
459 return Handle<Code>::null(); | 458 return Handle<Code>::null(); |
460 } | 459 } |
461 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION, NOT_IN_LOOP); | 460 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION, NOT_IN_LOOP); |
462 Handle<Code> result = CodeGenerator::MakeCodeEpilogue(&masm, flags, info); | 461 return CodeGenerator::MakeCodeEpilogue(&masm, flags, info); |
463 live_edit_tracker.RecordFunctionCode(result); | |
464 return result; | |
465 } | 462 } |
466 | 463 |
467 | 464 |
468 int FullCodeGenerator::SlotOffset(Slot* slot) { | 465 int FullCodeGenerator::SlotOffset(Slot* slot) { |
469 ASSERT(slot != NULL); | 466 ASSERT(slot != NULL); |
470 // Offset is negative because higher indexes are at lower addresses. | 467 // Offset is negative because higher indexes are at lower addresses. |
471 int offset = -slot->index() * kPointerSize; | 468 int offset = -slot->index() * kPointerSize; |
472 // Adjust by a (parameter or local) base offset. | 469 // Adjust by a (parameter or local) base offset. |
473 switch (slot->type()) { | 470 switch (slot->type()) { |
474 case Slot::PARAMETER: | 471 case Slot::PARAMETER: |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 // The macros used here must preserve the result register. | 1067 // The macros used here must preserve the result register. |
1071 __ Drop(stack_depth); | 1068 __ Drop(stack_depth); |
1072 __ PopTryHandler(); | 1069 __ PopTryHandler(); |
1073 return 0; | 1070 return 0; |
1074 } | 1071 } |
1075 | 1072 |
1076 #undef __ | 1073 #undef __ |
1077 | 1074 |
1078 | 1075 |
1079 } } // namespace v8::internal | 1076 } } // namespace v8::internal |
OLD | NEW |