| 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 1903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1914 ElementAccess access = AccessBuilder::ForFixedArrayElement(); | 1914 ElementAccess access = AccessBuilder::ForFixedArrayElement(); |
| 1915 const int fixed_offset = access.header_size - access.tag(); | 1915 const int fixed_offset = access.header_size - access.tag(); |
| 1916 { | 1916 { |
| 1917 Node* load_sig = graph()->NewNode( | 1917 Node* load_sig = graph()->NewNode( |
| 1918 machine->Load(MachineType::AnyTagged()), table, | 1918 machine->Load(MachineType::AnyTagged()), table, |
| 1919 graph()->NewNode(machine->Int32Add(), | 1919 graph()->NewNode(machine->Int32Add(), |
| 1920 graph()->NewNode(machine->Word32Shl(), key, | 1920 graph()->NewNode(machine->Word32Shl(), key, |
| 1921 Int32Constant(kPointerSizeLog2)), | 1921 Int32Constant(kPointerSizeLog2)), |
| 1922 Int32Constant(fixed_offset)), | 1922 Int32Constant(fixed_offset)), |
| 1923 *effect_, *control_); | 1923 *effect_, *control_); |
| 1924 Node* sig_match = graph()->NewNode(machine->WordEqual(), load_sig, | 1924 Node* sig_match = |
| 1925 jsgraph()->SmiConstant(index)); | 1925 graph()->NewNode(machine->Word32Equal(), |
| 1926 BuildChangeSmiToInt32(load_sig), Int32Constant(index)); |
| 1926 trap_->AddTrapIfFalse(wasm::kTrapFuncSigMismatch, sig_match, position); | 1927 trap_->AddTrapIfFalse(wasm::kTrapFuncSigMismatch, sig_match, position); |
| 1927 } | 1928 } |
| 1928 | 1929 |
| 1929 // Load code object from the table. | 1930 // Load code object from the table. |
| 1930 int offset = fixed_offset + kPointerSize * table_size; | 1931 int offset = fixed_offset + kPointerSize * table_size; |
| 1931 Node* load_code = graph()->NewNode( | 1932 Node* load_code = graph()->NewNode( |
| 1932 machine->Load(MachineType::AnyTagged()), table, | 1933 machine->Load(MachineType::AnyTagged()), table, |
| 1933 graph()->NewNode(machine->Int32Add(), | 1934 graph()->NewNode(machine->Int32Add(), |
| 1934 graph()->NewNode(machine->Word32Shl(), key, | 1935 graph()->NewNode(machine->Word32Shl(), key, |
| 1935 Int32Constant(kPointerSizeLog2)), | 1936 Int32Constant(kPointerSizeLog2)), |
| (...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3270 function_->code_start_offset), | 3271 function_->code_start_offset), |
| 3271 compile_ms); | 3272 compile_ms); |
| 3272 } | 3273 } |
| 3273 | 3274 |
| 3274 return code; | 3275 return code; |
| 3275 } | 3276 } |
| 3276 | 3277 |
| 3277 } // namespace compiler | 3278 } // namespace compiler |
| 3278 } // namespace internal | 3279 } // namespace internal |
| 3279 } // namespace v8 | 3280 } // namespace v8 |
| OLD | NEW |