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

Unified Diff: src/interpreter/interpreter.cc

Issue 1683103002: [compiler] Sanitize entry points to LookupSlot access. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix REBASE error. Created 4 years, 10 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
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 775fbca5e56ceb7e30e1e5959233e0b870cac095..b5c79b515178f2cd7738199321b5cdc494c76c0b 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -467,8 +467,7 @@ void Interpreter::DoLoadLookupSlot(Runtime::FunctionId function_id,
Node* index = __ BytecodeOperandIdx(0);
Node* name = __ LoadConstantPoolEntry(index);
Node* context = __ GetContext();
- Node* result_pair = __ CallRuntime(function_id, context, context, name);
- Node* result = __ Projection(0, result_pair);
+ Node* result = __ CallRuntime(function_id, context, name);
__ SetAccumulator(result);
__ Dispatch();
}
@@ -488,7 +487,7 @@ void Interpreter::DoLdaLookupSlot(InterpreterAssembler* assembler) {
// Lookup the object with the name in constant pool entry |name_index|
// dynamically without causing a NoReferenceError.
void Interpreter::DoLdaLookupSlotInsideTypeof(InterpreterAssembler* assembler) {
- DoLoadLookupSlot(Runtime::kLoadLookupSlotNoReferenceError, assembler);
+ DoLoadLookupSlot(Runtime::kLoadLookupSlotInsideTypeof, assembler);
}
@@ -516,9 +515,10 @@ void Interpreter::DoStoreLookupSlot(LanguageMode language_mode,
Node* index = __ BytecodeOperandIdx(0);
Node* name = __ LoadConstantPoolEntry(index);
Node* context = __ GetContext();
- Node* language_mode_node = __ NumberConstant(language_mode);
- Node* result = __ CallRuntime(Runtime::kStoreLookupSlot, context, value,
- context, name, language_mode_node);
+ Node* result = __ CallRuntime(is_strict(language_mode)
+ ? Runtime::kStoreLookupSlot_Strict
+ : Runtime::kStoreLookupSlot_Sloppy,
+ context, name, value);
__ SetAccumulator(result);
__ Dispatch();
}

Powered by Google App Engine
This is Rietveld 408576698