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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 RUNTIME_FUNCTION(Runtime_RenderCallSite) { | 159 RUNTIME_FUNCTION(Runtime_RenderCallSite) { |
160 HandleScope scope(isolate); | 160 HandleScope scope(isolate); |
161 DCHECK(args.length() == 0); | 161 DCHECK(args.length() == 0); |
162 MessageLocation location; | 162 MessageLocation location; |
163 isolate->ComputeLocation(&location); | 163 isolate->ComputeLocation(&location); |
164 if (location.start_pos() == -1) return isolate->heap()->empty_string(); | 164 if (location.start_pos() == -1) return isolate->heap()->empty_string(); |
165 | 165 |
166 Zone zone; | 166 Zone zone; |
167 if (location.function()->shared()->is_function()) { | 167 if (location.function()->shared()->is_function()) { |
168 CompilationInfo info(location.function(), &zone); | 168 CompilationInfo info(location.function(), &zone); |
169 if (!Parser::Parse(&info)) return isolate->heap()->empty_string(); | 169 if (!Parser::Parse(&info)) { |
| 170 isolate->clear_pending_exception(); |
| 171 return isolate->heap()->empty_string(); |
| 172 } |
170 CallPrinter printer(isolate, &zone); | 173 CallPrinter printer(isolate, &zone); |
171 const char* string = printer.Print(info.function(), location.start_pos()); | 174 const char* string = printer.Print(info.function(), location.start_pos()); |
172 return *isolate->factory()->NewStringFromAsciiChecked(string); | 175 return *isolate->factory()->NewStringFromAsciiChecked(string); |
173 } | 176 } |
174 | 177 |
175 CompilationInfo info(location.script(), &zone); | 178 CompilationInfo info(location.script(), &zone); |
176 if (!Parser::Parse(&info)) return isolate->heap()->empty_string(); | 179 if (!Parser::Parse(&info)) { |
| 180 isolate->clear_pending_exception(); |
| 181 return isolate->heap()->empty_string(); |
| 182 } |
177 CallPrinter printer(isolate, &zone); | 183 CallPrinter printer(isolate, &zone); |
178 const char* string = printer.Print(info.function(), location.start_pos()); | 184 const char* string = printer.Print(info.function(), location.start_pos()); |
179 return *isolate->factory()->NewStringFromAsciiChecked(string); | 185 return *isolate->factory()->NewStringFromAsciiChecked(string); |
180 } | 186 } |
181 | 187 |
182 | 188 |
183 RUNTIME_FUNCTION(Runtime_GetFromCache) { | 189 RUNTIME_FUNCTION(Runtime_GetFromCache) { |
184 SealHandleScope shs(isolate); | 190 SealHandleScope shs(isolate); |
185 // This is only called from codegen, so checks might be more lax. | 191 // This is only called from codegen, so checks might be more lax. |
186 CONVERT_ARG_CHECKED(JSFunctionResultCache, cache, 0); | 192 CONVERT_ARG_CHECKED(JSFunctionResultCache, cache, 0); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 306 |
301 RUNTIME_FUNCTION(RuntimeReference_GetFromCache) { | 307 RUNTIME_FUNCTION(RuntimeReference_GetFromCache) { |
302 HandleScope scope(isolate); | 308 HandleScope scope(isolate); |
303 DCHECK(args.length() == 2); | 309 DCHECK(args.length() == 2); |
304 CONVERT_SMI_ARG_CHECKED(id, 0); | 310 CONVERT_SMI_ARG_CHECKED(id, 0); |
305 args[0] = isolate->native_context()->jsfunction_result_caches()->get(id); | 311 args[0] = isolate->native_context()->jsfunction_result_caches()->get(id); |
306 return __RT_impl_Runtime_GetFromCache(args, isolate); | 312 return __RT_impl_Runtime_GetFromCache(args, isolate); |
307 } | 313 } |
308 } | 314 } |
309 } // namespace v8::internal | 315 } // namespace v8::internal |
OLD | NEW |