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

Unified Diff: src/interpreter/interpreter.cc

Issue 2189463006: [interpreter] Put object in register for ToObject/ForInPrepare (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix tests Created 4 years, 5 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/interpreter/bytecodes.h ('k') | test/cctest/interpreter/bytecode_expectations/ForIn.golden » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 6bbb2a949ed0bf34b10af136e2a84c71709a9877..d5b7edb4289a958eb5ff329fe34a06a0d12ddea3 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1062,7 +1062,9 @@ void Interpreter::DoToNumber(InterpreterAssembler* assembler) {
//
// Cast the object referenced by the accumulator to a JSObject.
void Interpreter::DoToObject(InterpreterAssembler* assembler) {
- DoUnaryOp(CodeFactory::ToObject(isolate_), assembler);
+ Node* result = BuildUnaryOp(CodeFactory::ToObject(isolate_), assembler);
+ __ StoreRegister(result, __ BytecodeOperandReg(0));
+ __ Dispatch();
}
// Inc
@@ -1912,7 +1914,8 @@ void Interpreter::BuildForInPrepareResult(Node* output_register,
// |cache_info_triple + 2|, with the registers holding cache_type, cache_array,
// and cache_length respectively.
void Interpreter::DoForInPrepare(InterpreterAssembler* assembler) {
- Node* object = __ GetAccumulator();
+ Node* object_reg = __ BytecodeOperandReg(0);
+ Node* object = __ LoadRegister(object_reg);
Node* context = __ GetContext();
Node* const zero_smi = __ SmiConstant(Smi::FromInt(0));
@@ -1973,7 +1976,7 @@ void Interpreter::DoForInPrepare(InterpreterAssembler* assembler) {
__ LoadObjectField(descriptors, DescriptorArray::kEnumCacheOffset);
Node* cache_array = __ LoadObjectField(
cache_offset, DescriptorArray::kEnumCacheBridgeCacheOffset);
- Node* output_register = __ BytecodeOperandReg(0);
+ Node* output_register = __ BytecodeOperandReg(1);
BuildForInPrepareResult(output_register, cache_type, cache_array,
cache_length, assembler);
__ Dispatch();
@@ -1986,7 +1989,7 @@ void Interpreter::DoForInPrepare(InterpreterAssembler* assembler) {
Node* cache_type = __ Projection(0, result_triple);
Node* cache_array = __ Projection(1, result_triple);
Node* cache_length = __ Projection(2, result_triple);
- Node* output_register = __ BytecodeOperandReg(0);
+ Node* output_register = __ BytecodeOperandReg(1);
BuildForInPrepareResult(output_register, cache_type, cache_array,
cache_length, assembler);
__ Dispatch();
@@ -1995,7 +1998,7 @@ void Interpreter::DoForInPrepare(InterpreterAssembler* assembler) {
__ Bind(&nothing_to_iterate);
{
// Receiver is null or undefined or descriptors are zero length.
- Node* output_register = __ BytecodeOperandReg(0);
+ Node* output_register = __ BytecodeOperandReg(1);
BuildForInPrepareResult(output_register, zero_smi, zero_smi, zero_smi,
assembler);
__ Dispatch();
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/bytecode_expectations/ForIn.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698