Changeset 193606 in webkit for trunk/Source/JavaScriptCore/runtime/Executable.h
- Timestamp:
- Dec 6, 2015, 5:54:43 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/Executable.h
r193584 r193606 345 345 bool usesArguments() const { return m_features & ArgumentsFeature; } 346 346 bool needsActivation() const { return m_hasCapturedVariables || m_features & (EvalFeature | WithFeature); } 347 bool isArrowFunctionContext() const { return m_isArrowFunctionContext; }348 347 bool isStrictMode() const { return m_features & StrictModeFeature; } 349 bool isDerivedConstructorContext() const { return m_isDerivedConstructorContext; }350 348 ECMAMode ecmaMode() const { return isStrictMode() ? StrictMode : NotStrictMode; } 351 349 … … 396 394 397 395 protected: 398 ScriptExecutable(Structure* , VM&, const SourceCode&, bool isInStrictContext, bool isInDerivedConstructorContext, bool isInArrowFunctionContext);396 ScriptExecutable(Structure* structure, VM& vm, const SourceCode& source, bool isInStrictContext); 399 397 400 398 void finishCreation(VM& vm) … … 415 413 bool m_neverOptimize { false }; 416 414 bool m_didTryToEnterInLoop; 417 bool m_isDerivedConstructorContext;418 bool m_isArrowFunctionContext;419 415 int m_overrideLineNumber; 420 416 int m_firstLine; … … 439 435 } 440 436 441 static EvalExecutable* create(ExecState*, const SourceCode&, bool isInStrictContext, ThisTDZMode, bool isDerivedConstructorContext, bool isArrowFunctionContext,const VariableEnvironment*);437 static EvalExecutable* create(ExecState*, const SourceCode&, bool isInStrictContext, ThisTDZMode, const VariableEnvironment*); 442 438 443 439 PassRefPtr<JITCode> generatedJITCode() … … 453 449 DECLARE_INFO; 454 450 455 456 ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, GeneratorThisMode::NonEmpty, SuperBinding::NotNeeded, SourceParseMode::ProgramMode, isDerivedConstructorContext(), isArrowFunctionContext()); } 451 ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, GeneratorThisMode::NonEmpty, SuperBinding::NotNeeded, SourceParseMode::ProgramMode); } 457 452 458 453 unsigned numVariables() { return m_unlinkedEvalCodeBlock->numVariables(); } … … 462 457 friend class ExecutableBase; 463 458 friend class ScriptExecutable; 464 EvalExecutable(ExecState*, const SourceCode&, bool inStrictContext, bool isDerivedConstructorContext, bool isArrowFunctionContext);459 EvalExecutable(ExecState*, const SourceCode&, bool); 465 460 466 461 static void visitChildren(JSCell*, SlotVisitor&); … … 507 502 DECLARE_INFO; 508 503 509 ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, GeneratorThisMode::NonEmpty, SuperBinding::NotNeeded, SourceParseMode::ProgramMode , isDerivedConstructorContext(), false); }504 ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, GeneratorThisMode::NonEmpty, SuperBinding::NotNeeded, SourceParseMode::ProgramMode); } 510 505 511 506 private: … … 548 543 DECLARE_INFO; 549 544 550 ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, GeneratorThisMode::NonEmpty, SuperBinding::NotNeeded, SourceParseMode::ModuleEvaluateMode, isDerivedConstructorContext(), false); } 551 545 ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, GeneratorThisMode::NonEmpty, SuperBinding::NotNeeded, SourceParseMode::ModuleEvaluateMode); } 552 546 UnlinkedModuleProgramCodeBlock* unlinkedModuleProgramCodeBlock() { return m_unlinkedModuleProgramCodeBlock.get(); } 553 547 … … 657 651 bool isBuiltinFunction() const { return m_unlinkedExecutable->isBuiltinFunction(); } 658 652 ConstructAbility constructAbility() const { return m_unlinkedExecutable->constructAbility(); } 659 // TODO:Think about avoid using isArrowFunction veriabl660 bool isArrowFunction() const { return parseMode() == SourceParseMode::ArrowFunctionMode; }661 bool isDerivedConstructorContext() const { return m_unlinkedExecutable->isDerivedConstructorContext(); }662 653 bool isClassConstructorFunction() const { return m_unlinkedExecutable->isClassConstructorFunction(); } 663 654 const Identifier& name() { return m_unlinkedExecutable->name(); } … … 666 657 size_t parameterCount() const { return m_unlinkedExecutable->parameterCount(); } // Excluding 'this'! 667 658 SourceParseMode parseMode() const { return m_unlinkedExecutable->parseMode(); } 659 bool isArrowFunction() const { return parseMode() == SourceParseMode::ArrowFunctionMode; } 668 660 669 661 static void visitChildren(JSCell*, SlotVisitor&);
Note:
See TracChangeset
for help on using the changeset viewer.