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

Side by Side Diff: src/lexer/lexer.cc

Issue 201953002: Experimental parser: small fixes (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 9 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 Handle<String> Lexer<Char>::AllocateNextLiteralString(Isolate* isolate, 730 Handle<String> Lexer<Char>::AllocateNextLiteralString(Isolate* isolate,
731 PretenureFlag tenured) { 731 PretenureFlag tenured) {
732 Factory* factory = isolate->factory(); 732 Factory* factory = isolate->factory();
733 LiteralDesc* literal = next_literal_; 733 LiteralDesc* literal = next_literal_;
734 const TokenDesc& token = next_; 734 const TokenDesc& token = next_;
735 // TODO(dcarney): handle utf8 directly. 735 // TODO(dcarney): handle utf8 directly.
736 if (source_handle_.is_null() || MustBeInBuffer(token)) { 736 if (source_handle_.is_null() || MustBeInBuffer(token)) {
737 EnsureLiteralIsValid(token, literal); 737 EnsureLiteralIsValid(token, literal);
738 return literal->is_one_byte() ? 738 return literal->is_one_byte() ?
739 factory->NewStringFromOneByte(literal->one_byte_string(), tenured) : 739 factory->NewStringFromOneByte(literal->one_byte_string(), tenured) :
740 factory->NewStringFromTwoByte(literal->two_byte_string(), tenured); 740 factory->NewStringFromTwoByte(
741 literal->two_byte_string(), false, tenured);
741 } 742 }
742 int offset = 0, length = 0; 743 int offset = 0, length = 0;
743 LiteralOffsetAndLength<Char>(buffer_, token, &offset, &length); 744 LiteralOffsetAndLength<Char>(buffer_, token, &offset, &length);
744 return factory->NewSubString(source_handle_, offset, offset + length); 745 return factory->NewSubString(source_handle_, offset, offset + length);
745 } 746 }
746 747
747 748
748 template class Lexer<uint8_t>; 749 template class Lexer<uint8_t>;
749 template class Lexer<uint16_t>; 750 template class Lexer<uint16_t>;
750 template class Lexer<int8_t>; 751 template class Lexer<int8_t>;
751 752
752 } } // v8::internal 753 } } // v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/lexer/lexer-shell.cc » ('j') | src/lexer/lexer-shell.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698