| Index: src/code-stub-assembler.cc
|
| diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
|
| index 657ca2d7540ef2b545c653c665e965a5c3b34fe4..2c205d350197534f0768cab52cb757149991ca82 100644
|
| --- a/src/code-stub-assembler.cc
|
| +++ b/src/code-stub-assembler.cc
|
| @@ -2214,6 +2214,55 @@ Node* CodeStubAssembler::StringFromCharCode(Node* code) {
|
| return var_result.value();
|
| }
|
|
|
| +Node* CodeStubAssembler::ToName(Node* context, Node* value) {
|
| + typedef CodeStubAssembler::Label Label;
|
| + typedef CodeStubAssembler::Variable Variable;
|
| +
|
| + Label end(this);
|
| + Variable var_result(this, MachineRepresentation::kTagged);
|
| +
|
| + Label is_number(this);
|
| + GotoIf(WordIsSmi(value), &is_number);
|
| +
|
| + Label not_name(this);
|
| + Node* value_instance_type = LoadInstanceType(value);
|
| + STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
|
| + GotoIf(Int32GreaterThan(value_instance_type, Int32Constant(LAST_NAME_TYPE)),
|
| + ¬_name);
|
| +
|
| + var_result.Bind(value);
|
| + Goto(&end);
|
| +
|
| + Bind(&is_number);
|
| + {
|
| + Callable callable = CodeFactory::NumberToString(isolate());
|
| + var_result.Bind(CallStub(callable, context, value));
|
| + Goto(&end);
|
| + }
|
| +
|
| + Bind(¬_name);
|
| + {
|
| + GotoIf(Word32Equal(value_instance_type, Int32Constant(HEAP_NUMBER_TYPE)),
|
| + &is_number);
|
| +
|
| + Label not_oddball(this);
|
| + GotoIf(Word32NotEqual(value_instance_type, Int32Constant(ODDBALL_TYPE)),
|
| + ¬_oddball);
|
| +
|
| + var_result.Bind(LoadObjectField(value, Oddball::kToStringOffset));
|
| + Goto(&end);
|
| +
|
| + Bind(¬_oddball);
|
| + {
|
| + var_result.Bind(CallRuntime(Runtime::kToName, context, value));
|
| + Goto(&end);
|
| + }
|
| + }
|
| +
|
| + Bind(&end);
|
| + return var_result.value();
|
| +}
|
| +
|
| Node* CodeStubAssembler::BitFieldDecode(Node* word32, uint32_t shift,
|
| uint32_t mask) {
|
| return Word32Shr(Word32And(word32, Int32Constant(mask)),
|
|
|