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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 2645543002: Back strongly rooted literals CLs out of the tree for branch cut (Closed)
Patch Set: Created 3 years, 11 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/x64/full-codegen-x64.cc ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 05b7010ce70fb7a7aba66d7f490eb93fb5e54014..6d4f1ae75d3bd5109368e15c367bea027ab79608 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -498,10 +498,9 @@ class BytecodeGenerator::GlobalDeclarationsBuilder final : public ZoneObject {
has_constant_pool_entry_(false) {}
void AddFunctionDeclaration(Handle<String> name, FeedbackVectorSlot slot,
- FeedbackVectorSlot literal_slot,
FunctionLiteral* func) {
DCHECK(!slot.IsInvalid());
- declarations_.push_back(Declaration(name, slot, literal_slot, func));
+ declarations_.push_back(Declaration(name, slot, func));
}
void AddUndefinedDeclaration(Handle<String> name, FeedbackVectorSlot slot) {
@@ -513,7 +512,7 @@ class BytecodeGenerator::GlobalDeclarationsBuilder final : public ZoneObject {
DCHECK(has_constant_pool_entry_);
int array_index = 0;
Handle<FixedArray> data = info->isolate()->factory()->NewFixedArray(
- static_cast<int>(declarations_.size() * 4), TENURED);
+ static_cast<int>(declarations_.size() * 3), TENURED);
for (const Declaration& declaration : declarations_) {
FunctionLiteral* func = declaration.func;
Handle<Object> initial_value;
@@ -530,14 +529,6 @@ class BytecodeGenerator::GlobalDeclarationsBuilder final : public ZoneObject {
data->set(array_index++, *declaration.name);
data->set(array_index++, Smi::FromInt(declaration.slot.ToInt()));
- Object* undefined_or_literal_slot;
- if (declaration.literal_slot.IsInvalid()) {
- undefined_or_literal_slot = info->isolate()->heap()->undefined_value();
- } else {
- undefined_or_literal_slot =
- Smi::FromInt(declaration.literal_slot.ToInt());
- }
- data->set(array_index++, undefined_or_literal_slot);
data->set(array_index++, *initial_value);
}
return data;
@@ -561,18 +552,11 @@ class BytecodeGenerator::GlobalDeclarationsBuilder final : public ZoneObject {
struct Declaration {
Declaration() : slot(FeedbackVectorSlot::Invalid()), func(nullptr) {}
Declaration(Handle<String> name, FeedbackVectorSlot slot,
- FeedbackVectorSlot literal_slot, FunctionLiteral* func)
- : name(name), slot(slot), literal_slot(literal_slot), func(func) {}
- Declaration(Handle<String> name, FeedbackVectorSlot slot,
FunctionLiteral* func)
- : name(name),
- slot(slot),
- literal_slot(FeedbackVectorSlot::Invalid()),
- func(func) {}
+ : name(name), slot(slot), func(func) {}
Handle<String> name;
FeedbackVectorSlot slot;
- FeedbackVectorSlot literal_slot;
FunctionLiteral* func;
};
ZoneVector<Declaration> declarations_;
@@ -905,9 +889,8 @@ void BytecodeGenerator::VisitFunctionDeclaration(FunctionDeclaration* decl) {
switch (variable->location()) {
case VariableLocation::UNALLOCATED: {
FeedbackVectorSlot slot = decl->proxy()->VariableFeedbackSlot();
- globals_builder()->AddFunctionDeclaration(
- variable->name(), slot, decl->fun()->LiteralFeedbackSlot(),
- decl->fun());
+ globals_builder()->AddFunctionDeclaration(variable->name(), slot,
+ decl->fun());
break;
}
case VariableLocation::PARAMETER:
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698