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

Side by Side Diff: src/messages.cc

Issue 2057523002: [wasm] Refactor function name table and lookup (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix gc issue Created 4 years, 6 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/isolate.cc ('k') | src/wasm/wasm-function-name-table.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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/messages.h" 5 #include "src/messages.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/execution.h" 8 #include "src/execution.h"
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 #include "src/keys.h" 10 #include "src/keys.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 Handle<Object> CallSite::GetFileName() { 198 Handle<Object> CallSite::GetFileName() {
199 if (!IsJavaScript()) return isolate_->factory()->null_value(); 199 if (!IsJavaScript()) return isolate_->factory()->null_value();
200 Object* script = fun_->shared()->script(); 200 Object* script = fun_->shared()->script();
201 if (!script->IsScript()) return isolate_->factory()->null_value(); 201 if (!script->IsScript()) return isolate_->factory()->null_value();
202 return Handle<Object>(Script::cast(script)->name(), isolate_); 202 return Handle<Object>(Script::cast(script)->name(), isolate_);
203 } 203 }
204 204
205 205
206 Handle<Object> CallSite::GetFunctionName() { 206 Handle<Object> CallSite::GetFunctionName() {
207 if (IsWasm()) { 207 if (IsWasm()) {
208 MaybeHandle<String> name = 208 return wasm::GetWasmFunctionNameOrNull(isolate_, wasm_obj_,
209 wasm::GetWasmFunctionName(wasm_obj_, wasm_func_index_); 209 wasm_func_index_);
210 if (name.is_null()) return isolate_->factory()->null_value();
211 return name.ToHandleChecked();
212 } 210 }
213 Handle<String> result = JSFunction::GetName(fun_); 211 Handle<String> result = JSFunction::GetName(fun_);
214 if (result->length() != 0) return result; 212 if (result->length() != 0) return result;
215 213
216 Handle<Object> script(fun_->shared()->script(), isolate_); 214 Handle<Object> script(fun_->shared()->script(), isolate_);
217 if (script->IsScript() && 215 if (script->IsScript() &&
218 Handle<Script>::cast(script)->compilation_type() == 216 Handle<Script>::cast(script)->compilation_type() ==
219 Script::COMPILATION_TYPE_EVAL) { 217 Script::COMPILATION_TYPE_EVAL) {
220 return isolate_->factory()->eval_string(); 218 return isolate_->factory()->eval_string();
221 } 219 }
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 builder.AppendCharacter(*c); 441 builder.AppendCharacter(*c);
444 } 442 }
445 } 443 }
446 444
447 return builder.Finish(); 445 return builder.Finish();
448 } 446 }
449 447
450 448
451 } // namespace internal 449 } // namespace internal
452 } // namespace v8 450 } // namespace v8
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/wasm/wasm-function-name-table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698