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

Side by Side Diff: src/frames.cc

Issue 2378773013: [WASM] Implements catch for the wasm low level exception mechanism. (Closed)
Patch Set: updates effect dependencies. Created 4 years, 2 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
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 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 DCHECK(deopt_data->length() == 2); 1470 DCHECK(deopt_data->length() == 2);
1471 return Smi::cast(deopt_data->get(1))->value(); 1471 return Smi::cast(deopt_data->get(1))->value();
1472 } 1472 }
1473 1473
1474 Script* WasmFrame::script() const { 1474 Script* WasmFrame::script() const {
1475 Handle<JSObject> wasm(JSObject::cast(wasm_obj()), isolate()); 1475 Handle<JSObject> wasm(JSObject::cast(wasm_obj()), isolate());
1476 Handle<wasm::WasmDebugInfo> debug_info = wasm::GetDebugInfo(wasm); 1476 Handle<wasm::WasmDebugInfo> debug_info = wasm::GetDebugInfo(wasm);
1477 return wasm::WasmDebugInfo::GetFunctionScript(debug_info, function_index()); 1477 return wasm::WasmDebugInfo::GetFunctionScript(debug_info, function_index());
1478 } 1478 }
1479 1479
1480 int WasmFrame::LookupExceptionHandlerInTable(int* stack_slots) {
1481 DCHECK_NOT_NULL(stack_slots);
1482 Code* code = LookupCode();
1483 HandlerTable* table = HandlerTable::cast(code->handler_table());
1484 int pc_offset = static_cast<int>(pc() - code->entry());
1485 *stack_slots = code->stack_slots();
1486 return table->LookupReturn(pc_offset);
1487 }
1488
1480 namespace { 1489 namespace {
1481 1490
1482 1491
1483 void PrintFunctionSource(StringStream* accumulator, SharedFunctionInfo* shared, 1492 void PrintFunctionSource(StringStream* accumulator, SharedFunctionInfo* shared,
1484 Code* code) { 1493 Code* code) {
1485 if (FLAG_max_stack_trace_source_length != 0 && code != NULL) { 1494 if (FLAG_max_stack_trace_source_length != 0 && code != NULL) {
1486 std::ostringstream os; 1495 std::ostringstream os;
1487 os << "--------- s o u r c e c o d e ---------\n" 1496 os << "--------- s o u r c e c o d e ---------\n"
1488 << SourceCodeOf(shared, FLAG_max_stack_trace_source_length) 1497 << SourceCodeOf(shared, FLAG_max_stack_trace_source_length)
1489 << "\n-----------------------------------------\n"; 1498 << "\n-----------------------------------------\n";
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1908 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { 1917 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) {
1909 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); 1918 StackFrame* frame = AllocateFrameCopy(it.frame(), zone);
1910 list.Add(frame, zone); 1919 list.Add(frame, zone);
1911 } 1920 }
1912 return list.ToVector(); 1921 return list.ToVector();
1913 } 1922 }
1914 1923
1915 1924
1916 } // namespace internal 1925 } // namespace internal
1917 } // namespace v8 1926 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698