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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 | 157 |
158 | 158 |
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(isolate); | 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)) return isolate->heap()->empty_string(); |
170 CallPrinter printer(&zone); | 170 CallPrinter printer(isolate, &zone); |
171 const char* string = printer.Print(info.function(), location.start_pos()); | 171 const char* string = printer.Print(info.function(), location.start_pos()); |
172 return *isolate->factory()->NewStringFromAsciiChecked(string); | 172 return *isolate->factory()->NewStringFromAsciiChecked(string); |
173 } | 173 } |
174 | 174 |
175 CompilationInfo info(location.script(), &zone); | 175 CompilationInfo info(location.script(), &zone); |
176 if (!Parser::Parse(&info)) return isolate->heap()->empty_string(); | 176 if (!Parser::Parse(&info)) return isolate->heap()->empty_string(); |
177 CallPrinter printer(&zone); | 177 CallPrinter printer(isolate, &zone); |
178 const char* string = printer.Print(info.function(), location.start_pos()); | 178 const char* string = printer.Print(info.function(), location.start_pos()); |
179 return *isolate->factory()->NewStringFromAsciiChecked(string); | 179 return *isolate->factory()->NewStringFromAsciiChecked(string); |
180 } | 180 } |
181 | 181 |
182 | 182 |
183 RUNTIME_FUNCTION(Runtime_GetFromCache) { | 183 RUNTIME_FUNCTION(Runtime_GetFromCache) { |
184 SealHandleScope shs(isolate); | 184 SealHandleScope shs(isolate); |
185 // This is only called from codegen, so checks might be more lax. | 185 // This is only called from codegen, so checks might be more lax. |
186 CONVERT_ARG_CHECKED(JSFunctionResultCache, cache, 0); | 186 CONVERT_ARG_CHECKED(JSFunctionResultCache, cache, 0); |
187 CONVERT_ARG_CHECKED(Object, key, 1); | 187 CONVERT_ARG_CHECKED(Object, key, 1); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 300 |
301 RUNTIME_FUNCTION(RuntimeReference_GetFromCache) { | 301 RUNTIME_FUNCTION(RuntimeReference_GetFromCache) { |
302 HandleScope scope(isolate); | 302 HandleScope scope(isolate); |
303 DCHECK(args.length() == 2); | 303 DCHECK(args.length() == 2); |
304 CONVERT_SMI_ARG_CHECKED(id, 0); | 304 CONVERT_SMI_ARG_CHECKED(id, 0); |
305 args[0] = isolate->native_context()->jsfunction_result_caches()->get(id); | 305 args[0] = isolate->native_context()->jsfunction_result_caches()->get(id); |
306 return __RT_impl_Runtime_GetFromCache(args, isolate); | 306 return __RT_impl_Runtime_GetFromCache(args, isolate); |
307 } | 307 } |
308 } | 308 } |
309 } // namespace v8::internal | 309 } // namespace v8::internal |
OLD | NEW |