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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
10 | 10 |
(...skipping 2139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2150 { | 2150 { |
2151 Node* load_sig = graph()->NewNode( | 2151 Node* load_sig = graph()->NewNode( |
2152 machine->Load(MachineType::AnyTagged()), table, | 2152 machine->Load(MachineType::AnyTagged()), table, |
2153 graph()->NewNode(machine->Int32Add(), | 2153 graph()->NewNode(machine->Int32Add(), |
2154 graph()->NewNode(machine->Word32Shl(), key, | 2154 graph()->NewNode(machine->Word32Shl(), key, |
2155 Int32Constant(kPointerSizeLog2)), | 2155 Int32Constant(kPointerSizeLog2)), |
2156 Int32Constant(fixed_offset)), | 2156 Int32Constant(fixed_offset)), |
2157 *effect_, *control_); | 2157 *effect_, *control_); |
2158 int32_t key = module_->module->function_tables[0].map.Find(sig); | 2158 int32_t key = module_->module->function_tables[0].map.Find(sig); |
2159 DCHECK_GE(key, 0); | 2159 DCHECK_GE(key, 0); |
2160 Node* sig_match = | 2160 Node* sig_match = graph()->NewNode(machine->WordEqual(), load_sig, |
Mircea Trofin
2016/10/15 17:38:39
Is this related, or can it be a separate CL?
| |
2161 graph()->NewNode(machine->Word32Equal(), | 2161 jsgraph()->SmiConstant(key)); |
2162 BuildChangeSmiToInt32(load_sig), Int32Constant(key)); | |
2163 trap_->AddTrapIfFalse(wasm::kTrapFuncSigMismatch, sig_match, position); | 2162 trap_->AddTrapIfFalse(wasm::kTrapFuncSigMismatch, sig_match, position); |
2164 } | 2163 } |
2165 | 2164 |
2166 // Load code object from the table. | 2165 // Load code object from the table. |
2167 uint32_t offset = fixed_offset + kPointerSize * table_size; | 2166 uint32_t offset = fixed_offset + kPointerSize * table_size; |
2168 Node* load_code = graph()->NewNode( | 2167 Node* load_code = graph()->NewNode( |
2169 machine->Load(MachineType::AnyTagged()), table, | 2168 machine->Load(MachineType::AnyTagged()), table, |
2170 graph()->NewNode(machine->Int32Add(), | 2169 graph()->NewNode(machine->Int32Add(), |
2171 graph()->NewNode(machine->Word32Shl(), key, | 2170 graph()->NewNode(machine->Word32Shl(), key, |
2172 Int32Constant(kPointerSizeLog2)), | 2171 Int32Constant(kPointerSizeLog2)), |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3416 function_->code_start_offset), | 3415 function_->code_start_offset), |
3417 compile_ms); | 3416 compile_ms); |
3418 } | 3417 } |
3419 | 3418 |
3420 return code; | 3419 return code; |
3421 } | 3420 } |
3422 | 3421 |
3423 } // namespace compiler | 3422 } // namespace compiler |
3424 } // namespace internal | 3423 } // namespace internal |
3425 } // namespace v8 | 3424 } // namespace v8 |
OLD | NEW |