| 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 SmartPointer<ParseInfo> info(location.function()->shared()->is_function() |
| 183 if (location.function()->shared()->is_function()) { | 183 ? new ParseInfo(&zone, location.function()) |
| 184 info.InitializeFromJSFunction(location.function()); | 184 : new ParseInfo(&zone, location.script())); |
| 185 } else { | |
| 186 info.InitializeFromScript(location.script()); | |
| 187 } | |
| 188 | 185 |
| 189 if (!Parser::ParseStatic(&info)) { | 186 if (!Parser::ParseStatic(info.get())) { |
| 190 isolate->clear_pending_exception(); | 187 isolate->clear_pending_exception(); |
| 191 return isolate->heap()->empty_string(); | 188 return isolate->heap()->empty_string(); |
| 192 } | 189 } |
| 193 CallPrinter printer(isolate, &zone); | 190 CallPrinter printer(isolate, &zone); |
| 194 const char* string = printer.Print(info.function(), location.start_pos()); | 191 const char* string = printer.Print(info->function(), location.start_pos()); |
| 195 return *isolate->factory()->NewStringFromAsciiChecked(string); | 192 return *isolate->factory()->NewStringFromAsciiChecked(string); |
| 196 } | 193 } |
| 197 | 194 |
| 198 | 195 |
| 199 RUNTIME_FUNCTION(Runtime_GetFromCacheRT) { | 196 RUNTIME_FUNCTION(Runtime_GetFromCacheRT) { |
| 200 SealHandleScope shs(isolate); | 197 SealHandleScope shs(isolate); |
| 201 // This is only called from codegen, so checks might be more lax. | 198 // This is only called from codegen, so checks might be more lax. |
| 202 CONVERT_ARG_CHECKED(JSFunctionResultCache, cache, 0); | 199 CONVERT_ARG_CHECKED(JSFunctionResultCache, cache, 0); |
| 203 CONVERT_ARG_CHECKED(Object, key, 1); | 200 CONVERT_ARG_CHECKED(Object, key, 1); |
| 204 | 201 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 | 313 |
| 317 RUNTIME_FUNCTION(Runtime_GetFromCache) { | 314 RUNTIME_FUNCTION(Runtime_GetFromCache) { |
| 318 HandleScope scope(isolate); | 315 HandleScope scope(isolate); |
| 319 DCHECK(args.length() == 2); | 316 DCHECK(args.length() == 2); |
| 320 CONVERT_SMI_ARG_CHECKED(id, 0); | 317 CONVERT_SMI_ARG_CHECKED(id, 0); |
| 321 args[0] = isolate->native_context()->jsfunction_result_caches()->get(id); | 318 args[0] = isolate->native_context()->jsfunction_result_caches()->get(id); |
| 322 return __RT_impl_Runtime_GetFromCacheRT(args, isolate); | 319 return __RT_impl_Runtime_GetFromCacheRT(args, isolate); |
| 323 } | 320 } |
| 324 } | 321 } |
| 325 } // namespace v8::internal | 322 } // namespace v8::internal |
| OLD | NEW |