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

Unified Diff: src/compiler/bytecode-graph-builder.cc

Issue 1783483002: [interpreter] Add support for scalable operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Re-generate golden files. Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/debug/debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index aaac61163bf8c5cab1213d622a28979d75e46bc0..abaa7b54c5ef51f065e4d2e5650d197c591fb3f9 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -570,17 +570,11 @@ void BytecodeGraphBuilder::VisitLdaZero() {
environment()->BindAccumulator(node);
}
-void BytecodeGraphBuilder::VisitLdaSmi8() {
+void BytecodeGraphBuilder::VisitLdaSmi() {
Node* node = jsgraph()->Constant(bytecode_iterator().GetImmediateOperand(0));
environment()->BindAccumulator(node);
}
-void BytecodeGraphBuilder::VisitLdaConstantWide() {
- Node* node =
- jsgraph()->Constant(bytecode_iterator().GetConstantForIndexOperand(0));
- environment()->BindAccumulator(node);
-}
-
void BytecodeGraphBuilder::VisitLdaConstant() {
Node* node =
jsgraph()->Constant(bytecode_iterator().GetConstantForIndexOperand(0));
@@ -629,8 +623,6 @@ void BytecodeGraphBuilder::VisitMov() {
environment()->BindRegister(bytecode_iterator().GetRegisterOperand(1), value);
}
-void BytecodeGraphBuilder::VisitMovWide() { VisitMov(); }
-
void BytecodeGraphBuilder::BuildLoadGlobal(
TypeofMode typeof_mode) {
FrameStateBeforeAndAfter states(this);
@@ -652,14 +644,6 @@ void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeof() {
BuildLoadGlobal(TypeofMode::INSIDE_TYPEOF);
}
-void BytecodeGraphBuilder::VisitLdaGlobalWide() {
- BuildLoadGlobal(TypeofMode::NOT_INSIDE_TYPEOF);
-}
-
-void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeofWide() {
- BuildLoadGlobal(TypeofMode::INSIDE_TYPEOF);
-}
-
void BytecodeGraphBuilder::BuildStoreGlobal(LanguageMode language_mode) {
FrameStateBeforeAndAfter states(this);
Handle<Name> name =
@@ -681,14 +665,6 @@ void BytecodeGraphBuilder::VisitStaGlobalStrict() {
BuildStoreGlobal(LanguageMode::STRICT);
}
-void BytecodeGraphBuilder::VisitStaGlobalSloppyWide() {
- BuildStoreGlobal(LanguageMode::SLOPPY);
-}
-
-void BytecodeGraphBuilder::VisitStaGlobalStrictWide() {
- BuildStoreGlobal(LanguageMode::STRICT);
-}
-
void BytecodeGraphBuilder::VisitLdaContextSlot() {
// TODO(mythria): LoadContextSlots are unrolled by the required depth when
// generating bytecode. Hence the value of depth is always 0. Update this
@@ -704,8 +680,6 @@ void BytecodeGraphBuilder::VisitLdaContextSlot() {
environment()->BindAccumulator(node);
}
-void BytecodeGraphBuilder::VisitLdaContextSlotWide() { VisitLdaContextSlot(); }
-
void BytecodeGraphBuilder::VisitStaContextSlot() {
// TODO(mythria): LoadContextSlots are unrolled by the required depth when
// generating bytecode. Hence the value of depth is always 0. Update this
@@ -718,8 +692,6 @@ void BytecodeGraphBuilder::VisitStaContextSlot() {
NewNode(op, context, value);
}
-void BytecodeGraphBuilder::VisitStaContextSlotWide() { VisitStaContextSlot(); }
-
void BytecodeGraphBuilder::BuildLdaLookupSlot(TypeofMode typeof_mode) {
FrameStateBeforeAndAfter states(this);
Node* name =
@@ -752,12 +724,6 @@ void BytecodeGraphBuilder::BuildStaLookupSlot(LanguageMode language_mode) {
environment()->BindAccumulator(store, &states);
}
-void BytecodeGraphBuilder::VisitLdaLookupSlotWide() { VisitLdaLookupSlot(); }
-
-void BytecodeGraphBuilder::VisitLdaLookupSlotInsideTypeofWide() {
- VisitLdaLookupSlotInsideTypeof();
-}
-
void BytecodeGraphBuilder::VisitStaLookupSlotSloppy() {
BuildStaLookupSlot(LanguageMode::SLOPPY);
}
@@ -766,14 +732,6 @@ void BytecodeGraphBuilder::VisitStaLookupSlotStrict() {
BuildStaLookupSlot(LanguageMode::STRICT);
}
-void BytecodeGraphBuilder::VisitStaLookupSlotSloppyWide() {
- VisitStaLookupSlotSloppy();
-}
-
-void BytecodeGraphBuilder::VisitStaLookupSlotStrictWide() {
- VisitStaLookupSlotStrict();
-}
-
void BytecodeGraphBuilder::BuildNamedLoad() {
FrameStateBeforeAndAfter states(this);
Node* object =
@@ -790,8 +748,6 @@ void BytecodeGraphBuilder::BuildNamedLoad() {
void BytecodeGraphBuilder::VisitLoadIC() { BuildNamedLoad(); }
-void BytecodeGraphBuilder::VisitLoadICWide() { BuildNamedLoad(); }
-
void BytecodeGraphBuilder::BuildKeyedLoad() {
FrameStateBeforeAndAfter states(this);
Node* key = environment()->LookupAccumulator();
@@ -807,8 +763,6 @@ void BytecodeGraphBuilder::BuildKeyedLoad() {
void BytecodeGraphBuilder::VisitKeyedLoadIC() { BuildKeyedLoad(); }
-void BytecodeGraphBuilder::VisitKeyedLoadICWide() { BuildKeyedLoad(); }
-
void BytecodeGraphBuilder::BuildNamedStore(LanguageMode language_mode) {
FrameStateBeforeAndAfter states(this);
Node* value = environment()->LookupAccumulator();
@@ -832,14 +786,6 @@ void BytecodeGraphBuilder::VisitStoreICStrict() {
BuildNamedStore(LanguageMode::STRICT);
}
-void BytecodeGraphBuilder::VisitStoreICSloppyWide() {
- BuildNamedStore(LanguageMode::SLOPPY);
-}
-
-void BytecodeGraphBuilder::VisitStoreICStrictWide() {
- BuildNamedStore(LanguageMode::STRICT);
-}
-
void BytecodeGraphBuilder::BuildKeyedStore(LanguageMode language_mode) {
FrameStateBeforeAndAfter states(this);
Node* value = environment()->LookupAccumulator();
@@ -863,14 +809,6 @@ void BytecodeGraphBuilder::VisitKeyedStoreICStrict() {
BuildKeyedStore(LanguageMode::STRICT);
}
-void BytecodeGraphBuilder::VisitKeyedStoreICSloppyWide() {
- BuildKeyedStore(LanguageMode::SLOPPY);
-}
-
-void BytecodeGraphBuilder::VisitKeyedStoreICStrictWide() {
- BuildKeyedStore(LanguageMode::STRICT);
-}
-
void BytecodeGraphBuilder::VisitPushContext() {
Node* new_context = environment()->LookupAccumulator();
environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0),
@@ -888,14 +826,12 @@ void BytecodeGraphBuilder::VisitCreateClosure() {
Handle<SharedFunctionInfo> shared_info = Handle<SharedFunctionInfo>::cast(
bytecode_iterator().GetConstantForIndexOperand(0));
PretenureFlag tenured =
- bytecode_iterator().GetImmediateOperand(1) ? TENURED : NOT_TENURED;
+ bytecode_iterator().GetFlagOperand(1) ? TENURED : NOT_TENURED;
const Operator* op = javascript()->CreateClosure(shared_info, tenured);
Node* closure = NewNode(op);
environment()->BindAccumulator(closure);
}
-void BytecodeGraphBuilder::VisitCreateClosureWide() { VisitCreateClosure(); }
-
void BytecodeGraphBuilder::BuildCreateArguments(CreateArgumentsType type) {
FrameStateBeforeAndAfter states(this);
const Operator* op = javascript()->CreateArguments(type);
@@ -921,48 +857,32 @@ void BytecodeGraphBuilder::BuildCreateLiteral(const Operator* op) {
environment()->BindAccumulator(literal, &states);
}
-void BytecodeGraphBuilder::BuildCreateRegExpLiteral() {
+void BytecodeGraphBuilder::VisitCreateRegExpLiteral() {
Handle<String> constant_pattern =
Handle<String>::cast(bytecode_iterator().GetConstantForIndexOperand(0));
int literal_index = bytecode_iterator().GetIndexOperand(1);
- int literal_flags = bytecode_iterator().GetImmediateOperand(2);
+ int literal_flags = bytecode_iterator().GetFlagOperand(2);
const Operator* op = javascript()->CreateLiteralRegExp(
constant_pattern, literal_flags, literal_index);
BuildCreateLiteral(op);
}
-void BytecodeGraphBuilder::VisitCreateRegExpLiteral() {
- BuildCreateRegExpLiteral();
-}
-
-void BytecodeGraphBuilder::VisitCreateRegExpLiteralWide() {
- BuildCreateRegExpLiteral();
-}
-
-void BytecodeGraphBuilder::BuildCreateArrayLiteral() {
+void BytecodeGraphBuilder::VisitCreateArrayLiteral() {
Handle<FixedArray> constant_elements = Handle<FixedArray>::cast(
bytecode_iterator().GetConstantForIndexOperand(0));
int literal_index = bytecode_iterator().GetIndexOperand(1);
- int literal_flags = bytecode_iterator().GetImmediateOperand(2);
+ int literal_flags = bytecode_iterator().GetFlagOperand(2);
int number_of_elements = constant_elements->length();
const Operator* op = javascript()->CreateLiteralArray(
constant_elements, literal_flags, literal_index, number_of_elements);
BuildCreateLiteral(op);
}
-void BytecodeGraphBuilder::VisitCreateArrayLiteral() {
- BuildCreateArrayLiteral();
-}
-
-void BytecodeGraphBuilder::VisitCreateArrayLiteralWide() {
- BuildCreateArrayLiteral();
-}
-
-void BytecodeGraphBuilder::BuildCreateObjectLiteral() {
+void BytecodeGraphBuilder::VisitCreateObjectLiteral() {
Handle<FixedArray> constant_properties = Handle<FixedArray>::cast(
bytecode_iterator().GetConstantForIndexOperand(0));
int literal_index = bytecode_iterator().GetIndexOperand(1);
- int literal_flags = bytecode_iterator().GetImmediateOperand(2);
+ int literal_flags = bytecode_iterator().GetFlagOperand(2);
// TODO(mstarzinger): Thread through number of properties.
int number_of_properties = constant_properties->length() / 2;
const Operator* op = javascript()->CreateLiteralObject(
@@ -970,15 +890,6 @@ void BytecodeGraphBuilder::BuildCreateObjectLiteral() {
BuildCreateLiteral(op);
}
-void BytecodeGraphBuilder::VisitCreateObjectLiteral() {
- BuildCreateObjectLiteral();
-}
-
-void BytecodeGraphBuilder::VisitCreateObjectLiteralWide() {
- BuildCreateObjectLiteral();
-}
-
-
Node* BytecodeGraphBuilder::ProcessCallArguments(const Operator* call_op,
Node* callee,
interpreter::Register receiver,
@@ -1016,17 +927,9 @@ void BytecodeGraphBuilder::BuildCall(TailCallMode tail_call_mode) {
void BytecodeGraphBuilder::VisitCall() { BuildCall(TailCallMode::kDisallow); }
-void BytecodeGraphBuilder::VisitCallWide() {
- BuildCall(TailCallMode::kDisallow);
-}
-
void BytecodeGraphBuilder::VisitTailCall() { BuildCall(TailCallMode::kAllow); }
-void BytecodeGraphBuilder::VisitTailCallWide() {
- BuildCall(TailCallMode::kAllow);
-}
-
-void BytecodeGraphBuilder::BuildCallJSRuntime() {
+void BytecodeGraphBuilder::VisitCallJSRuntime() {
FrameStateBeforeAndAfter states(this);
Node* callee =
BuildLoadNativeContextField(bytecode_iterator().GetIndexOperand(0));
@@ -1039,10 +942,6 @@ void BytecodeGraphBuilder::BuildCallJSRuntime() {
environment()->BindAccumulator(value, &states);
}
-void BytecodeGraphBuilder::VisitCallJSRuntime() { BuildCallJSRuntime(); }
-
-void BytecodeGraphBuilder::VisitCallJSRuntimeWide() { BuildCallJSRuntime(); }
-
Node* BytecodeGraphBuilder::ProcessCallRuntimeArguments(
const Operator* call_runtime_op, interpreter::Register first_arg,
size_t arity) {
@@ -1056,10 +955,10 @@ Node* BytecodeGraphBuilder::ProcessCallRuntimeArguments(
return value;
}
-void BytecodeGraphBuilder::BuildCallRuntime() {
+void BytecodeGraphBuilder::VisitCallRuntime() {
FrameStateBeforeAndAfter states(this);
- Runtime::FunctionId functionId =
- static_cast<Runtime::FunctionId>(bytecode_iterator().GetIndexOperand(0));
+ Runtime::FunctionId functionId = static_cast<Runtime::FunctionId>(
+ bytecode_iterator().GetRuntimeIdOperand(0));
interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1);
size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2);
@@ -1069,14 +968,10 @@ void BytecodeGraphBuilder::BuildCallRuntime() {
environment()->BindAccumulator(value, &states);
}
-void BytecodeGraphBuilder::VisitCallRuntime() { BuildCallRuntime(); }
-
-void BytecodeGraphBuilder::VisitCallRuntimeWide() { BuildCallRuntime(); }
-
-void BytecodeGraphBuilder::BuildCallRuntimeForPair() {
+void BytecodeGraphBuilder::VisitCallRuntimeForPair() {
FrameStateBeforeAndAfter states(this);
- Runtime::FunctionId functionId =
- static_cast<Runtime::FunctionId>(bytecode_iterator().GetIndexOperand(0));
+ Runtime::FunctionId functionId = static_cast<Runtime::FunctionId>(
+ bytecode_iterator().GetRuntimeIdOperand(0));
interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1);
size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2);
interpreter::Register first_return =
@@ -1088,14 +983,6 @@ void BytecodeGraphBuilder::BuildCallRuntimeForPair() {
environment()->BindRegistersToProjections(first_return, return_pair, &states);
}
-void BytecodeGraphBuilder::VisitCallRuntimeForPair() {
- BuildCallRuntimeForPair();
-}
-
-void BytecodeGraphBuilder::VisitCallRuntimeForPairWide() {
- BuildCallRuntimeForPair();
-}
-
Node* BytecodeGraphBuilder::ProcessCallNewArguments(
const Operator* call_new_op, Node* callee, Node* new_target,
interpreter::Register first_arg, size_t arity) {
@@ -1111,7 +998,7 @@ Node* BytecodeGraphBuilder::ProcessCallNewArguments(
return value;
}
-void BytecodeGraphBuilder::BuildCallConstruct() {
+void BytecodeGraphBuilder::VisitNew() {
FrameStateBeforeAndAfter states(this);
interpreter::Register callee_reg = bytecode_iterator().GetRegisterOperand(0);
interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1);
@@ -1127,10 +1014,6 @@ void BytecodeGraphBuilder::BuildCallConstruct() {
environment()->BindAccumulator(value, &states);
}
-void BytecodeGraphBuilder::VisitNew() { BuildCallConstruct(); }
-
-void BytecodeGraphBuilder::VisitNewWide() { BuildCallConstruct(); }
-
void BytecodeGraphBuilder::BuildThrow() {
FrameStateBeforeAndAfter states(this);
Node* value = environment()->LookupAccumulator();
@@ -1332,7 +1215,6 @@ void BytecodeGraphBuilder::VisitJump() { BuildJump(); }
void BytecodeGraphBuilder::VisitJumpConstant() { BuildJump(); }
-void BytecodeGraphBuilder::VisitJumpConstantWide() { BuildJump(); }
void BytecodeGraphBuilder::VisitJumpIfTrue() {
BuildJumpIfEqual(jsgraph()->TrueConstant());
@@ -1342,10 +1224,6 @@ void BytecodeGraphBuilder::VisitJumpIfTrueConstant() {
BuildJumpIfEqual(jsgraph()->TrueConstant());
}
-void BytecodeGraphBuilder::VisitJumpIfTrueConstantWide() {
- BuildJumpIfEqual(jsgraph()->TrueConstant());
-}
-
void BytecodeGraphBuilder::VisitJumpIfFalse() {
BuildJumpIfEqual(jsgraph()->FalseConstant());
}
@@ -1354,10 +1232,6 @@ void BytecodeGraphBuilder::VisitJumpIfFalseConstant() {
BuildJumpIfEqual(jsgraph()->FalseConstant());
}
-void BytecodeGraphBuilder::VisitJumpIfFalseConstantWide() {
- BuildJumpIfEqual(jsgraph()->FalseConstant());
-}
-
void BytecodeGraphBuilder::VisitJumpIfToBooleanTrue() {
BuildJumpIfToBooleanEqual(jsgraph()->TrueConstant());
}
@@ -1366,10 +1240,6 @@ void BytecodeGraphBuilder::VisitJumpIfToBooleanTrueConstant() {
BuildJumpIfToBooleanEqual(jsgraph()->TrueConstant());
}
-void BytecodeGraphBuilder::VisitJumpIfToBooleanTrueConstantWide() {
- BuildJumpIfToBooleanEqual(jsgraph()->TrueConstant());
-}
-
void BytecodeGraphBuilder::VisitJumpIfToBooleanFalse() {
BuildJumpIfToBooleanEqual(jsgraph()->FalseConstant());
}
@@ -1378,20 +1248,12 @@ void BytecodeGraphBuilder::VisitJumpIfToBooleanFalseConstant() {
BuildJumpIfToBooleanEqual(jsgraph()->FalseConstant());
}
-void BytecodeGraphBuilder::VisitJumpIfToBooleanFalseConstantWide() {
- BuildJumpIfToBooleanEqual(jsgraph()->FalseConstant());
-}
-
void BytecodeGraphBuilder::VisitJumpIfNotHole() { BuildJumpIfNotHole(); }
void BytecodeGraphBuilder::VisitJumpIfNotHoleConstant() {
BuildJumpIfNotHole();
}
-void BytecodeGraphBuilder::VisitJumpIfNotHoleConstantWide() {
- BuildJumpIfNotHole();
-}
-
void BytecodeGraphBuilder::VisitJumpIfNull() {
BuildJumpIfEqual(jsgraph()->NullConstant());
}
@@ -1400,10 +1262,6 @@ void BytecodeGraphBuilder::VisitJumpIfNullConstant() {
BuildJumpIfEqual(jsgraph()->NullConstant());
}
-void BytecodeGraphBuilder::VisitJumpIfNullConstantWide() {
- BuildJumpIfEqual(jsgraph()->NullConstant());
-}
-
void BytecodeGraphBuilder::VisitJumpIfUndefined() {
BuildJumpIfEqual(jsgraph()->UndefinedConstant());
}
@@ -1412,10 +1270,6 @@ void BytecodeGraphBuilder::VisitJumpIfUndefinedConstant() {
BuildJumpIfEqual(jsgraph()->UndefinedConstant());
}
-void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide() {
- BuildJumpIfEqual(jsgraph()->UndefinedConstant());
-}
-
void BytecodeGraphBuilder::VisitStackCheck() {
FrameStateBeforeAndAfter states(this);
Node* node = NewNode(javascript()->StackCheck());
@@ -1451,8 +1305,6 @@ void BytecodeGraphBuilder::BuildForInPrepare() {
void BytecodeGraphBuilder::VisitForInPrepare() { BuildForInPrepare(); }
-void BytecodeGraphBuilder::VisitForInPrepareWide() { BuildForInPrepare(); }
-
void BytecodeGraphBuilder::VisitForInDone() {
FrameStateBeforeAndAfter states(this);
Node* index =
@@ -1482,8 +1334,6 @@ void BytecodeGraphBuilder::BuildForInNext() {
void BytecodeGraphBuilder::VisitForInNext() { BuildForInNext(); }
-void BytecodeGraphBuilder::VisitForInNextWide() { BuildForInNext(); }
-
void BytecodeGraphBuilder::VisitForInStep() {
FrameStateBeforeAndAfter states(this);
Node* index =
@@ -1492,6 +1342,21 @@ void BytecodeGraphBuilder::VisitForInStep() {
environment()->BindAccumulator(index, &states);
}
+void BytecodeGraphBuilder::VisitWide() {
+ // Consumed by the BytecodeArrayIterator.
+ UNREACHABLE();
+}
+
+void BytecodeGraphBuilder::VisitExtraWide() {
+ // Consumed by the BytecodeArrayIterator.
+ UNREACHABLE();
+}
+
+void BytecodeGraphBuilder::VisitIllegal() {
+ // Never present in valid bytecode.
+ UNREACHABLE();
+}
+
void BytecodeGraphBuilder::SwitchToMergeEnvironment(int current_offset) {
if (merge_environments_[current_offset] != nullptr) {
if (environment() != nullptr) {
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/debug/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698