Commit 0ff07a5b authored by bmeurer's avatar bmeurer Committed by Commit bot

[ignition] Remove obsolete %_ValueOf intrinsic.

The %_ValueOf intrinsic is not used anymore and the runtime call
%ValueOf will also disappear once all the self hosted builtins are
migrated.

R=rmcilroy@chromium.org

Review-Url: https://codereview.chromium.org/2642303003
Cr-Commit-Position: refs/heads/master@{#42544}
parent e26a58e4
......@@ -304,31 +304,6 @@ Node* IntrinsicsHelper::Call(Node* args_reg, Node* arg_count, Node* context) {
return result;
}
Node* IntrinsicsHelper::ValueOf(Node* args_reg, Node* arg_count,
Node* context) {
InterpreterAssembler::Variable return_value(assembler_,
MachineRepresentation::kTagged);
InterpreterAssembler::Label done(assembler_);
Node* object = __ LoadRegister(args_reg);
return_value.Bind(object);
// If the object is a smi return the object.
__ GotoIf(__ TaggedIsSmi(object), &done);
// If the object is not a value type, return the object.
Node* condition =
CompareInstanceType(object, JS_VALUE_TYPE, kInstanceTypeEqual);
__ GotoUnless(condition, &done);
// If the object is a value type, return the value field.
return_value.Bind(__ LoadObjectField(object, JSValue::kValueOffset));
__ Goto(&done);
__ Bind(&done);
return return_value.value();
}
Node* IntrinsicsHelper::ClassOf(Node* args_reg, Node* arg_count,
Node* context) {
Node* value = __ LoadRegister(args_reg);
......
......@@ -40,8 +40,7 @@ namespace interpreter {
V(ToLength, to_length, 1) \
V(ToInteger, to_integer, 1) \
V(ToNumber, to_number, 1) \
V(ToObject, to_object, 1) \
V(ValueOf, value_of, 1)
V(ToObject, to_object, 1)
class IntrinsicsHelper {
public:
......
......@@ -225,27 +225,6 @@ TEST(IntrinsicAsStubCall) {
->SameValue(*sub_string_helper.NewObject("'bar'")));
}
TEST(ValueOf) {
HandleAndZoneScope handles;
Isolate* isolate = handles.main_isolate();
Factory* factory = isolate->factory();
InvokeIntrinsicHelper helper(handles.main_isolate(), handles.main_zone(),
Runtime::kInlineValueOf);
CHECK_EQ(Smi::FromInt(1234), *helper.Invoke(helper.NewObject("1234")));
CHECK_EQ(Smi::FromInt(5678),
*helper.Invoke(helper.NewObject("new Object(5678)")));
CHECK_EQ(*factory->true_value(), *helper.Invoke(helper.NewObject("true")));
CHECK_EQ(*factory->false_value(),
*helper.Invoke(helper.NewObject("new Object(false)")));
CHECK(helper.Invoke(helper.NewObject("'foobar'"))
->SameValue(*helper.NewObject("'foobar'")));
CHECK(helper.Invoke(helper.NewObject("new Object('foobar')"))
->SameValue(*helper.NewObject("'foobar'")));
}
TEST(ClassOf) {
HandleAndZoneScope handles;
Isolate* isolate = handles.main_isolate();
......
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