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

Side by Side Diff: src/wasm/ast-decoder.cc

Issue 2256603002: [wasm] Add stack checks at the beginning of each function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Do not trap but use the runtime stack guard call Created 4 years, 4 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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/signature.h" 5 #include "src/signature.h"
6 6
7 #include "src/bit-vector.h" 7 #include "src/bit-vector.h"
8 #include "src/flags.h" 8 #include "src/flags.h"
9 #include "src/handles.h" 9 #include "src/handles.h"
10 #include "src/zone-containers.h" 10 #include "src/zone-containers.h"
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 local_type_vec_[index] == type) { 552 local_type_vec_[index] == type) {
553 // Do a whole run of like-typed locals at a time. 553 // Do a whole run of like-typed locals at a time.
554 ssa_env->locals[index++] = node; 554 ssa_env->locals[index++] = node;
555 } 555 }
556 } 556 }
557 builder_->set_module(module_); 557 builder_->set_module(module_);
558 } 558 }
559 ssa_env->control = start; 559 ssa_env->control = start;
560 ssa_env->effect = start; 560 ssa_env->effect = start;
561 SetEnv("initial", ssa_env); 561 SetEnv("initial", ssa_env);
562 if (builder_) {
titzer 2016/08/17 11:17:23 Will the BUILD() macro work here?
ahaas 2016/08/17 16:12:57 Actually not, because InitStackCheck does not retu
563 builder_->InitStackCheck(position());
564 }
562 } 565 }
563 566
564 TFNode* DefaultValue(LocalType type) { 567 TFNode* DefaultValue(LocalType type) {
565 switch (type) { 568 switch (type) {
566 case kAstI32: 569 case kAstI32:
567 return builder_->Int32Constant(0); 570 return builder_->Int32Constant(0);
568 case kAstI64: 571 case kAstI64:
569 return builder_->Int64Constant(0); 572 return builder_->Int64Constant(0);
570 case kAstF32: 573 case kAstF32:
571 return builder_->Float32Constant(0); 574 return builder_->Float32Constant(0);
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1849 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, 1852 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals,
1850 const byte* start, const byte* end) { 1853 const byte* start, const byte* end) {
1851 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; 1854 FunctionBody body = {nullptr, nullptr, nullptr, start, end};
1852 WasmFullDecoder decoder(zone, nullptr, body); 1855 WasmFullDecoder decoder(zone, nullptr, body);
1853 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); 1856 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals);
1854 } 1857 }
1855 1858
1856 } // namespace wasm 1859 } // namespace wasm
1857 } // namespace internal 1860 } // namespace internal
1858 } // namespace v8 1861 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698