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

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

Issue 12335132: Fix materialization of arguments objects with unknown values. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Sven Panne. Created 7 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/ia32/lithium-codegen-ia32.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
index f681443ddda5f0ee50af1d64d1b59384965c9b02..b64f484591fdefe02e191edcec3a90cd7e2bec59 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -568,8 +568,8 @@ Operand LCodeGen::HighOperand(LOperand* op) {
void LCodeGen::WriteTranslation(LEnvironment* environment,
Translation* translation,
- int* arguments_index,
- int* arguments_count) {
+ int* pushed_arguments_index,
+ int* pushed_arguments_count) {
if (environment == NULL) return;
// The translation includes one command per value in the environment.
@@ -581,13 +581,13 @@ void LCodeGen::WriteTranslation(LEnvironment* environment,
// arguments index points to the first element of a sequence of tagged
// values on the stack that represent the arguments. This needs to be
// kept in sync with the LArgumentsElements implementation.
- *arguments_index = -environment->parameter_count();
- *arguments_count = environment->parameter_count();
+ *pushed_arguments_index = -environment->parameter_count();
+ *pushed_arguments_count = environment->parameter_count();
WriteTranslation(environment->outer(),
translation,
- arguments_index,
- arguments_count);
+ pushed_arguments_index,
+ pushed_arguments_count);
bool has_closure_id = !info()->closure().is_null() &&
*info()->closure() != *environment->closure();
int closure_id = has_closure_id
@@ -621,13 +621,20 @@ void LCodeGen::WriteTranslation(LEnvironment* environment,
}
// Inlined frames which push their arguments cause the index to be
- // bumped and another stack area to be used for materialization.
- if (environment->entry() != NULL &&
- environment->entry()->arguments_pushed()) {
- *arguments_index = *arguments_index < 0
- ? GetStackSlotCount()
- : *arguments_index + *arguments_count;
- *arguments_count = environment->entry()->arguments_count() + 1;
+ // bumped and another stack area to be used for materialization,
+ // otherwise actual argument values are unknown for inlined frames.
+ bool arguments_known = true;
+ int arguments_index = *pushed_arguments_index;
+ int arguments_count = *pushed_arguments_count;
+ if (environment->entry() != NULL) {
+ arguments_known = environment->entry()->arguments_pushed();
+ arguments_index = arguments_index < 0
+ ? GetStackSlotCount() : arguments_index + arguments_count;
+ arguments_count = environment->entry()->arguments_count() + 1;
+ if (environment->entry()->arguments_pushed()) {
+ *pushed_arguments_index = arguments_index;
+ *pushed_arguments_count = arguments_count;
+ }
}
for (int i = 0; i < translation_size; ++i) {
@@ -642,8 +649,9 @@ void LCodeGen::WriteTranslation(LEnvironment* environment,
environment->spilled_registers()[value->index()],
environment->HasTaggedValueAt(i),
environment->HasUint32ValueAt(i),
- *arguments_index,
- *arguments_count);
+ arguments_known,
+ arguments_index,
+ arguments_count);
} else if (
value->IsDoubleRegister() &&
environment->spilled_double_registers()[value->index()] != NULL) {
@@ -653,8 +661,9 @@ void LCodeGen::WriteTranslation(LEnvironment* environment,
environment->spilled_double_registers()[value->index()],
false,
false,
- *arguments_index,
- *arguments_count);
+ arguments_known,
+ arguments_index,
+ arguments_count);
}
}
@@ -662,8 +671,9 @@ void LCodeGen::WriteTranslation(LEnvironment* environment,
value,
environment->HasTaggedValueAt(i),
environment->HasUint32ValueAt(i),
- *arguments_index,
- *arguments_count);
+ arguments_known,
+ arguments_index,
+ arguments_count);
}
}
@@ -672,13 +682,15 @@ void LCodeGen::AddToTranslation(Translation* translation,
LOperand* op,
bool is_tagged,
bool is_uint32,
+ bool arguments_known,
int arguments_index,
int arguments_count) {
if (op == NULL) {
// TODO(twuerthinger): Introduce marker operands to indicate that this value
// is not present and must be reconstructed from the deoptimizer. Currently
// this is only used for the arguments object.
- translation->StoreArgumentsObject(arguments_index, arguments_count);
+ translation->StoreArgumentsObject(
+ arguments_known, arguments_index, arguments_count);
} else if (op->IsStackSlot()) {
if (is_tagged) {
translation->StoreStackSlot(op->index());
« no previous file with comments | « src/ia32/lithium-codegen-ia32.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698