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

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

Issue 2473003004: [compiler] Generalize context load/store operations in code-stub-assembler. (Closed)
Patch Set: Remove tests. Created 4 years, 1 month 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
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-assembler.h" 5 #include "src/interpreter/interpreter-assembler.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <ostream> 8 #include <ostream>
9 9
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 IntPtrAdd(IntPtrConstant(offset), WordShl(index, kPointerSizeLog2)); 478 IntPtrAdd(IntPtrConstant(offset), WordShl(index, kPointerSizeLog2));
479 if (Is64()) { 479 if (Is64()) {
480 return ChangeInt32ToInt64( 480 return ChangeInt32ToInt64(
481 Load(MachineType::Int32(), constant_pool, entry_offset)); 481 Load(MachineType::Int32(), constant_pool, entry_offset));
482 } else { 482 } else {
483 return SmiUntag( 483 return SmiUntag(
484 Load(MachineType::AnyTagged(), constant_pool, entry_offset)); 484 Load(MachineType::AnyTagged(), constant_pool, entry_offset));
485 } 485 }
486 } 486 }
487 487
488 Node* InterpreterAssembler::LoadContextSlot(Node* context, Node* slot_index) {
489 Node* offset =
490 IntPtrAdd(WordShl(slot_index, kPointerSizeLog2),
491 IntPtrConstant(Context::kHeaderSize - kHeapObjectTag));
492 return Load(MachineType::AnyTagged(), context, offset);
493 }
494
495 Node* InterpreterAssembler::StoreContextSlot(Node* context, Node* slot_index,
496 Node* value) {
497 Node* offset =
498 IntPtrAdd(WordShl(slot_index, kPointerSizeLog2),
499 IntPtrConstant(Context::kHeaderSize - kHeapObjectTag));
500 return Store(MachineRepresentation::kTagged, context, offset, value);
501 }
502
503 Node* InterpreterAssembler::LoadTypeFeedbackVector() { 488 Node* InterpreterAssembler::LoadTypeFeedbackVector() {
504 Node* function = LoadRegister(Register::function_closure()); 489 Node* function = LoadRegister(Register::function_closure());
505 Node* literals = LoadObjectField(function, JSFunction::kLiteralsOffset); 490 Node* literals = LoadObjectField(function, JSFunction::kLiteralsOffset);
506 Node* vector = 491 Node* vector =
507 LoadObjectField(literals, LiteralsArray::kFeedbackVectorOffset); 492 LoadObjectField(literals, LiteralsArray::kFeedbackVectorOffset);
508 return vector; 493 return vector;
509 } 494 }
510 495
511 void InterpreterAssembler::CallPrologue() { 496 void InterpreterAssembler::CallPrologue() {
512 StoreRegister(SmiTag(BytecodeOffset()), Register::bytecode_offset()); 497 StoreRegister(SmiTag(BytecodeOffset()), Register::bytecode_offset());
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 Goto(&loop); 1358 Goto(&loop);
1374 } 1359 }
1375 Bind(&done_loop); 1360 Bind(&done_loop);
1376 1361
1377 return array; 1362 return array;
1378 } 1363 }
1379 1364
1380 } // namespace interpreter 1365 } // namespace interpreter
1381 } // namespace internal 1366 } // namespace internal
1382 } // namespace v8 1367 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/interpreter-assembler.h ('k') | test/unittests/interpreter/interpreter-assembler-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698