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

Side by Side Diff: src/compiler.cc

Issue 6814012: Strict mode fixes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 8 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 Handle<SharedFunctionInfo> shared = info->shared_info(); 596 Handle<SharedFunctionInfo> shared = info->shared_info();
597 int compiled_size = shared->end_position() - shared->start_position(); 597 int compiled_size = shared->end_position() - shared->start_position();
598 isolate->counters()->total_compile_size()->Increment(compiled_size); 598 isolate->counters()->total_compile_size()->Increment(compiled_size);
599 599
600 // Generate the AST for the lazily compiled function. 600 // Generate the AST for the lazily compiled function.
601 if (ParserApi::Parse(info)) { 601 if (ParserApi::Parse(info)) {
602 // Measure how long it takes to do the lazy compilation; only take the 602 // Measure how long it takes to do the lazy compilation; only take the
603 // rest of the function into account to avoid overlap with the lazy 603 // rest of the function into account to avoid overlap with the lazy
604 // parsing statistics. 604 // parsing statistics.
605 HistogramTimerScope timer(isolate->counters()->compile_lazy()); 605 HistogramTimerScope timer(isolate->counters()->compile_lazy());
606 606
Martin Maly 2011/04/07 10:07:07 Third fix. SharedFunctionInfo of lazy compiled fun
Lasse Reichstein 2011/04/08 12:54:18 The preparser should be able to detect this and st
Martin Maly 2011/04/08 14:27:39 Preparser doesn't yet detect strict mode. Once it
607 // After parsing we know function's strict mode. Remember it.
608 if (info->function()->strict_mode()) {
609 shared->set_strict_mode(true);
610 info->MarkAsStrictMode();
611 }
612
607 // Compile the code. 613 // Compile the code.
608 if (!MakeCode(info)) { 614 if (!MakeCode(info)) {
609 if (!isolate->has_pending_exception()) { 615 if (!isolate->has_pending_exception()) {
610 isolate->StackOverflow(); 616 isolate->StackOverflow();
611 } 617 }
612 } else { 618 } else {
613 ASSERT(!info->code().is_null()); 619 ASSERT(!info->code().is_null());
614 Handle<Code> code = info->code(); 620 Handle<Code> code = info->code();
615 // Set optimizable to false if this is disallowed by the shared 621 // Set optimizable to false if this is disallowed by the shared
616 // function info, e.g., we might have flushed the code and must 622 // function info, e.g., we might have flushed the code and must
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 shared->DebugName())); 789 shared->DebugName()));
784 } 790 }
785 } 791 }
786 792
787 GDBJIT(AddCode(name, 793 GDBJIT(AddCode(name,
788 Handle<Script>(info->script()), 794 Handle<Script>(info->script()),
789 Handle<Code>(info->code()))); 795 Handle<Code>(info->code())));
790 } 796 }
791 797
792 } } // namespace v8::internal 798 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698