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

Side by Side Diff: courgette/program_detector.cc

Issue 1935203002: [Courgette] Using LabelManager to reduce Courgette-apply peak RAM by 25%. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync. Created 4 years, 7 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 | « courgette/label_manager.cc ('k') | courgette/rel32_finder_win32_x86.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium 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 "courgette/program_detector.h" 5 #include "courgette/program_detector.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "courgette/assembly_program.h" 9 #include "courgette/assembly_program.h"
10 #include "courgette/disassembler.h" 10 #include "courgette/disassembler.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 DetectDisassembler(buffer, length)); 71 DetectDisassembler(buffer, length));
72 if (!disassembler) 72 if (!disassembler)
73 return C_INPUT_NOT_RECOGNIZED; 73 return C_INPUT_NOT_RECOGNIZED;
74 74
75 std::unique_ptr<AssemblyProgram> program( 75 std::unique_ptr<AssemblyProgram> program(
76 new AssemblyProgram(disassembler->kind())); 76 new AssemblyProgram(disassembler->kind()));
77 77
78 if (!disassembler->Disassemble(program.get())) 78 if (!disassembler->Disassemble(program.get()))
79 return C_DISASSEMBLY_FAILED; 79 return C_DISASSEMBLY_FAILED;
80 80
81 if (!program->TrimLabels())
82 return C_TRIM_FAILED;
83
84 *output = std::move(program); 81 *output = std::move(program);
85 return C_OK; 82 return C_OK;
86 } 83 }
87 84
88 } // namespace courgette 85 } // namespace courgette
OLDNEW
« no previous file with comments | « courgette/label_manager.cc ('k') | courgette/rel32_finder_win32_x86.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698