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

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

Issue 1874383002: [wasm] Throw real Error on wasm trap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@trapreasons-to-messages
Patch Set: Created 4 years, 8 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/runtime/runtime.h ('k') | test/mjsunit/wasm/unreachable.js » ('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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/ast/prettyprinter.h" 8 #include "src/ast/prettyprinter.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 return isolate->ReThrow(args[0]); 89 return isolate->ReThrow(args[0]);
90 } 90 }
91 91
92 92
93 RUNTIME_FUNCTION(Runtime_ThrowStackOverflow) { 93 RUNTIME_FUNCTION(Runtime_ThrowStackOverflow) {
94 SealHandleScope shs(isolate); 94 SealHandleScope shs(isolate);
95 DCHECK_LE(0, args.length()); 95 DCHECK_LE(0, args.length());
96 return isolate->StackOverflow(); 96 return isolate->StackOverflow();
97 } 97 }
98 98
99 RUNTIME_FUNCTION(Runtime_ThrowWasmError) {
100 HandleScope scope(isolate);
101 DCHECK(args.length() == 1);
Michael Starzinger 2016/04/11 18:13:26 nit: I know we are inconsistent, but lets use "DCH
Clemens Hammacher 2016/04/12 09:33:44 Sure, didn't see that.
102 CONVERT_SMI_ARG_CHECKED(message_id, 0);
103 // TODO(clemensh): discuss with titzer whether a WasmError class would make
104 // sense here
105 Handle<Object> exception = isolate->factory()->NewError(
106 static_cast<MessageTemplate::Template>(message_id));
107 return isolate->Throw(*exception);
Michael Starzinger 2016/04/11 18:13:26 nit: This can also be written as ... THROW_NEW_ER
Clemens Hammacher 2016/04/12 09:33:44 and that's considered nicer? ;) but OK, I changed
Michael Starzinger 2016/04/12 10:47:56 We can discuss which version is nicer and change t
108 }
99 109
100 RUNTIME_FUNCTION(Runtime_UnwindAndFindExceptionHandler) { 110 RUNTIME_FUNCTION(Runtime_UnwindAndFindExceptionHandler) {
101 SealHandleScope shs(isolate); 111 SealHandleScope shs(isolate);
102 DCHECK(args.length() == 0); 112 DCHECK(args.length() == 0);
103 return isolate->UnwindAndFindHandler(); 113 return isolate->UnwindAndFindHandler();
104 } 114 }
105 115
106 116
107 RUNTIME_FUNCTION(Runtime_PromoteScheduledException) { 117 RUNTIME_FUNCTION(Runtime_PromoteScheduledException) {
108 SealHandleScope shs(isolate); 118 SealHandleScope shs(isolate);
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 std::stringstream stats_stream; 494 std::stringstream stats_stream;
485 isolate->counters()->runtime_call_stats()->Print(stats_stream); 495 isolate->counters()->runtime_call_stats()->Print(stats_stream);
486 Handle<String> result = 496 Handle<String> result =
487 isolate->factory()->NewStringFromAsciiChecked(stats_stream.str().c_str()); 497 isolate->factory()->NewStringFromAsciiChecked(stats_stream.str().c_str());
488 isolate->counters()->runtime_call_stats()->Reset(); 498 isolate->counters()->runtime_call_stats()->Reset();
489 return *result; 499 return *result;
490 } 500 }
491 501
492 } // namespace internal 502 } // namespace internal
493 } // namespace v8 503 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/wasm/unreachable.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698