| Index: src/interpreter/bytecode-array-builder.cc
|
| diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
|
| index 6a6981bd9cdcc4a9c1dde002b4753064dcccbfae..5e7770532d6a67233a82cfc942aec97eb040e895 100644
|
| --- a/src/interpreter/bytecode-array-builder.cc
|
| +++ b/src/interpreter/bytecode-array-builder.cc
|
| @@ -364,11 +364,10 @@ void BytecodeArrayBuilder::MoveRegisterUntranslated(Register from,
|
| }
|
|
|
| BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal(
|
| - const Handle<String> name, int feedback_slot, LanguageMode language_mode,
|
| - TypeofMode typeof_mode) {
|
| - // TODO(rmcilroy): Potentially store language and typeof information in an
|
| + const Handle<String> name, int feedback_slot, TypeofMode typeof_mode) {
|
| + // TODO(rmcilroy): Potentially store typeof information in an
|
| // operand rather than having extra bytecodes.
|
| - Bytecode bytecode = BytecodeForLoadGlobal(language_mode, typeof_mode);
|
| + Bytecode bytecode = BytecodeForLoadGlobal(typeof_mode);
|
| size_t name_index = GetConstantPoolEntry(name);
|
| if (FitsInIdx8Operand(name_index) && FitsInIdx8Operand(feedback_slot)) {
|
| Output(bytecode, static_cast<uint8_t>(name_index),
|
| @@ -468,16 +467,15 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::StoreLookupSlot(
|
| }
|
|
|
| BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty(
|
| - Register object, const Handle<Name> name, int feedback_slot,
|
| - LanguageMode language_mode) {
|
| - Bytecode bytecode = BytecodeForLoadIC(language_mode);
|
| + Register object, const Handle<Name> name, int feedback_slot) {
|
| size_t name_index = GetConstantPoolEntry(name);
|
| if (FitsInIdx8Operand(name_index) && FitsInIdx8Operand(feedback_slot)) {
|
| - Output(bytecode, object.ToRawOperand(), static_cast<uint8_t>(name_index),
|
| + Output(Bytecode::kLoadIC, object.ToRawOperand(),
|
| + static_cast<uint8_t>(name_index),
|
| static_cast<uint8_t>(feedback_slot));
|
| } else if (FitsInIdx16Operand(name_index) &&
|
| FitsInIdx16Operand(feedback_slot)) {
|
| - Output(BytecodeForWideOperands(bytecode), object.ToRawOperand(),
|
| + Output(Bytecode::kLoadICWide, object.ToRawOperand(),
|
| static_cast<uint16_t>(name_index),
|
| static_cast<uint16_t>(feedback_slot));
|
| } else {
|
| @@ -486,15 +484,13 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty(
|
| return *this;
|
| }
|
|
|
| -
|
| BytecodeArrayBuilder& BytecodeArrayBuilder::LoadKeyedProperty(
|
| - Register object, int feedback_slot, LanguageMode language_mode) {
|
| - Bytecode bytecode = BytecodeForKeyedLoadIC(language_mode);
|
| + Register object, int feedback_slot) {
|
| if (FitsInIdx8Operand(feedback_slot)) {
|
| - Output(bytecode, object.ToRawOperand(),
|
| + Output(Bytecode::kKeyedLoadIC, object.ToRawOperand(),
|
| static_cast<uint8_t>(feedback_slot));
|
| } else if (FitsInIdx16Operand(feedback_slot)) {
|
| - Output(BytecodeForWideOperands(bytecode), object.ToRawOperand(),
|
| + Output(Bytecode::kKeyedLoadICWide, object.ToRawOperand(),
|
| static_cast<uint16_t>(feedback_slot));
|
| } else {
|
| UNIMPLEMENTED();
|
| @@ -1429,14 +1425,10 @@ Bytecode BytecodeArrayBuilder::BytecodeForCompareOperation(Token::Value op) {
|
| // static
|
| Bytecode BytecodeArrayBuilder::BytecodeForWideOperands(Bytecode bytecode) {
|
| switch (bytecode) {
|
| - case Bytecode::kLoadICSloppy:
|
| - return Bytecode::kLoadICSloppyWide;
|
| - case Bytecode::kLoadICStrict:
|
| - return Bytecode::kLoadICStrictWide;
|
| - case Bytecode::kKeyedLoadICSloppy:
|
| - return Bytecode::kKeyedLoadICSloppyWide;
|
| - case Bytecode::kKeyedLoadICStrict:
|
| - return Bytecode::kKeyedLoadICStrictWide;
|
| + case Bytecode::kLoadIC:
|
| + return Bytecode::kLoadICWide;
|
| + case Bytecode::kKeyedLoadIC:
|
| + return Bytecode::kKeyedLoadICWide;
|
| case Bytecode::kStoreICSloppy:
|
| return Bytecode::kStoreICSloppyWide;
|
| case Bytecode::kStoreICStrict:
|
| @@ -1445,14 +1437,10 @@ Bytecode BytecodeArrayBuilder::BytecodeForWideOperands(Bytecode bytecode) {
|
| return Bytecode::kKeyedStoreICSloppyWide;
|
| case Bytecode::kKeyedStoreICStrict:
|
| return Bytecode::kKeyedStoreICStrictWide;
|
| - case Bytecode::kLdaGlobalSloppy:
|
| - return Bytecode::kLdaGlobalSloppyWide;
|
| - case Bytecode::kLdaGlobalStrict:
|
| - return Bytecode::kLdaGlobalStrictWide;
|
| - case Bytecode::kLdaGlobalInsideTypeofSloppy:
|
| - return Bytecode::kLdaGlobalInsideTypeofSloppyWide;
|
| - case Bytecode::kLdaGlobalInsideTypeofStrict:
|
| - return Bytecode::kLdaGlobalInsideTypeofStrictWide;
|
| + case Bytecode::kLdaGlobal:
|
| + return Bytecode::kLdaGlobalWide;
|
| + case Bytecode::kLdaGlobalInsideTypeof:
|
| + return Bytecode::kLdaGlobalInsideTypeofWide;
|
| case Bytecode::kStaGlobalSloppy:
|
| return Bytecode::kStaGlobalSloppyWide;
|
| case Bytecode::kStaGlobalStrict:
|
| @@ -1473,39 +1461,6 @@ Bytecode BytecodeArrayBuilder::BytecodeForWideOperands(Bytecode bytecode) {
|
|
|
|
|
| // static
|
| -Bytecode BytecodeArrayBuilder::BytecodeForLoadIC(LanguageMode language_mode) {
|
| - switch (language_mode) {
|
| - case SLOPPY:
|
| - return Bytecode::kLoadICSloppy;
|
| - case STRICT:
|
| - return Bytecode::kLoadICStrict;
|
| - case STRONG:
|
| - UNIMPLEMENTED();
|
| - default:
|
| - UNREACHABLE();
|
| - }
|
| - return static_cast<Bytecode>(-1);
|
| -}
|
| -
|
| -
|
| -// static
|
| -Bytecode BytecodeArrayBuilder::BytecodeForKeyedLoadIC(
|
| - LanguageMode language_mode) {
|
| - switch (language_mode) {
|
| - case SLOPPY:
|
| - return Bytecode::kKeyedLoadICSloppy;
|
| - case STRICT:
|
| - return Bytecode::kKeyedLoadICStrict;
|
| - case STRONG:
|
| - UNIMPLEMENTED();
|
| - default:
|
| - UNREACHABLE();
|
| - }
|
| - return static_cast<Bytecode>(-1);
|
| -}
|
| -
|
| -
|
| -// static
|
| Bytecode BytecodeArrayBuilder::BytecodeForStoreIC(LanguageMode language_mode) {
|
| switch (language_mode) {
|
| case SLOPPY:
|
| @@ -1539,23 +1494,9 @@ Bytecode BytecodeArrayBuilder::BytecodeForKeyedStoreIC(
|
|
|
|
|
| // static
|
| -Bytecode BytecodeArrayBuilder::BytecodeForLoadGlobal(LanguageMode language_mode,
|
| - TypeofMode typeof_mode) {
|
| - switch (language_mode) {
|
| - case SLOPPY:
|
| - return typeof_mode == INSIDE_TYPEOF
|
| - ? Bytecode::kLdaGlobalInsideTypeofSloppy
|
| - : Bytecode::kLdaGlobalSloppy;
|
| - case STRICT:
|
| - return typeof_mode == INSIDE_TYPEOF
|
| - ? Bytecode::kLdaGlobalInsideTypeofStrict
|
| - : Bytecode::kLdaGlobalStrict;
|
| - case STRONG:
|
| - UNIMPLEMENTED();
|
| - default:
|
| - UNREACHABLE();
|
| - }
|
| - return static_cast<Bytecode>(-1);
|
| +Bytecode BytecodeArrayBuilder::BytecodeForLoadGlobal(TypeofMode typeof_mode) {
|
| + return typeof_mode == INSIDE_TYPEOF ? Bytecode::kLdaGlobalInsideTypeof
|
| + : Bytecode::kLdaGlobal;
|
| }
|
|
|
|
|
|
|