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

Side by Side Diff: src/parser.cc

Issue 367373007: Parser cleanup: Cached data cannot contain errors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/base/platform/platform.h" 9 #include "src/base/platform/platform.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 4839 matching lines...) Expand 10 before | Expand all | Expand 10 after
4850 4850
4851 if (info()->is_lazy()) { 4851 if (info()->is_lazy()) {
4852 ASSERT(!info()->is_eval()); 4852 ASSERT(!info()->is_eval());
4853 if (info()->shared_info()->is_function()) { 4853 if (info()->shared_info()->is_function()) {
4854 result = ParseLazy(); 4854 result = ParseLazy();
4855 } else { 4855 } else {
4856 result = ParseProgram(); 4856 result = ParseProgram();
4857 } 4857 }
4858 } else { 4858 } else {
4859 SetCachedData(info()->cached_data(), info()->cached_data_mode()); 4859 SetCachedData(info()->cached_data(), info()->cached_data_mode());
4860 if (info()->cached_data_mode() == CONSUME_CACHED_DATA && 4860 result = ParseProgram();
4861 (*info()->cached_data())->has_error()) {
4862 ScriptData* cached_data = *(info()->cached_data());
4863 Scanner::Location loc = cached_data->MessageLocation();
4864 const char* message = cached_data->BuildMessage();
4865 const char* arg = cached_data->BuildArg();
4866 ParserTraits::ReportMessageAt(loc, message, arg,
4867 cached_data->IsReferenceError());
4868 DeleteArray(message);
4869 DeleteArray(arg);
4870 ASSERT(info()->isolate()->has_pending_exception());
4871 } else {
4872 result = ParseProgram();
4873 }
4874 } 4861 }
4875 info()->SetFunction(result); 4862 info()->SetFunction(result);
4876 ASSERT(ast_value_factory_->IsInternalized()); 4863 ASSERT(ast_value_factory_->IsInternalized());
4877 // info takes ownership of ast_value_factory_. 4864 // info takes ownership of ast_value_factory_.
4878 if (info()->ast_value_factory() == NULL) { 4865 if (info()->ast_value_factory() == NULL) {
4879 info()->SetAstValueFactory(ast_value_factory_); 4866 info()->SetAstValueFactory(ast_value_factory_);
4880 } 4867 }
4881 ast_value_factory_ = NULL; 4868 ast_value_factory_ = NULL;
4882 4869
4883 InternalizeUseCounts(); 4870 InternalizeUseCounts();
4884 4871
4885 return (result != NULL); 4872 return (result != NULL);
4886 } 4873 }
4887 4874
4888 } } // namespace v8::internal 4875 } } // 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