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