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

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

Issue 1689573004: [interpreter] Support for ES6 super keyword. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix super stores following redux. Created 4 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
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 #include "src/compiler.h" 6 #include "src/compiler.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace interpreter { 10 namespace interpreter {
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 Output(bytecode, static_cast<uint8_t>(name_index)); 477 Output(bytecode, static_cast<uint8_t>(name_index));
478 } else if (FitsInIdx16Operand(name_index)) { 478 } else if (FitsInIdx16Operand(name_index)) {
479 Output(BytecodeForWideOperands(bytecode), 479 Output(BytecodeForWideOperands(bytecode),
480 static_cast<uint16_t>(name_index)); 480 static_cast<uint16_t>(name_index));
481 } else { 481 } else {
482 UNIMPLEMENTED(); 482 UNIMPLEMENTED();
483 } 483 }
484 return *this; 484 return *this;
485 } 485 }
486 486
487
488 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty( 487 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty(
489 Register object, const Handle<String> name, int feedback_slot, 488 Register object, const Handle<Name> name, int feedback_slot,
490 LanguageMode language_mode) { 489 LanguageMode language_mode) {
491 Bytecode bytecode = BytecodeForLoadIC(language_mode); 490 Bytecode bytecode = BytecodeForLoadIC(language_mode);
492 size_t name_index = GetConstantPoolEntry(name); 491 size_t name_index = GetConstantPoolEntry(name);
493 if (FitsInIdx8Operand(name_index) && FitsInIdx8Operand(feedback_slot)) { 492 if (FitsInIdx8Operand(name_index) && FitsInIdx8Operand(feedback_slot)) {
494 Output(bytecode, object.ToRawOperand(), static_cast<uint8_t>(name_index), 493 Output(bytecode, object.ToRawOperand(), static_cast<uint8_t>(name_index),
495 static_cast<uint8_t>(feedback_slot)); 494 static_cast<uint8_t>(feedback_slot));
496 } else if (FitsInIdx16Operand(name_index) && 495 } else if (FitsInIdx16Operand(name_index) &&
497 FitsInIdx16Operand(feedback_slot)) { 496 FitsInIdx16Operand(feedback_slot)) {
498 Output(BytecodeForWideOperands(bytecode), object.ToRawOperand(), 497 Output(BytecodeForWideOperands(bytecode), object.ToRawOperand(),
499 static_cast<uint16_t>(name_index), 498 static_cast<uint16_t>(name_index),
(...skipping 13 matching lines...) Expand all
513 static_cast<uint8_t>(feedback_slot)); 512 static_cast<uint8_t>(feedback_slot));
514 } else if (FitsInIdx16Operand(feedback_slot)) { 513 } else if (FitsInIdx16Operand(feedback_slot)) {
515 Output(BytecodeForWideOperands(bytecode), object.ToRawOperand(), 514 Output(BytecodeForWideOperands(bytecode), object.ToRawOperand(),
516 static_cast<uint16_t>(feedback_slot)); 515 static_cast<uint16_t>(feedback_slot));
517 } else { 516 } else {
518 UNIMPLEMENTED(); 517 UNIMPLEMENTED();
519 } 518 }
520 return *this; 519 return *this;
521 } 520 }
522 521
523
524 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreNamedProperty( 522 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreNamedProperty(
525 Register object, const Handle<String> name, int feedback_slot, 523 Register object, const Handle<Name> name, int feedback_slot,
526 LanguageMode language_mode) { 524 LanguageMode language_mode) {
527 Bytecode bytecode = BytecodeForStoreIC(language_mode); 525 Bytecode bytecode = BytecodeForStoreIC(language_mode);
528 size_t name_index = GetConstantPoolEntry(name); 526 size_t name_index = GetConstantPoolEntry(name);
529 if (FitsInIdx8Operand(name_index) && FitsInIdx8Operand(feedback_slot)) { 527 if (FitsInIdx8Operand(name_index) && FitsInIdx8Operand(feedback_slot)) {
530 Output(bytecode, object.ToRawOperand(), static_cast<uint8_t>(name_index), 528 Output(bytecode, object.ToRawOperand(), static_cast<uint8_t>(name_index),
531 static_cast<uint8_t>(feedback_slot)); 529 static_cast<uint8_t>(feedback_slot));
532 } else if (FitsInIdx16Operand(name_index) && 530 } else if (FitsInIdx16Operand(name_index) &&
533 FitsInIdx16Operand(feedback_slot)) { 531 FitsInIdx16Operand(feedback_slot)) {
534 Output(BytecodeForWideOperands(bytecode), object.ToRawOperand(), 532 Output(BytecodeForWideOperands(bytecode), object.ToRawOperand(),
535 static_cast<uint16_t>(name_index), 533 static_cast<uint16_t>(name_index),
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 Output(Bytecode::kCallWide, callable.ToRawOperand(), 1099 Output(Bytecode::kCallWide, callable.ToRawOperand(),
1102 receiver_args.ToRawOperand(), 1100 receiver_args.ToRawOperand(),
1103 static_cast<uint16_t>(receiver_args_count), 1101 static_cast<uint16_t>(receiver_args_count),
1104 static_cast<uint16_t>(feedback_slot)); 1102 static_cast<uint16_t>(feedback_slot));
1105 } else { 1103 } else {
1106 UNIMPLEMENTED(); 1104 UNIMPLEMENTED();
1107 } 1105 }
1108 return *this; 1106 return *this;
1109 } 1107 }
1110 1108
1111
1112 BytecodeArrayBuilder& BytecodeArrayBuilder::New(Register constructor, 1109 BytecodeArrayBuilder& BytecodeArrayBuilder::New(Register constructor,
1113 Register first_arg, 1110 Register first_arg,
1114 size_t arg_count) { 1111 size_t arg_count) {
1115 if (!first_arg.is_valid()) { 1112 if (!first_arg.is_valid()) {
1116 DCHECK_EQ(0u, arg_count); 1113 DCHECK_EQ(0u, arg_count);
1117 first_arg = Register(0); 1114 first_arg = Register(0);
1118 } 1115 }
1119 if (FitsInReg8Operand(constructor) && FitsInReg8Operand(first_arg) && 1116 if (FitsInReg8Operand(constructor) && FitsInReg8Operand(first_arg) &&
1120 FitsInIdx8Operand(arg_count)) { 1117 FitsInIdx8Operand(arg_count)) {
1121 Output(Bytecode::kNew, constructor.ToRawOperand(), first_arg.ToRawOperand(), 1118 Output(Bytecode::kNew, constructor.ToRawOperand(), first_arg.ToRawOperand(),
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
1692 } 1689 }
1693 1690
1694 // static 1691 // static
1695 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) { 1692 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) {
1696 return value.is_short_operand(); 1693 return value.is_short_operand();
1697 } 1694 }
1698 1695
1699 } // namespace interpreter 1696 } // namespace interpreter
1700 } // namespace internal 1697 } // namespace internal
1701 } // namespace v8 1698 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698