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

Unified Diff: src/interpreter/interpreter.cc

Issue 2487173002: [turbofan] Advance bytecode offset after lazy deopt. (Closed)
Patch Set: Rebased. 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 side-by-side diff with in-line comments
Download patch
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 9b6662eeba69b99a80accd162fe29957611e5f86..48e29f4173bf2ae88f633f39652e3fb00c4abfd1 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -12,6 +12,7 @@
#include "src/compilation-info.h"
#include "src/compiler.h"
#include "src/factory.h"
+#include "src/interpreter/bytecode-array-iterator.h"
#include "src/interpreter/bytecode-flags.h"
#include "src/interpreter/bytecode-generator.h"
#include "src/interpreter/bytecodes.h"
@@ -261,6 +262,19 @@ uintptr_t Interpreter::GetDispatchCounter(Bytecode from, Bytecode to) const {
to_index];
}
+// static
+int Interpreter::AdvanceBytecodeOffset(BytecodeArray* bytecode_array,
+ int bytecode_offset) {
+ DisallowHeapAllocation no_gc;
+ HandleScope scope(bytecode_array->GetIsolate());
+ BytecodeArrayIterator it(handle(bytecode_array));
+ int offset = bytecode_offset - BytecodeArray::kHeaderSize + kHeapObjectTag;
+ while (it.current_offset() < offset) it.Advance();
+ DCHECK_EQ(offset, it.current_offset());
+ it.Advance(); // Advance by one bytecode.
+ return it.current_offset() + BytecodeArray::kHeaderSize - kHeapObjectTag;
+}
+
Local<v8::Object> Interpreter::GetDispatchCountersObject() {
v8::Isolate* isolate = reinterpret_cast<v8::Isolate*>(isolate_);
Local<v8::Context> context = isolate->GetCurrentContext();

Powered by Google App Engine
This is Rietveld 408576698