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

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: Address Ross comment. 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 a4e5d99838d8f686ff165def79b4740373259d9f..0601082467238b301cb51a81a14b1c0300192aed 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -470,9 +470,7 @@ void Interpreter::DoLoadLookupSlot(Runtime::FunctionId function_id,
compiler::InterpreterAssembler* assembler) {
Node* index = __ BytecodeOperandIdx(0);
Node* name = __ LoadConstantPoolEntry(index);
- Node* context = __ GetContext();
- Node* result_pair = __ CallRuntime(function_id, context, name);
- Node* result = __ Projection(0, result_pair);
+ Node* result = __ CallRuntime(function_id, name);
__ SetAccumulator(result);
__ Dispatch();
}
@@ -493,7 +491,7 @@ void Interpreter::DoLdaLookupSlot(compiler::InterpreterAssembler* assembler) {
// dynamically without causing a NoReferenceError.
void Interpreter::DoLdaLookupSlotInsideTypeof(
compiler::InterpreterAssembler* assembler) {
- DoLoadLookupSlot(Runtime::kLoadLookupSlotNoReferenceError, assembler);
+ DoLoadLookupSlot(Runtime::kLoadLookupSlotInsideTypeof, assembler);
}
@@ -522,10 +520,10 @@ void Interpreter::DoStoreLookupSlot(LanguageMode language_mode,
Node* value = __ GetAccumulator();
Node* index = __ BytecodeOperandIdx(0);
Node* name = __ LoadConstantPoolEntry(index);
- Node* context = __ GetContext();
- Node* language_mode_node = __ NumberConstant(language_mode);
- Node* result = __ CallRuntime(Runtime::kStoreLookupSlot, value, context, name,
- language_mode_node);
+ Node* result = __ CallRuntime(is_strict(language_mode)
+ ? Runtime::kStoreLookupSlot_Strict
+ : Runtime::kStoreLookupSlot_Sloppy,
+ name, value);
__ SetAccumulator(result);
__ Dispatch();
}

Powered by Google App Engine
This is Rietveld 408576698