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

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

Issue 2651833003: [wasm] Move protected instruction info to RelocInfo (Closed)
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/v8/v8 into trap-relocinfo Created 3 years, 10 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/compiler/wasm-compiler.h ('k') | src/compiler/x64/code-generator-x64.cc » ('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 4002 matching lines...) Expand 10 before | Expand all | Expand 10 after
4013 } 4013 }
4014 4014
4015 if (FLAG_trace_wasm_decode_time) { 4015 if (FLAG_trace_wasm_decode_time) {
4016 double compile_ms = compile_timer.Elapsed().InMillisecondsF(); 4016 double compile_ms = compile_timer.Elapsed().InMillisecondsF();
4017 PrintF("wasm-code-generation ok: %d bytes, %0.3f ms code generation\n", 4017 PrintF("wasm-code-generation ok: %d bytes, %0.3f ms code generation\n",
4018 static_cast<int>(function_->code_end_offset - 4018 static_cast<int>(function_->code_end_offset -
4019 function_->code_start_offset), 4019 function_->code_start_offset),
4020 compile_ms); 4020 compile_ms);
4021 } 4021 }
4022 4022
4023 Handle<FixedArray> protected_instructions = PackProtectedInstructions();
4024 code->set_protected_instructions(*protected_instructions);
4025
4026 return code; 4023 return code;
4027 } 4024 }
4028 4025
4029 Handle<FixedArray> WasmCompilationUnit::PackProtectedInstructions() const {
4030 const int num_instructions = static_cast<int>(protected_instructions_.size());
4031 Handle<FixedArray> fn_protected = isolate_->factory()->NewFixedArray(
4032 num_instructions * Code::kTrapDataSize, TENURED);
4033 for (unsigned i = 0; i < protected_instructions_.size(); ++i) {
4034 const trap_handler::ProtectedInstructionData& instruction =
4035 protected_instructions_[i];
4036 fn_protected->set(Code::kTrapDataSize * i + Code::kTrapCodeOffset,
4037 Smi::FromInt(instruction.instr_offset));
4038 fn_protected->set(Code::kTrapDataSize * i + Code::kTrapLandingOffset,
4039 Smi::FromInt(instruction.landing_offset));
4040 }
4041 return fn_protected;
4042 }
4043
4044 } // namespace compiler 4026 } // namespace compiler
4045 } // namespace internal 4027 } // namespace internal
4046 } // namespace v8 4028 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698