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

Side by Side Diff: src/interpreter/interpreter.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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/interpreter/interpreter.h" 5 #include "src/interpreter/interpreter.h"
6 6
7 #include <fstream> 7 #include <fstream>
8 #include <memory> 8 #include <memory>
9 9
10 #include "src/ast/prettyprinter.h" 10 #include "src/ast/prettyprinter.h"
(...skipping 2195 matching lines...) Expand 10 before | Expand all | Expand 10 after
2206 __ Dispatch(); 2206 __ Dispatch();
2207 } 2207 }
2208 2208
2209 // CreateFunctionContext <slots> 2209 // CreateFunctionContext <slots>
2210 // 2210 //
2211 // Creates a new context with number of |slots| for the function closure. 2211 // Creates a new context with number of |slots| for the function closure.
2212 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { 2212 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) {
2213 Node* closure = __ LoadRegister(Register::function_closure()); 2213 Node* closure = __ LoadRegister(Register::function_closure());
2214 Node* slots = __ BytecodeOperandUImm(0); 2214 Node* slots = __ BytecodeOperandUImm(0);
2215 Node* context = __ GetContext(); 2215 Node* context = __ GetContext();
2216 __ SetAccumulator( 2216 __ SetAccumulator(FastNewFunctionContextStub::Generate(
2217 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); 2217 assembler, closure, slots, context, false));
2218 __ Dispatch(); 2218 __ Dispatch();
2219 } 2219 }
2220 2220
2221 // CreateEvalContext <slots>
2222 //
2223 // Creates a new context with number of |slots| for an eval closure.
2224 void Interpreter::DoCreateEvalContext(InterpreterAssembler* assembler) {
2225 Node* closure = __ LoadRegister(Register::function_closure());
2226 Node* slots = __ BytecodeOperandUImm(0);
2227 Node* context = __ GetContext();
2228 __ SetAccumulator(FastNewFunctionContextStub::Generate(assembler, closure,
2229 slots, context, true));
2230 __ Dispatch();
2231 }
2232
2221 // CreateWithContext <register> <scope_info_idx> 2233 // CreateWithContext <register> <scope_info_idx>
2222 // 2234 //
2223 // Creates a new context with the ScopeInfo at |scope_info_idx| for a 2235 // Creates a new context with the ScopeInfo at |scope_info_idx| for a
2224 // with-statement with the object in |register| and the closure in the 2236 // with-statement with the object in |register| and the closure in the
2225 // accumulator. 2237 // accumulator.
2226 void Interpreter::DoCreateWithContext(InterpreterAssembler* assembler) { 2238 void Interpreter::DoCreateWithContext(InterpreterAssembler* assembler) {
2227 Node* reg_index = __ BytecodeOperandReg(0); 2239 Node* reg_index = __ BytecodeOperandReg(0);
2228 Node* object = __ LoadRegister(reg_index); 2240 Node* object = __ LoadRegister(reg_index);
2229 Node* scope_info_idx = __ BytecodeOperandIdx(1); 2241 Node* scope_info_idx = __ BytecodeOperandIdx(1);
2230 Node* scope_info = __ LoadConstantPoolEntry(scope_info_idx); 2242 Node* scope_info = __ LoadConstantPoolEntry(scope_info_idx);
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2637 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, 2649 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset,
2638 __ SmiTag(new_state)); 2650 __ SmiTag(new_state));
2639 __ SetAccumulator(old_state); 2651 __ SetAccumulator(old_state);
2640 2652
2641 __ Dispatch(); 2653 __ Dispatch();
2642 } 2654 }
2643 2655
2644 } // namespace interpreter 2656 } // namespace interpreter
2645 } // namespace internal 2657 } // namespace internal
2646 } // namespace v8 2658 } // namespace v8
OLDNEW
« src/contexts.cc ('K') | « src/interpreter/bytecodes.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698