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

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

Issue 1555063002: [Interpreter] Adds support for wide variant of load/store lookup slots. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Updated tests to address review comments. Created 4 years, 11 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/bytecode-graph-builder.cc ('k') | src/interpreter/bytecodes.h » ('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/interpreter/bytecode-array-builder.h" 5 #include "src/interpreter/bytecode-array-builder.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 namespace interpreter { 9 namespace interpreter {
10 10
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 445
446 446
447 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupSlot( 447 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupSlot(
448 const Handle<String> name, TypeofMode typeof_mode) { 448 const Handle<String> name, TypeofMode typeof_mode) {
449 Bytecode bytecode = (typeof_mode == INSIDE_TYPEOF) 449 Bytecode bytecode = (typeof_mode == INSIDE_TYPEOF)
450 ? Bytecode::kLdaLookupSlotInsideTypeof 450 ? Bytecode::kLdaLookupSlotInsideTypeof
451 : Bytecode::kLdaLookupSlot; 451 : Bytecode::kLdaLookupSlot;
452 size_t name_index = GetConstantPoolEntry(name); 452 size_t name_index = GetConstantPoolEntry(name);
453 if (FitsInIdx8Operand(name_index)) { 453 if (FitsInIdx8Operand(name_index)) {
454 Output(bytecode, static_cast<uint8_t>(name_index)); 454 Output(bytecode, static_cast<uint8_t>(name_index));
455 } else if (FitsInIdx16Operand(name_index)) {
456 Output(BytecodeForWideOperands(bytecode),
457 static_cast<uint16_t>(name_index));
455 } else { 458 } else {
456 UNIMPLEMENTED(); 459 UNIMPLEMENTED();
457 } 460 }
458 return *this; 461 return *this;
459 } 462 }
460 463
461 464
462 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreLookupSlot( 465 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreLookupSlot(
463 const Handle<String> name, LanguageMode language_mode) { 466 const Handle<String> name, LanguageMode language_mode) {
464 Bytecode bytecode = BytecodeForStoreLookupSlot(language_mode); 467 Bytecode bytecode = BytecodeForStoreLookupSlot(language_mode);
465 size_t name_index = GetConstantPoolEntry(name); 468 size_t name_index = GetConstantPoolEntry(name);
466 if (FitsInIdx8Operand(name_index)) { 469 if (FitsInIdx8Operand(name_index)) {
467 Output(bytecode, static_cast<uint8_t>(name_index)); 470 Output(bytecode, static_cast<uint8_t>(name_index));
471 } else if (FitsInIdx16Operand(name_index)) {
472 Output(BytecodeForWideOperands(bytecode),
473 static_cast<uint16_t>(name_index));
468 } else { 474 } else {
469 UNIMPLEMENTED(); 475 UNIMPLEMENTED();
470 } 476 }
471 return *this; 477 return *this;
472 } 478 }
473 479
474 480
475 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty( 481 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty(
476 Register object, const Handle<String> name, int feedback_slot, 482 Register object, const Handle<String> name, int feedback_slot,
477 LanguageMode language_mode) { 483 LanguageMode language_mode) {
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 case Bytecode::kLdaGlobalStrict: 1294 case Bytecode::kLdaGlobalStrict:
1289 return Bytecode::kLdaGlobalStrictWide; 1295 return Bytecode::kLdaGlobalStrictWide;
1290 case Bytecode::kLdaGlobalInsideTypeofSloppy: 1296 case Bytecode::kLdaGlobalInsideTypeofSloppy:
1291 return Bytecode::kLdaGlobalInsideTypeofSloppyWide; 1297 return Bytecode::kLdaGlobalInsideTypeofSloppyWide;
1292 case Bytecode::kLdaGlobalInsideTypeofStrict: 1298 case Bytecode::kLdaGlobalInsideTypeofStrict:
1293 return Bytecode::kLdaGlobalInsideTypeofStrictWide; 1299 return Bytecode::kLdaGlobalInsideTypeofStrictWide;
1294 case Bytecode::kStaGlobalSloppy: 1300 case Bytecode::kStaGlobalSloppy:
1295 return Bytecode::kStaGlobalSloppyWide; 1301 return Bytecode::kStaGlobalSloppyWide;
1296 case Bytecode::kStaGlobalStrict: 1302 case Bytecode::kStaGlobalStrict:
1297 return Bytecode::kStaGlobalStrictWide; 1303 return Bytecode::kStaGlobalStrictWide;
1304 case Bytecode::kLdaLookupSlot:
1305 return Bytecode::kLdaLookupSlotWide;
1306 case Bytecode::kLdaLookupSlotInsideTypeof:
1307 return Bytecode::kLdaLookupSlotInsideTypeofWide;
1308 case Bytecode::kStaLookupSlotStrict:
1309 return Bytecode::kStaLookupSlotStrictWide;
1310 case Bytecode::kStaLookupSlotSloppy:
1311 return Bytecode::kStaLookupSlotSloppyWide;
1298 default: 1312 default:
1299 UNREACHABLE(); 1313 UNREACHABLE();
1300 return static_cast<Bytecode>(-1); 1314 return static_cast<Bytecode>(-1);
1301 } 1315 }
1302 } 1316 }
1303 1317
1304 1318
1305 // static 1319 // static
1306 Bytecode BytecodeArrayBuilder::BytecodeForLoadIC(LanguageMode language_mode) { 1320 Bytecode BytecodeArrayBuilder::BytecodeForLoadIC(LanguageMode language_mode) {
1307 switch (language_mode) { 1321 switch (language_mode) {
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 DCHECK_GT(next_consecutive_count_, 0); 1557 DCHECK_GT(next_consecutive_count_, 0);
1544 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_); 1558 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_);
1545 allocated_.push_back(next_consecutive_register_); 1559 allocated_.push_back(next_consecutive_register_);
1546 next_consecutive_count_--; 1560 next_consecutive_count_--;
1547 return Register(next_consecutive_register_++); 1561 return Register(next_consecutive_register_++);
1548 } 1562 }
1549 1563
1550 } // namespace interpreter 1564 } // namespace interpreter
1551 } // namespace internal 1565 } // namespace internal
1552 } // namespace v8 1566 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/bytecode-graph-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698