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

Side by Side Diff: src/compiler/js-operator.h

Issue 2435023002: Use a different map to distinguish eval contexts (Closed)
Patch Set: Changes from review Created 4 years 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
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/compiler/js-operator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #ifndef V8_COMPILER_JS_OPERATOR_H_ 5 #ifndef V8_COMPILER_JS_OPERATOR_H_
6 #define V8_COMPILER_JS_OPERATOR_H_ 6 #define V8_COMPILER_JS_OPERATOR_H_
7 7
8 #include "src/base/compiler-specific.h" 8 #include "src/base/compiler-specific.h"
9 #include "src/globals.h" 9 #include "src/globals.h"
10 #include "src/runtime/runtime.h" 10 #include "src/runtime/runtime.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 CreateCatchContextParameters const& rhs); 234 CreateCatchContextParameters const& rhs);
235 235
236 size_t hash_value(CreateCatchContextParameters const& parameters); 236 size_t hash_value(CreateCatchContextParameters const& parameters);
237 237
238 std::ostream& operator<<(std::ostream& os, 238 std::ostream& operator<<(std::ostream& os,
239 CreateCatchContextParameters const& parameters); 239 CreateCatchContextParameters const& parameters);
240 240
241 CreateCatchContextParameters const& CreateCatchContextParametersOf( 241 CreateCatchContextParameters const& CreateCatchContextParametersOf(
242 Operator const*); 242 Operator const*);
243 243
244 // Defines the slot count and ScopeType for a new function or eval context. This
245 // is used as a parameter by the JSCreateFunctionContext operator.
246 class CreateFunctionContextParameters final {
247 public:
248 CreateFunctionContextParameters(int slot_count, ScopeType scope_type);
249
250 int slot_count() const { return slot_count_; }
251 ScopeType scope_type() const { return scope_type_; }
252
253 private:
254 int const slot_count_;
255 ScopeType const scope_type_;
256 };
257
258 bool operator==(CreateFunctionContextParameters const& lhs,
259 CreateFunctionContextParameters const& rhs);
260 bool operator!=(CreateFunctionContextParameters const& lhs,
261 CreateFunctionContextParameters const& rhs);
262
263 size_t hash_value(CreateFunctionContextParameters const& parameters);
264
265 std::ostream& operator<<(std::ostream& os,
266 CreateFunctionContextParameters const& parameters);
267
268 CreateFunctionContextParameters const& CreateFunctionContextParametersOf(
269 Operator const*);
270
244 // Defines the property of an object for a named access. This is 271 // Defines the property of an object for a named access. This is
245 // used as a parameter by the JSLoadNamed and JSStoreNamed operators. 272 // used as a parameter by the JSLoadNamed and JSStoreNamed operators.
246 class NamedAccess final { 273 class NamedAccess final {
247 public: 274 public:
248 NamedAccess(LanguageMode language_mode, Handle<Name> name, 275 NamedAccess(LanguageMode language_mode, Handle<Name> name,
249 VectorSlotPair const& feedback) 276 VectorSlotPair const& feedback)
250 : name_(name), feedback_(feedback), language_mode_(language_mode) {} 277 : name_(name), feedback_(feedback), language_mode_(language_mode) {}
251 278
252 Handle<Name> name() const { return name_; } 279 Handle<Name> name() const { return name_; }
253 LanguageMode language_mode() const { return language_mode_; } 280 LanguageMode language_mode() const { return language_mode_; }
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 573
547 // Used to implement Ignition's SuspendGenerator bytecode. 574 // Used to implement Ignition's SuspendGenerator bytecode.
548 const Operator* GeneratorStore(int register_count); 575 const Operator* GeneratorStore(int register_count);
549 576
550 // Used to implement Ignition's ResumeGenerator bytecode. 577 // Used to implement Ignition's ResumeGenerator bytecode.
551 const Operator* GeneratorRestoreContinuation(); 578 const Operator* GeneratorRestoreContinuation();
552 const Operator* GeneratorRestoreRegister(int index); 579 const Operator* GeneratorRestoreRegister(int index);
553 580
554 const Operator* StackCheck(); 581 const Operator* StackCheck();
555 582
556 const Operator* CreateFunctionContext(int slot_count); 583 const Operator* CreateFunctionContext(int slot_count, ScopeType scope_type);
557 const Operator* CreateCatchContext(const Handle<String>& name, 584 const Operator* CreateCatchContext(const Handle<String>& name,
558 const Handle<ScopeInfo>& scope_info); 585 const Handle<ScopeInfo>& scope_info);
559 const Operator* CreateWithContext(const Handle<ScopeInfo>& scope_info); 586 const Operator* CreateWithContext(const Handle<ScopeInfo>& scope_info);
560 const Operator* CreateBlockContext(const Handle<ScopeInfo>& scpope_info); 587 const Operator* CreateBlockContext(const Handle<ScopeInfo>& scpope_info);
561 const Operator* CreateModuleContext(); 588 const Operator* CreateModuleContext();
562 const Operator* CreateScriptContext(const Handle<ScopeInfo>& scpope_info); 589 const Operator* CreateScriptContext(const Handle<ScopeInfo>& scpope_info);
563 590
564 private: 591 private:
565 Zone* zone() const { return zone_; } 592 Zone* zone() const { return zone_; }
566 593
567 const JSOperatorGlobalCache& cache_; 594 const JSOperatorGlobalCache& cache_;
568 Zone* const zone_; 595 Zone* const zone_;
569 596
570 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); 597 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder);
571 }; 598 };
572 599
573 } // namespace compiler 600 } // namespace compiler
574 } // namespace internal 601 } // namespace internal
575 } // namespace v8 602 } // namespace v8
576 603
577 #endif // V8_COMPILER_JS_OPERATOR_H_ 604 #endif // V8_COMPILER_JS_OPERATOR_H_
OLDNEW
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/compiler/js-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698