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/interpreter/bytecode-array-writer.cc

Issue 2167763003: [Interpreter] Avoid allocating pairs array in VisitDeclarations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_merge_binary
Patch Set: Created 4 years, 5 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
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/interpreter/bytecode-array-writer.h" 5 #include "src/interpreter/bytecode-array-writer.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/interpreter/bytecode-label.h" 8 #include "src/interpreter/bytecode-label.h"
9 #include "src/interpreter/bytecode-register.h" 9 #include "src/interpreter/bytecode-register.h"
10 #include "src/interpreter/constant-array-builder.h" 10 #include "src/interpreter/constant-array-builder.h"
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 } else { 362 } else {
363 // The label has not yet been bound so this is a forward reference 363 // The label has not yet been bound so this is a forward reference
364 // that will be patched when the label is bound. We create a 364 // that will be patched when the label is bound. We create a
365 // reservation in the constant pool so the jump can be patched 365 // reservation in the constant pool so the jump can be patched
366 // when the label is bound. The reservation means the maximum size 366 // when the label is bound. The reservation means the maximum size
367 // of the operand for the constant is known and the jump can 367 // of the operand for the constant is known and the jump can
368 // be emitted into the bytecode stream with space for the operand. 368 // be emitted into the bytecode stream with space for the operand.
369 unbound_jumps_++; 369 unbound_jumps_++;
370 label->set_referrer(current_offset); 370 label->set_referrer(current_offset);
371 OperandSize reserved_operand_size = 371 OperandSize reserved_operand_size =
372 constant_array_builder()->CreateReservedEntry(); 372 constant_array_builder()->CreateDiscardableReservedEntry();
373 switch (reserved_operand_size) { 373 switch (reserved_operand_size) {
374 case OperandSize::kNone: 374 case OperandSize::kNone:
375 UNREACHABLE(); 375 UNREACHABLE();
376 break; 376 break;
377 case OperandSize::kByte: 377 case OperandSize::kByte:
378 node->set_bytecode(node->bytecode(), k8BitJumpPlaceholder); 378 node->set_bytecode(node->bytecode(), k8BitJumpPlaceholder);
379 break; 379 break;
380 case OperandSize::kShort: 380 case OperandSize::kShort:
381 node->set_bytecode(node->bytecode(), k16BitJumpPlaceholder); 381 node->set_bytecode(node->bytecode(), k16BitJumpPlaceholder);
382 break; 382 break;
383 case OperandSize::kQuad: 383 case OperandSize::kQuad:
384 node->set_bytecode(node->bytecode(), k32BitJumpPlaceholder); 384 node->set_bytecode(node->bytecode(), k32BitJumpPlaceholder);
385 break; 385 break;
386 } 386 }
387 } 387 }
388 EmitBytecode(node); 388 EmitBytecode(node);
389 } 389 }
390 390
391 } // namespace interpreter 391 } // namespace interpreter
392 } // namespace internal 392 } // namespace internal
393 } // namespace v8 393 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698