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

Side by Side Diff: src/runtime/runtime-internal.cc

Issue 974213002: Extract ParseInfo from CompilationInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | src/scopes.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/arguments.h" 7 #include "src/arguments.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/debug.h" 9 #include "src/debug.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 173
174 RUNTIME_FUNCTION(Runtime_RenderCallSite) { 174 RUNTIME_FUNCTION(Runtime_RenderCallSite) {
175 HandleScope scope(isolate); 175 HandleScope scope(isolate);
176 DCHECK(args.length() == 0); 176 DCHECK(args.length() == 0);
177 MessageLocation location; 177 MessageLocation location;
178 isolate->ComputeLocation(&location); 178 isolate->ComputeLocation(&location);
179 if (location.start_pos() == -1) return isolate->heap()->empty_string(); 179 if (location.start_pos() == -1) return isolate->heap()->empty_string();
180 180
181 Zone zone; 181 Zone zone;
182 ParseInfo info(&zone);
182 if (location.function()->shared()->is_function()) { 183 if (location.function()->shared()->is_function()) {
183 CompilationInfo info(location.function(), &zone); 184 info.InitializeFromJSFunction(location.function());
184 if (!Parser::ParseStatic(&info)) { 185 } else {
185 isolate->clear_pending_exception(); 186 info.InitializeFromScript(location.script());
186 return isolate->heap()->empty_string();
187 }
188 CallPrinter printer(isolate, &zone);
189 const char* string = printer.Print(info.function(), location.start_pos());
190 return *isolate->factory()->NewStringFromAsciiChecked(string);
191 } 187 }
192 188
193 CompilationInfo info(location.script(), &zone);
194 if (!Parser::ParseStatic(&info)) { 189 if (!Parser::ParseStatic(&info)) {
195 isolate->clear_pending_exception(); 190 isolate->clear_pending_exception();
196 return isolate->heap()->empty_string(); 191 return isolate->heap()->empty_string();
197 } 192 }
198 CallPrinter printer(isolate, &zone); 193 CallPrinter printer(isolate, &zone);
199 const char* string = printer.Print(info.function(), location.start_pos()); 194 const char* string = printer.Print(info.function(), location.start_pos());
200 return *isolate->factory()->NewStringFromAsciiChecked(string); 195 return *isolate->factory()->NewStringFromAsciiChecked(string);
201 } 196 }
202 197
203 198
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 316
322 RUNTIME_FUNCTION(Runtime_GetFromCache) { 317 RUNTIME_FUNCTION(Runtime_GetFromCache) {
323 HandleScope scope(isolate); 318 HandleScope scope(isolate);
324 DCHECK(args.length() == 2); 319 DCHECK(args.length() == 2);
325 CONVERT_SMI_ARG_CHECKED(id, 0); 320 CONVERT_SMI_ARG_CHECKED(id, 0);
326 args[0] = isolate->native_context()->jsfunction_result_caches()->get(id); 321 args[0] = isolate->native_context()->jsfunction_result_caches()->get(id);
327 return __RT_impl_Runtime_GetFromCacheRT(args, isolate); 322 return __RT_impl_Runtime_GetFromCacheRT(args, isolate);
328 } 323 }
329 } 324 }
330 } // namespace v8::internal 325 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698