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

Unified Diff: src/interpreter/interpreter-assembler.cc

Issue 2894293003: Save/restore only live registers in the generator suspend/resume. (Closed)
Patch Set: Tweak Created 3 years, 7 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/interpreter-assembler.h ('k') | src/interpreter/interpreter-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter-assembler.cc
diff --git a/src/interpreter/interpreter-assembler.cc b/src/interpreter/interpreter-assembler.cc
index ab64a360ff946af5b0a23b05055aaf63cbeab6e5..558730bf4d6a496f7a45a9d83f8980d482498b77 100644
--- a/src/interpreter/interpreter-assembler.cc
+++ b/src/interpreter/interpreter-assembler.cc
@@ -1390,20 +1390,24 @@ bool InterpreterAssembler::TargetSupportsUnalignedAccess() {
#endif
}
-Node* InterpreterAssembler::RegisterCount() {
- Node* bytecode_array = LoadRegister(Register::bytecode_array());
- Node* frame_size = LoadObjectField(
- bytecode_array, BytecodeArray::kFrameSizeOffset, MachineType::Uint32());
- return WordShr(ChangeUint32ToWord(frame_size),
- IntPtrConstant(kPointerSizeLog2));
+void InterpreterAssembler::AbortIfRegisterCountInvalid(Node* register_file,
+ Node* register_count) {
+ Node* array_size = LoadAndUntagFixedArrayBaseLength(register_file);
+
+ Label ok(this), abort(this, Label::kDeferred);
+ Branch(UintPtrLessThanOrEqual(register_count, array_size), &ok, &abort);
+
+ BIND(&abort);
+ Abort(kInvalidRegisterFileInGenerator);
+ Goto(&ok);
+
+ BIND(&ok);
}
-Node* InterpreterAssembler::ExportRegisterFile(Node* array) {
- Node* register_count = RegisterCount();
+Node* InterpreterAssembler::ExportRegisterFile(Node* array,
+ Node* register_count) {
if (FLAG_debug_code) {
- Node* array_size = LoadAndUntagFixedArrayBaseLength(array);
- AbortIfWordNotEqual(array_size, register_count,
- kInvalidRegisterFileInGenerator);
+ AbortIfRegisterCountInvalid(array, register_count);
}
Variable var_index(this, MachineType::PointerRepresentation());
@@ -1432,12 +1436,10 @@ Node* InterpreterAssembler::ExportRegisterFile(Node* array) {
return array;
}
-Node* InterpreterAssembler::ImportRegisterFile(Node* array) {
- Node* register_count = RegisterCount();
+Node* InterpreterAssembler::ImportRegisterFile(Node* array,
+ Node* register_count) {
if (FLAG_debug_code) {
- Node* array_size = LoadAndUntagFixedArrayBaseLength(array);
- AbortIfWordNotEqual(array_size, register_count,
- kInvalidRegisterFileInGenerator);
+ AbortIfRegisterCountInvalid(array, register_count);
}
Variable var_index(this, MachineType::PointerRepresentation());
« no previous file with comments | « src/interpreter/interpreter-assembler.h ('k') | src/interpreter/interpreter-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698