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

Side by Side Diff: src/compiler.cc

Issue 8590027: Fix the ScopeIterator reimplemantation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ScopeIterator fix and test cases. Created 9 years, 1 month 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/ast.h ('k') | src/parser.h » ('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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 ScriptDataImpl* pre_data = input_pre_data; 485 ScriptDataImpl* pre_data = input_pre_data;
486 int flags = kNoParsingFlags; 486 int flags = kNoParsingFlags;
487 if ((natives == NATIVES_CODE) || FLAG_allow_natives_syntax) { 487 if ((natives == NATIVES_CODE) || FLAG_allow_natives_syntax) {
488 flags |= kAllowNativesSyntax; 488 flags |= kAllowNativesSyntax;
489 } 489 }
490 if (natives != NATIVES_CODE && FLAG_harmony_scoping) { 490 if (natives != NATIVES_CODE && FLAG_harmony_scoping) {
491 flags |= kHarmonyScoping; 491 flags |= kHarmonyScoping;
492 } 492 }
493 if (pre_data == NULL 493 if (pre_data == NULL
494 && source_length >= FLAG_min_preparse_length) { 494 && source_length >= FLAG_min_preparse_length) {
495 if (source->IsExternalTwoByteString()) { 495 pre_data = ParserApi::PartialPreParse(source, extension, flags);
Lasse Reichstein 2011/11/28 11:51:36 You can just skip creating preparser data now. The
496 ExternalTwoByteStringUC16CharacterStream stream(
497 Handle<ExternalTwoByteString>::cast(source), 0, source->length());
498 pre_data = ParserApi::PartialPreParse(&stream, extension, flags);
499 } else {
500 GenericStringUC16CharacterStream stream(source, 0, source->length());
501 pre_data = ParserApi::PartialPreParse(&stream, extension, flags);
502 }
503 } 496 }
504 497
505 // Create a script object describing the script to be compiled. 498 // Create a script object describing the script to be compiled.
506 Handle<Script> script = FACTORY->NewScript(source); 499 Handle<Script> script = FACTORY->NewScript(source);
507 if (natives == NATIVES_CODE) { 500 if (natives == NATIVES_CODE) {
508 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); 501 script->set_type(Smi::FromInt(Script::TYPE_NATIVE));
509 } 502 }
510 if (!script_name.is_null()) { 503 if (!script_name.is_null()) {
511 script->set_name(*script_name); 504 script->set_name(*script_name);
512 script->set_line_offset(Smi::FromInt(line_offset)); 505 script->set_line_offset(Smi::FromInt(line_offset));
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 } 789 }
797 } 790 }
798 791
799 GDBJIT(AddCode(Handle<String>(shared->DebugName()), 792 GDBJIT(AddCode(Handle<String>(shared->DebugName()),
800 Handle<Script>(info->script()), 793 Handle<Script>(info->script()),
801 Handle<Code>(info->code()), 794 Handle<Code>(info->code()),
802 info)); 795 info));
803 } 796 }
804 797
805 } } // namespace v8::internal 798 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698