OLD | NEW |
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 Loading... |
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 Loading... |
321 | 316 |
322 RUNTIME_FUNCTION(RuntimeReference_GetFromCache) { | 317 RUNTIME_FUNCTION(RuntimeReference_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_GetFromCache(args, isolate); | 322 return __RT_impl_Runtime_GetFromCache(args, isolate); |
328 } | 323 } |
329 } | 324 } |
330 } // namespace v8::internal | 325 } // namespace v8::internal |
OLD | NEW |