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

Unified Diff: src/code-stubs.cc

Issue 2435023002: Use a different map to distinguish eval contexts (Closed)
Patch Set: Crankshaft backends and scope deserialization Created 4 years, 2 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/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 6ee1d4c27ea5dfaa708689b38ba00352c64e2d86..c75d07f637ed18933da60bbb1474d134a596b629 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -2599,7 +2599,7 @@ void FastNewClosureStub::GenerateAssembly(CodeStubAssembler* assembler) const {
// static
compiler::Node* FastNewFunctionContextStub::Generate(
CodeStubAssembler* assembler, compiler::Node* function,
- compiler::Node* slots, compiler::Node* context) {
+ compiler::Node* slots, compiler::Node* context, bool for_eval) {
typedef compiler::Node Node;
Node* min_context_slots =
@@ -2613,9 +2613,10 @@ compiler::Node* FastNewFunctionContextStub::Generate(
Node* function_context = assembler->Allocate(size);
Isolate* isolate = assembler->isolate();
- assembler->StoreMapNoWriteBarrier(
- function_context,
- assembler->HeapConstant(isolate->factory()->function_context_map()));
+ Handle<Map> map = for_eval ? isolate->factory()->eval_context_map()
+ : isolate->factory()->function_context_map();
+ assembler->StoreMapNoWriteBarrier(function_context,
+ assembler->HeapConstant(map));
assembler->StoreObjectFieldNoWriteBarrier(function_context,
Context::kLengthOffset,
assembler->SmiFromWord32(length));
@@ -2656,7 +2657,7 @@ void FastNewFunctionContextStub::GenerateAssembly(
Node* slots = assembler->Parameter(FastNewFunctionContextDescriptor::kSlots);
Node* context = assembler->Parameter(Descriptor::kContext);
- assembler->Return(Generate(assembler, function, slots, context));
+ assembler->Return(Generate(assembler, function, slots, context, for_eval()));
}
// static
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | src/contexts.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698