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

Side by Side Diff: src/interpreter/bytecode-array-builder.h

Issue 1413703007: [Interpreter] Fix a register allocation bug and add a DCHECK. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rename function Created 5 years, 1 month 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 | « no previous file | src/interpreter/bytecode-array-builder.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 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ 5 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_
6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ 6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "src/ast.h" 10 #include "src/ast.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 // using result scopes as far as possible. 309 // using result scopes as far as possible.
310 class TemporaryRegisterScope { 310 class TemporaryRegisterScope {
311 public: 311 public:
312 explicit TemporaryRegisterScope(BytecodeArrayBuilder* builder); 312 explicit TemporaryRegisterScope(BytecodeArrayBuilder* builder);
313 ~TemporaryRegisterScope(); 313 ~TemporaryRegisterScope();
314 Register NewRegister(); 314 Register NewRegister();
315 315
316 void PrepareForConsecutiveAllocations(size_t count); 316 void PrepareForConsecutiveAllocations(size_t count);
317 Register NextConsecutiveRegister(); 317 Register NextConsecutiveRegister();
318 318
319 bool RegisterIsAllocatedInThisScope(Register reg) const;
320
319 private: 321 private:
320 void* operator new(size_t size); 322 void* operator new(size_t size);
321 void operator delete(void* p); 323 void operator delete(void* p);
322 324
323 BytecodeArrayBuilder* builder_; 325 BytecodeArrayBuilder* builder_;
324 const TemporaryRegisterScope* outer_; 326 const TemporaryRegisterScope* outer_;
325 ZoneVector<int> allocated_; 327 ZoneVector<int> allocated_;
326 int next_consecutive_register_; 328 int next_consecutive_register_;
327 int next_consecutive_count_; 329 int next_consecutive_count_;
328 330
329 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); 331 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope);
330 }; 332 };
331 333
332 334
333 } // namespace interpreter 335 } // namespace interpreter
334 } // namespace internal 336 } // namespace internal
335 } // namespace v8 337 } // namespace v8
336 338
337 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ 339 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_
OLDNEW
« no previous file with comments | « no previous file | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698