OLD | NEW |
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 "src/isolate-inl.h" | 7 #include "src/isolate-inl.h" |
8 | 8 |
9 #include "src/base/platform/elapsed-timer.h" | 9 #include "src/base/platform/elapsed-timer.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // Create trap code for the first time this trap is used. | 191 // Create trap code for the first time this trap is used. |
192 return BuildTrapCode(reason); | 192 return BuildTrapCode(reason); |
193 } | 193 } |
194 // Connect the current control and effect to the existing trap code. | 194 // Connect the current control and effect to the existing trap code. |
195 builder_->AppendToMerge(traps_[reason], builder_->Control()); | 195 builder_->AppendToMerge(traps_[reason], builder_->Control()); |
196 builder_->AppendToPhi(traps_[reason], effects_[reason], builder_->Effect()); | 196 builder_->AppendToPhi(traps_[reason], effects_[reason], builder_->Effect()); |
197 } | 197 } |
198 | 198 |
199 void BuildTrapCode(wasm::TrapReason reason) { | 199 void BuildTrapCode(wasm::TrapReason reason) { |
200 Node* exception = | 200 Node* exception = |
201 builder_->String(wasm::WasmOpcodes::TrapReasonName(reason)); | 201 builder_->String(wasm::WasmOpcodes::TrapReasonMessage(reason)); |
202 Node* end; | 202 Node* end; |
203 Node** control_ptr = builder_->control_; | 203 Node** control_ptr = builder_->control_; |
204 Node** effect_ptr = builder_->effect_; | 204 Node** effect_ptr = builder_->effect_; |
205 wasm::ModuleEnv* module = builder_->module_; | 205 wasm::ModuleEnv* module = builder_->module_; |
206 *control_ptr = traps_[reason] = | 206 *control_ptr = traps_[reason] = |
207 graph()->NewNode(common()->Merge(1), *control_ptr); | 207 graph()->NewNode(common()->Merge(1), *control_ptr); |
208 *effect_ptr = effects_[reason] = | 208 *effect_ptr = effects_[reason] = |
209 graph()->NewNode(common()->EffectPhi(1), *effect_ptr, *control_ptr); | 209 graph()->NewNode(common()->EffectPhi(1), *effect_ptr, *control_ptr); |
210 | 210 |
211 if (module && !module->instance->context.is_null()) { | 211 if (module && !module->instance->context.is_null()) { |
(...skipping 2566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2778 static_cast<int>(function.code_end_offset - function.code_start_offset), | 2778 static_cast<int>(function.code_end_offset - function.code_start_offset), |
2779 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms); | 2779 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms); |
2780 } | 2780 } |
2781 return code; | 2781 return code; |
2782 } | 2782 } |
2783 | 2783 |
2784 | 2784 |
2785 } // namespace compiler | 2785 } // namespace compiler |
2786 } // namespace internal | 2786 } // namespace internal |
2787 } // namespace v8 | 2787 } // namespace v8 |
OLD | NEW |