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

Side by Side Diff: src/parser.cc

Issue 7066004: Inline more zone stuff. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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 | « src/liveedit.cc ('k') | src/profile-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 fni_(NULL), 585 fni_(NULL),
586 stack_overflow_(false), 586 stack_overflow_(false),
587 parenthesized_function_(false) { 587 parenthesized_function_(false) {
588 AstNode::ResetIds(); 588 AstNode::ResetIds();
589 } 589 }
590 590
591 591
592 FunctionLiteral* Parser::ParseProgram(Handle<String> source, 592 FunctionLiteral* Parser::ParseProgram(Handle<String> source,
593 bool in_global_context, 593 bool in_global_context,
594 StrictModeFlag strict_mode) { 594 StrictModeFlag strict_mode) {
595 CompilationZoneScope zone_scope(DONT_DELETE_ON_EXIT); 595 CompilationZoneScope zone_scope(isolate(), DONT_DELETE_ON_EXIT);
596 596
597 HistogramTimerScope timer(isolate()->counters()->parse()); 597 HistogramTimerScope timer(isolate()->counters()->parse());
598 isolate()->counters()->total_parse_size()->Increment(source->length()); 598 isolate()->counters()->total_parse_size()->Increment(source->length());
599 fni_ = new(zone()) FuncNameInferrer(); 599 fni_ = new(zone()) FuncNameInferrer();
600 600
601 // Initialize parser state. 601 // Initialize parser state.
602 source->TryFlatten(); 602 source->TryFlatten();
603 if (source->IsExternalTwoByteString()) { 603 if (source->IsExternalTwoByteString()) {
604 // Notice that the stream is destroyed at the end of the branch block. 604 // Notice that the stream is destroyed at the end of the branch block.
605 // The last line of the blocks can't be moved outside, even though they're 605 // The last line of the blocks can't be moved outside, even though they're
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 // Make sure the target stack is empty. 667 // Make sure the target stack is empty.
668 ASSERT(target_stack_ == NULL); 668 ASSERT(target_stack_ == NULL);
669 669
670 // If there was a syntax error we have to get rid of the AST 670 // If there was a syntax error we have to get rid of the AST
671 // and it is not safe to do so before the scope has been deleted. 671 // and it is not safe to do so before the scope has been deleted.
672 if (result == NULL) zone_scope->DeleteOnExit(); 672 if (result == NULL) zone_scope->DeleteOnExit();
673 return result; 673 return result;
674 } 674 }
675 675
676 FunctionLiteral* Parser::ParseLazy(CompilationInfo* info) { 676 FunctionLiteral* Parser::ParseLazy(CompilationInfo* info) {
677 CompilationZoneScope zone_scope(DONT_DELETE_ON_EXIT); 677 CompilationZoneScope zone_scope(isolate(), DONT_DELETE_ON_EXIT);
678 HistogramTimerScope timer(isolate()->counters()->parse_lazy()); 678 HistogramTimerScope timer(isolate()->counters()->parse_lazy());
679 Handle<String> source(String::cast(script_->source())); 679 Handle<String> source(String::cast(script_->source()));
680 isolate()->counters()->total_parse_size()->Increment(source->length()); 680 isolate()->counters()->total_parse_size()->Increment(source->length());
681 681
682 Handle<SharedFunctionInfo> shared_info = info->shared_info(); 682 Handle<SharedFunctionInfo> shared_info = info->shared_info();
683 // Initialize parser state. 683 // Initialize parser state.
684 source->TryFlatten(); 684 source->TryFlatten();
685 if (source->IsExternalTwoByteString()) { 685 if (source->IsExternalTwoByteString()) {
686 ExternalTwoByteStringUC16CharacterStream stream( 686 ExternalTwoByteStringUC16CharacterStream stream(
687 Handle<ExternalTwoByteString>::cast(source), 687 Handle<ExternalTwoByteString>::cast(source),
(...skipping 3484 matching lines...) Expand 10 before | Expand all | Expand 10 after
4172 if (scanner_.current_token() != Token::RBRACE) { 4172 if (scanner_.current_token() != Token::RBRACE) {
4173 return ReportUnexpectedToken(); 4173 return ReportUnexpectedToken();
4174 } 4174 }
4175 } 4175 }
4176 return json_object; 4176 return json_object;
4177 } 4177 }
4178 4178
4179 4179
4180 // Parse a JSON array. Scanner must be right after '[' token. 4180 // Parse a JSON array. Scanner must be right after '[' token.
4181 Handle<Object> JsonParser::ParseJsonArray() { 4181 Handle<Object> JsonParser::ParseJsonArray() {
4182 ZoneScope zone_scope(DELETE_ON_EXIT); 4182 ZoneScope zone_scope(isolate(), DELETE_ON_EXIT);
4183 ZoneList<Handle<Object> > elements(4); 4183 ZoneList<Handle<Object> > elements(4);
4184 4184
4185 Token::Value token = scanner_.peek(); 4185 Token::Value token = scanner_.peek();
4186 if (token == Token::RBRACK) { 4186 if (token == Token::RBRACK) {
4187 scanner_.Next(); 4187 scanner_.Next();
4188 } else { 4188 } else {
4189 if (StackLimitCheck(isolate()).HasOverflowed()) { 4189 if (StackLimitCheck(isolate()).HasOverflowed()) {
4190 stack_overflow_ = true; 4190 stack_overflow_ = true;
4191 return Handle<Object>::null(); 4191 return Handle<Object>::null();
4192 } 4192 }
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
5183 info->is_global(), 5183 info->is_global(),
5184 info->StrictMode()); 5184 info->StrictMode());
5185 } 5185 }
5186 } 5186 }
5187 5187
5188 info->SetFunction(result); 5188 info->SetFunction(result);
5189 return (result != NULL); 5189 return (result != NULL);
5190 } 5190 }
5191 5191
5192 } } // namespace v8::internal 5192 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/liveedit.cc ('k') | src/profile-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698