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

Side by Side Diff: src/api.cc

Issue 3518005: Make some free functions into static members of class Parser. (Closed)
Patch Set: Remove outdated comment. Created 10 years, 2 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
« no previous file with comments | « no previous file | src/compiler.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2010 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
11 // with the distribution. 11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its 12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived 13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission. 14 // from this software without specific prior written permission.
15 // 15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #include "v8.h" 28 #include "v8.h"
29 29
30 #include "api.h" 30 #include "api.h"
31
31 #include "arguments.h" 32 #include "arguments.h"
32 #include "bootstrapper.h" 33 #include "bootstrapper.h"
33 #include "compiler.h" 34 #include "compiler.h"
34 #include "debug.h" 35 #include "debug.h"
35 #include "execution.h" 36 #include "execution.h"
36 #include "global-handles.h" 37 #include "global-handles.h"
37 #include "heap-profiler.h" 38 #include "heap-profiler.h"
38 #include "messages.h" 39 #include "messages.h"
40 #include "parser.h"
39 #include "platform.h" 41 #include "platform.h"
40 #include "profile-generator-inl.h" 42 #include "profile-generator-inl.h"
41 #include "serialize.h" 43 #include "serialize.h"
42 #include "snapshot.h" 44 #include "snapshot.h"
43 #include "top.h" 45 #include "top.h"
44 #include "utils.h" 46 #include "utils.h"
45 #include "v8threads.h" 47 #include "v8threads.h"
46 #include "version.h" 48 #include "version.h"
47 49
48 #include "../include/v8-profiler.h" 50 #include "../include/v8-profiler.h"
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 } 1130 }
1129 Utils::OpenHandle(this)->set_internal_field_count(i::Smi::FromInt(value)); 1131 Utils::OpenHandle(this)->set_internal_field_count(i::Smi::FromInt(value));
1130 } 1132 }
1131 1133
1132 1134
1133 // --- S c r i p t D a t a --- 1135 // --- S c r i p t D a t a ---
1134 1136
1135 1137
1136 ScriptData* ScriptData::PreCompile(const char* input, int length) { 1138 ScriptData* ScriptData::PreCompile(const char* input, int length) {
1137 unibrow::Utf8InputBuffer<> buf(input, length); 1139 unibrow::Utf8InputBuffer<> buf(input, length);
1138 return i::PreParse(i::Handle<i::String>(), &buf, NULL); 1140 return i::Parser::PreParse(i::Handle<i::String>(), &buf, NULL);
1139 } 1141 }
1140 1142
1141 1143
1142 ScriptData* ScriptData::PreCompile(v8::Handle<String> source) { 1144 ScriptData* ScriptData::PreCompile(v8::Handle<String> source) {
1143 i::Handle<i::String> str = Utils::OpenHandle(*source); 1145 i::Handle<i::String> str = Utils::OpenHandle(*source);
1144 return i::PreParse(str, NULL, NULL); 1146 return i::Parser::PreParse(str, NULL, NULL);
1145 } 1147 }
1146 1148
1147 1149
1148 ScriptData* ScriptData::New(const char* data, int length) { 1150 ScriptData* ScriptData::New(const char* data, int length) {
1149 // Return an empty ScriptData if the length is obviously invalid. 1151 // Return an empty ScriptData if the length is obviously invalid.
1150 if (length % sizeof(unsigned) != 0) { 1152 if (length % sizeof(unsigned) != 0) {
1151 return new i::ScriptDataImpl(); 1153 return new i::ScriptDataImpl();
1152 } 1154 }
1153 1155
1154 // Copy the data to ensure it is properly aligned. 1156 // Copy the data to ensure it is properly aligned.
(...skipping 3737 matching lines...) Expand 10 before | Expand all | Expand 10 after
4892 4894
4893 4895
4894 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 4896 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
4895 HandleScopeImplementer* thread_local = 4897 HandleScopeImplementer* thread_local =
4896 reinterpret_cast<HandleScopeImplementer*>(storage); 4898 reinterpret_cast<HandleScopeImplementer*>(storage);
4897 thread_local->IterateThis(v); 4899 thread_local->IterateThis(v);
4898 return storage + ArchiveSpacePerThread(); 4900 return storage + ArchiveSpacePerThread();
4899 } 4901 }
4900 4902
4901 } } // namespace v8::internal 4903 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698