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

Unified Diff: src/full-codegen/arm/full-codegen-arm.cc

Issue 1683103002: [compiler] Sanitize entry points to LookupSlot access. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Fixes. Comments. 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
« no previous file with comments | « src/compiler/verifier.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/arm/full-codegen-arm.cc
diff --git a/src/full-codegen/arm/full-codegen-arm.cc b/src/full-codegen/arm/full-codegen-arm.cc
index 5ca37f7e678c2a11bb5326f188c58ea5d3265161..7353e3de1b45a00371c107fb7e5cef6f190b7589 100644
--- a/src/full-codegen/arm/full-codegen-arm.cc
+++ b/src/full-codegen/arm/full-codegen-arm.cc
@@ -1433,12 +1433,11 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy,
// by eval-introduced variables.
EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done);
__ bind(&slow);
- __ mov(r1, Operand(var->name()));
- __ Push(cp, r1); // Context and name.
+ __ Push(var->name());
Runtime::FunctionId function_id =
typeof_mode == NOT_INSIDE_TYPEOF
? Runtime::kLoadLookupSlot
- : Runtime::kLoadLookupSlotNoReferenceError;
+ : Runtime::kLoadLookupSlotInsideTypeof;
__ CallRuntime(function_id);
__ bind(&done);
context()->Plug(r0);
@@ -2454,11 +2453,11 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op,
(var->mode() == CONST && op == Token::INIT)) {
if (var->IsLookupSlot()) {
// Assignment to var.
- __ push(r0); // Value.
- __ mov(r1, Operand(var->name()));
- __ mov(r0, Operand(Smi::FromInt(language_mode())));
- __ Push(cp, r1, r0); // Context, name, language mode.
- __ CallRuntime(Runtime::kStoreLookupSlot);
+ __ Push(var->name());
+ __ Push(r0);
+ __ CallRuntime(is_strict(language_mode())
+ ? Runtime::kStoreLookupSlot_Strict
+ : Runtime::kStoreLookupSlot_Sloppy);
} else {
// Assignment to var or initializing assignment to let/const in harmony
// mode.
@@ -2807,10 +2806,8 @@ void FullCodeGenerator::PushCalleeAndWithBaseObject(Call* expr) {
__ bind(&slow);
// Call the runtime to find the function to call (returned in r0)
// and the object holding it (returned in edx).
- DCHECK(!context_register().is(r2));
- __ mov(r2, Operand(callee->name()));
- __ Push(context_register(), r2);
- __ CallRuntime(Runtime::kLoadLookupSlot);
+ __ Push(callee->name());
+ __ CallRuntime(Runtime::kLoadLookupSlotForCall);
__ Push(r0, r1); // Function, receiver.
PrepareForBailoutForId(expr->LookupId(), NO_REGISTERS);
@@ -3932,9 +3929,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
} else {
// Non-global variable. Call the runtime to try to delete from the
// context where the variable was introduced.
- DCHECK(!context_register().is(r2));
- __ mov(r2, Operand(var->name()));
- __ Push(context_register(), r2);
+ __ Push(var->name());
__ CallRuntime(Runtime::kDeleteLookupSlot);
context()->Plug(r0);
}
« no previous file with comments | « src/compiler/verifier.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698