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

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

Issue 868883002: Remove the dependency of Zone on Isolate (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compilation issues Created 5 years, 11 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/rewriter.cc ('k') | src/scopeinfo.cc » ('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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « src/rewriter.cc ('k') | src/scopeinfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698