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

Side by Side Diff: src/compiler/wasm-compiler.cc

Issue 2609363004: [asm.js] [wasm] Store function start position for stack check (Closed)
Patch Set: It's 2017 already :) Created 3 years, 11 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/asmjs/asm-wasm-builder.cc ('k') | src/runtime/runtime.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 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/compiler/wasm-compiler.h" 5 #include "src/compiler/wasm-compiler.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 10
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 jsgraph()->IntPtrConstant(0), *effect, *control); 481 jsgraph()->IntPtrConstant(0), *effect, *control);
482 Node* pointer = graph()->NewNode(jsgraph()->machine()->LoadStackPointer()); 482 Node* pointer = graph()->NewNode(jsgraph()->machine()->LoadStackPointer());
483 483
484 Node* check = 484 Node* check =
485 graph()->NewNode(jsgraph()->machine()->UintLessThan(), limit, pointer); 485 graph()->NewNode(jsgraph()->machine()->UintLessThan(), limit, pointer);
486 486
487 Diamond stack_check(graph(), jsgraph()->common(), check, BranchHint::kTrue); 487 Diamond stack_check(graph(), jsgraph()->common(), check, BranchHint::kTrue);
488 stack_check.Chain(*control); 488 stack_check.Chain(*control);
489 Node* effect_true = *effect; 489 Node* effect_true = *effect;
490 490
491 Node* effect_false;
492 // Generate a call to the runtime if there is a stack check failure. 491 // Generate a call to the runtime if there is a stack check failure.
493 { 492 Node* call = BuildCallToRuntime(Runtime::kStackGuard, jsgraph(),
494 Node* node = BuildCallToRuntime(Runtime::kStackGuard, jsgraph(), 493 module_->instance->context, nullptr, 0,
495 module_->instance->context, nullptr, 0, 494 effect, stack_check.if_false);
496 effect, stack_check.if_false); 495 SetSourcePosition(call, position);
497 effect_false = node;
498 }
499 496
500 Node* ephi = graph()->NewNode(jsgraph()->common()->EffectPhi(2), 497 Node* ephi = graph()->NewNode(jsgraph()->common()->EffectPhi(2),
501 effect_true, effect_false, stack_check.merge); 498 effect_true, call, stack_check.merge);
502 499
503 *control = stack_check.merge; 500 *control = stack_check.merge;
504 *effect = ephi; 501 *effect = ephi;
505 } 502 }
506 } 503 }
507 504
508 Node* WasmGraphBuilder::Binop(wasm::WasmOpcode opcode, Node* left, Node* right, 505 Node* WasmGraphBuilder::Binop(wasm::WasmOpcode opcode, Node* left, Node* right,
509 wasm::WasmCodePosition position) { 506 wasm::WasmCodePosition position) {
510 const Operator* op; 507 const Operator* op;
511 MachineOperatorBuilder* m = jsgraph()->machine(); 508 MachineOperatorBuilder* m = jsgraph()->machine();
(...skipping 3177 matching lines...) Expand 10 before | Expand all | Expand 10 after
3689 Smi::FromInt(instruction.instr_offset)); 3686 Smi::FromInt(instruction.instr_offset));
3690 fn_protected->set(Code::kTrapDataSize * i + Code::kTrapLandingOffset, 3687 fn_protected->set(Code::kTrapDataSize * i + Code::kTrapLandingOffset,
3691 Smi::FromInt(instruction.landing_offset)); 3688 Smi::FromInt(instruction.landing_offset));
3692 } 3689 }
3693 return fn_protected; 3690 return fn_protected;
3694 } 3691 }
3695 3692
3696 } // namespace compiler 3693 } // namespace compiler
3697 } // namespace internal 3694 } // namespace internal
3698 } // namespace v8 3695 } // namespace v8
OLDNEW
« no previous file with comments | « src/asmjs/asm-wasm-builder.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698