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

Side by Side Diff: src/interpreter/interpreter.cc

Issue 1469833005: [runtime] Pass closure to %CreateArrayLiteral and %CreateObjectLiteral. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/runtime/runtime-literals.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/interpreter/interpreter.h" 5 #include "src/interpreter/interpreter.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/compiler/interpreter-assembler.h" 9 #include "src/compiler/interpreter-assembler.h"
10 #include "src/factory.h" 10 #include "src/factory.h"
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 1333
1334 1334
1335 void Interpreter::DoCreateLiteral(Runtime::FunctionId function_id, 1335 void Interpreter::DoCreateLiteral(Runtime::FunctionId function_id,
1336 compiler::InterpreterAssembler* assembler) { 1336 compiler::InterpreterAssembler* assembler) {
1337 Node* constant_elements = __ GetAccumulator(); 1337 Node* constant_elements = __ GetAccumulator();
1338 Node* literal_index_raw = __ BytecodeOperandIdx(0); 1338 Node* literal_index_raw = __ BytecodeOperandIdx(0);
1339 Node* literal_index = __ SmiTag(literal_index_raw); 1339 Node* literal_index = __ SmiTag(literal_index_raw);
1340 Node* flags_raw = __ BytecodeOperandImm(1); 1340 Node* flags_raw = __ BytecodeOperandImm(1);
1341 Node* flags = __ SmiTag(flags_raw); 1341 Node* flags = __ SmiTag(flags_raw);
1342 Node* closure = __ LoadRegister(Register::function_closure()); 1342 Node* closure = __ LoadRegister(Register::function_closure());
1343 Node* literals_array = 1343 Node* result = __ CallRuntime(function_id, closure, literal_index,
1344 __ LoadObjectField(closure, JSFunction::kLiteralsOffset);
1345 Node* result = __ CallRuntime(function_id, literals_array, literal_index,
1346 constant_elements, flags); 1344 constant_elements, flags);
1347 __ SetAccumulator(result); 1345 __ SetAccumulator(result);
1348 __ Dispatch(); 1346 __ Dispatch();
1349 } 1347 }
1350 1348
1351 1349
1352 // CreateArrayLiteral <idx> <flags> 1350 // CreateArrayLiteral <idx> <flags>
1353 // 1351 //
1354 // Creates an array literal for literal index <idx> with flags <flags> and 1352 // Creates an array literal for literal index <idx> with flags <flags> and
1355 // constant elements in the accumulator. 1353 // constant elements in the accumulator.
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1476 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3); 1474 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3);
1477 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length); 1475 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length);
1478 __ SetAccumulator(result); 1476 __ SetAccumulator(result);
1479 __ Dispatch(); 1477 __ Dispatch();
1480 } 1478 }
1481 1479
1482 1480
1483 } // namespace interpreter 1481 } // namespace interpreter
1484 } // namespace internal 1482 } // namespace internal
1485 } // namespace v8 1483 } // namespace v8
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/runtime/runtime-literals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698