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

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

Issue 1894953004: Add HasProperty code stub that tries simple lookups or jumps to runtime otherwise. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing Created 4 years, 8 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/full-codegen/full-codegen.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/ia32/full-codegen-ia32.cc
diff --git a/src/full-codegen/ia32/full-codegen-ia32.cc b/src/full-codegen/ia32/full-codegen-ia32.cc
index 6f8069c0961562e37899fb920f24aabfc3bc2e50..d184ee5734e89eae5aa09969e58a83a975243c1f 100644
--- a/src/full-codegen/ia32/full-codegen-ia32.cc
+++ b/src/full-codegen/ia32/full-codegen-ia32.cc
@@ -423,6 +423,9 @@ void FullCodeGenerator::EmitReturnSequence() {
}
}
+void FullCodeGenerator::RestoreContext() {
+ __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
+}
void FullCodeGenerator::StackValueContext::Plug(Variable* var) const {
DCHECK(var->IsStackAllocated() || var->IsContextSlot());
@@ -1347,7 +1350,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
__ mov(edx, Immediate(Smi::FromInt(flags)));
FastCloneShallowObjectStub stub(isolate(), expr->properties_count());
__ CallStub(&stub);
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
+ RestoreContext();
}
PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG);
@@ -1782,8 +1785,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ j(equal, &post_runtime);
__ push(eax); // generator object
__ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1);
- __ mov(context_register(),
- Operand(ebp, StandardFrameConstants::kContextOffset));
+ RestoreContext();
__ bind(&post_runtime);
PopOperand(result_register());
EmitReturnSequence();
@@ -2424,10 +2426,7 @@ void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) {
OperandStackDepthDecrement(arg_count + 1);
RecordJSReturnSite(expr);
-
- // Restore context register.
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
-
+ RestoreContext();
context()->DropAndPlug(1, eax);
}
@@ -2529,8 +2528,7 @@ void FullCodeGenerator::EmitPossiblyEvalCall(Call* expr) {
RelocInfo::CODE_TARGET);
OperandStackDepthDecrement(arg_count + 1);
RecordJSReturnSite(expr);
- // Restore context register.
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
+ RestoreContext();
context()->DropAndPlug(1, eax);
}
@@ -2570,8 +2568,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
__ call(stub.GetCode(), RelocInfo::CODE_TARGET);
OperandStackDepthDecrement(arg_count + 1);
PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
- // Restore context register.
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
+ RestoreContext();
context()->Plug(eax);
}
@@ -2612,9 +2609,7 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
OperandStackDepthDecrement(arg_count + 1);
RecordJSReturnSite(expr);
-
- // Restore context register.
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
+ RestoreContext();
context()->Plug(eax);
}
@@ -3015,8 +3010,7 @@ void FullCodeGenerator::EmitCall(CallRuntime* expr) {
__ mov(eax, Immediate(argc));
__ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
OperandStackDepthDecrement(argc + 1);
- // Restore context register.
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
+ RestoreContext();
// Discard the function left on TOS.
context()->DropAndPlug(1, eax);
}
@@ -3136,9 +3130,7 @@ void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) {
__ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined),
RelocInfo::CODE_TARGET);
OperandStackDepthDecrement(arg_count + 1);
-
- // Restore context register.
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
+ RestoreContext();
}
@@ -3612,7 +3604,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
case Token::IN:
VisitForStackValue(expr->right());
SetExpressionPosition(expr);
- CallRuntimeWithOperands(Runtime::kHasProperty);
+ EmitHasProperty();
PrepareForBailoutBeforeSplit(expr, false, NULL, NULL);
__ cmp(eax, isolate()->factory()->true_value());
Split(equal, if_true, if_false, fall_through);
« no previous file with comments | « src/full-codegen/full-codegen.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698