Commit b742026a authored by bmeurer's avatar bmeurer Committed by Commit bot

[runtime] Remove two obsolete intrinsics.

The %HeapObjectGetMap and %MapGetInstanceType intrinsics are obsolete
because they are unsafe, so we can drop the code.

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/1532493002

Cr-Commit-Position: refs/heads/master@{#32882}
parent fe104b0d
......@@ -45,8 +45,6 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
return ReduceDoubleHi(node);
case Runtime::kInlineDoubleLo:
return ReduceDoubleLo(node);
case Runtime::kInlineHeapObjectGetMap:
return ReduceHeapObjectGetMap(node);
case Runtime::kInlineIncrementStatsCounter:
return ReduceIncrementStatsCounter(node);
case Runtime::kInlineIsArray:
......@@ -65,8 +63,6 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
return ReduceIsSmi(node);
case Runtime::kInlineJSValueGetValue:
return ReduceJSValueGetValue(node);
case Runtime::kInlineMapGetInstanceType:
return ReduceMapGetInstanceType(node);
case Runtime::kInlineMathClz32:
return ReduceMathClz32(node);
case Runtime::kInlineMathFloor:
......@@ -179,15 +175,6 @@ Reduction JSIntrinsicLowering::ReduceDoubleLo(Node* node) {
}
Reduction JSIntrinsicLowering::ReduceHeapObjectGetMap(Node* node) {
Node* value = NodeProperties::GetValueInput(node, 0);
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
return Change(node, simplified()->LoadField(AccessBuilder::ForMap()), value,
effect, control);
}
Reduction JSIntrinsicLowering::ReduceIncrementStatsCounter(Node* node) {
if (!FLAG_native_code_counters) return ChangeToUndefined(node);
HeapObjectMatcher m(NodeProperties::GetValueInput(node, 0));
......@@ -310,16 +297,6 @@ Reduction JSIntrinsicLowering::ReduceJSValueGetValue(Node* node) {
}
Reduction JSIntrinsicLowering::ReduceMapGetInstanceType(Node* node) {
Node* value = NodeProperties::GetValueInput(node, 0);
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
return Change(node,
simplified()->LoadField(AccessBuilder::ForMapInstanceType()),
value, effect, control);
}
Reduction JSIntrinsicLowering::ReduceMathClz32(Node* node) {
return Change(node, machine()->Word32Clz());
}
......
......@@ -43,14 +43,12 @@ class JSIntrinsicLowering final : public AdvancedReducer {
Reduction ReduceDeoptimizeNow(Node* node);
Reduction ReduceDoubleHi(Node* node);
Reduction ReduceDoubleLo(Node* node);
Reduction ReduceHeapObjectGetMap(Node* node);
Reduction ReduceIncrementStatsCounter(Node* node);
Reduction ReduceIsMinusZero(Node* node);
Reduction ReduceIsInstanceType(Node* node, InstanceType instance_type);
Reduction ReduceIsJSReceiver(Node* node);
Reduction ReduceIsSmi(Node* node);
Reduction ReduceJSValueGetValue(Node* node);
Reduction ReduceMapGetInstanceType(Node* node);
Reduction ReduceMathClz32(Node* node);
Reduction ReduceMathFloor(Node* node);
Reduction ReduceMathSqrt(Node* node);
......
......@@ -1087,22 +1087,6 @@ RUNTIME_FUNCTION(Runtime_JSValueGetValue) {
}
RUNTIME_FUNCTION(Runtime_HeapObjectGetMap) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 1);
CONVERT_ARG_CHECKED(HeapObject, obj, 0);
return obj->map();
}
RUNTIME_FUNCTION(Runtime_MapGetInstanceType) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 1);
CONVERT_ARG_CHECKED(Map, map, 0);
return Smi::FromInt(map->instance_type());
}
RUNTIME_FUNCTION(Runtime_ObjectEquals) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 2);
......
......@@ -472,8 +472,6 @@ namespace internal {
F(ValueOf, 1, 1) \
F(SetValueOf, 2, 1) \
F(JSValueGetValue, 1, 1) \
F(HeapObjectGetMap, 1, 1) \
F(MapGetInstanceType, 1, 1) \
F(ObjectEquals, 2, 1) \
F(IsJSReceiver, 1, 1) \
F(IsStrong, 1, 1) \
......
......@@ -34,17 +34,6 @@ TEST(ClassOf) {
}
TEST(HeapObjectGetMap) {
FunctionTester T("(function(a) { return %_HeapObjectGetMap(a); })", flags);
Factory* factory = T.main_isolate()->factory();
T.CheckCall(factory->null_map(), T.null());
T.CheckCall(factory->undefined_map(), T.undefined());
T.CheckCall(factory->heap_number_map(), T.Val(3.1415));
T.CheckCall(factory->symbol_map(), factory->NewSymbol());
}
#define COUNTER_NAME "hurz"
static int* LookupCounter(const char* name) {
......@@ -159,19 +148,6 @@ TEST(IsSmi) {
}
TEST(MapGetInstanceType) {
FunctionTester T(
"(function(a) { return %_MapGetInstanceType(%_HeapObjectGetMap(a)); })",
flags);
Factory* factory = T.main_isolate()->factory();
T.CheckCall(T.Val(ODDBALL_TYPE), T.null());
T.CheckCall(T.Val(ODDBALL_TYPE), T.undefined());
T.CheckCall(T.Val(HEAP_NUMBER_TYPE), T.Val(3.1415));
T.CheckCall(T.Val(SYMBOL_TYPE), factory->NewSymbol());
}
TEST(ObjectEquals) {
FunctionTester T("(function(a,b) { return %_ObjectEquals(a,b); })", flags);
CompileRun("var o = {}");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment