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

Side by Side Diff: src/parser.cc

Issue 266423003: Produce cached data only for scripts which compile without errors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "api.h" 7 #include "api.h"
8 #include "ast.h" 8 #include "ast.h"
9 #include "bootstrapper.h" 9 #include "bootstrapper.h"
10 #include "char-predicates-inl.h" 10 #include "char-predicates-inl.h"
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 } else if (info()->script()->name()->IsString()) { 847 } else if (info()->script()->name()->IsString()) {
848 String* name = String::cast(info()->script()->name()); 848 String* name = String::cast(info()->script()->name());
849 SmartArrayPointer<char> name_chars = name->ToCString(); 849 SmartArrayPointer<char> name_chars = name->ToCString();
850 PrintF("[parsing script: %s", name_chars.get()); 850 PrintF("[parsing script: %s", name_chars.get());
851 } else { 851 } else {
852 PrintF("[parsing script"); 852 PrintF("[parsing script");
853 } 853 }
854 PrintF(" - took %0.3f ms]\n", ms); 854 PrintF(" - took %0.3f ms]\n", ms);
855 } 855 }
856 if (cached_data_mode_ == PRODUCE_CACHED_DATA) { 856 if (cached_data_mode_ == PRODUCE_CACHED_DATA) {
857 Vector<unsigned> store = recorder.ExtractData(); 857 if (result != NULL) {
858 *cached_data_ = new ScriptData(store); 858 Vector<unsigned> store = recorder.ExtractData();
859 *cached_data_ = new ScriptData(store);
860 }
859 log_ = NULL; 861 log_ = NULL;
860 } 862 }
861 return result; 863 return result;
862 } 864 }
863 865
864 866
865 FunctionLiteral* Parser::DoParseProgram(CompilationInfo* info, 867 FunctionLiteral* Parser::DoParseProgram(CompilationInfo* info,
866 Handle<String> source) { 868 Handle<String> source) {
867 ASSERT(scope_ == NULL); 869 ASSERT(scope_ == NULL);
868 ASSERT(target_stack_ == NULL); 870 ASSERT(target_stack_ == NULL);
(...skipping 3760 matching lines...) Expand 10 before | Expand all | Expand 10 after
4629 ASSERT(info()->isolate()->has_pending_exception()); 4631 ASSERT(info()->isolate()->has_pending_exception());
4630 } else { 4632 } else {
4631 result = ParseProgram(); 4633 result = ParseProgram();
4632 } 4634 }
4633 } 4635 }
4634 info()->SetFunction(result); 4636 info()->SetFunction(result);
4635 return (result != NULL); 4637 return (result != NULL);
4636 } 4638 }
4637 4639
4638 } } // namespace v8::internal 4640 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698