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

Side by Side Diff: src/frames.cc

Issue 2493823003: [wasm] Allocate a single script per wasm module (Closed)
Patch Set: rebase Created 4 years, 1 month 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/debug/debug.js ('k') | src/inspector/v8-debugger.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/frames.h" 5 #include "src/frames.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1510 } 1510 }
1511 1511
1512 uint32_t WasmFrame::function_index() const { 1512 uint32_t WasmFrame::function_index() const {
1513 FixedArray* deopt_data = LookupCode()->deoptimization_data(); 1513 FixedArray* deopt_data = LookupCode()->deoptimization_data();
1514 DCHECK(deopt_data->length() == 2); 1514 DCHECK(deopt_data->length() == 2);
1515 return Smi::cast(deopt_data->get(1))->value(); 1515 return Smi::cast(deopt_data->get(1))->value();
1516 } 1516 }
1517 1517
1518 Script* WasmFrame::script() const { 1518 Script* WasmFrame::script() const {
1519 Handle<JSObject> instance(JSObject::cast(wasm_instance()), isolate()); 1519 Handle<JSObject> instance(JSObject::cast(wasm_instance()), isolate());
1520 if (wasm::WasmIsAsmJs(*instance, isolate())) { 1520 return *wasm::GetScript(instance);
1521 return *wasm::GetAsmWasmScript(instance);
1522 }
1523 Handle<WasmDebugInfo> debug_info = wasm::GetDebugInfo(instance);
1524 return WasmDebugInfo::GetFunctionScript(debug_info, function_index());
1525 } 1521 }
1526 1522
1527 int WasmFrame::position() const { 1523 int WasmFrame::position() const {
1528 int position = StandardFrame::position(); 1524 int position = StandardFrame::position();
1529 if (wasm::WasmIsAsmJs(wasm_instance(), isolate())) { 1525 if (wasm::WasmIsAsmJs(wasm_instance(), isolate())) {
1530 Handle<JSObject> instance(JSObject::cast(wasm_instance()), isolate()); 1526 Handle<JSObject> instance(JSObject::cast(wasm_instance()), isolate());
1531 position = 1527 position =
1532 wasm::GetAsmWasmSourcePosition(instance, function_index(), position); 1528 wasm::GetAsmWasmSourcePosition(instance, function_index(), position);
1533 } 1529 }
1534 return position; 1530 return position;
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1974 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { 1970 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) {
1975 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); 1971 StackFrame* frame = AllocateFrameCopy(it.frame(), zone);
1976 list.Add(frame, zone); 1972 list.Add(frame, zone);
1977 } 1973 }
1978 return list.ToVector(); 1974 return list.ToVector();
1979 } 1975 }
1980 1976
1981 1977
1982 } // namespace internal 1978 } // namespace internal
1983 } // namespace v8 1979 } // namespace v8
OLDNEW
« no previous file with comments | « src/debug/debug.js ('k') | src/inspector/v8-debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698