diff options
Diffstat (limited to 'deps/v8/src/full-codegen/full-codegen.h')
-rw-r--r-- | deps/v8/src/full-codegen/full-codegen.h | 134 |
1 files changed, 3 insertions, 131 deletions
diff --git a/deps/v8/src/full-codegen/full-codegen.h b/deps/v8/src/full-codegen/full-codegen.h index 558dae18dd..9a34cf93f0 100644 --- a/deps/v8/src/full-codegen/full-codegen.h +++ b/deps/v8/src/full-codegen/full-codegen.h @@ -82,7 +82,6 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { class Breakable; class Iteration; - class TryFinally; class TestContext; @@ -103,11 +102,9 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { virtual Breakable* AsBreakable() { return nullptr; } virtual Iteration* AsIteration() { return nullptr; } - virtual TryFinally* AsTryFinally() { return nullptr; } virtual bool IsContinueTarget(Statement* target) { return false; } virtual bool IsBreakTarget(Statement* target) { return false; } - virtual bool IsTryFinally() { return false; } // Notify the statement that we are exiting it via break, continue, or // return and give it a chance to generate cleanup code. Return the @@ -185,73 +182,6 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { } }; - class DeferredCommands { - public: - enum Command { kReturn, kThrow, kBreak, kContinue }; - typedef int TokenId; - struct DeferredCommand { - Command command; - TokenId token; - Statement* target; - }; - - DeferredCommands(FullCodeGenerator* codegen, Label* finally_entry) - : codegen_(codegen), - commands_(codegen->zone()), - return_token_(TokenDispenserForFinally::kInvalidToken), - throw_token_(TokenDispenserForFinally::kInvalidToken), - finally_entry_(finally_entry) {} - - void EmitCommands(); - - void RecordBreak(Statement* target); - void RecordContinue(Statement* target); - void RecordReturn(); - void RecordThrow(); - void EmitFallThrough(); - - private: - MacroAssembler* masm() { return codegen_->masm(); } - void EmitJumpToFinally(TokenId token); - - FullCodeGenerator* codegen_; - ZoneVector<DeferredCommand> commands_; - TokenDispenserForFinally dispenser_; - TokenId return_token_; - TokenId throw_token_; - Label* finally_entry_; - }; - - // The try block of a try/finally statement. - class TryFinally : public NestedStatement { - public: - TryFinally(FullCodeGenerator* codegen, DeferredCommands* commands) - : NestedStatement(codegen), deferred_commands_(commands) {} - - NestedStatement* Exit(int* context_length) override; - - bool IsTryFinally() override { return true; } - TryFinally* AsTryFinally() override { return this; } - - DeferredCommands* deferred_commands() { return deferred_commands_; } - - private: - DeferredCommands* deferred_commands_; - }; - - // The body of a with or catch. - class WithOrCatch : public NestedStatement { - public: - explicit WithOrCatch(FullCodeGenerator* codegen) - : NestedStatement(codegen) { - } - - NestedStatement* Exit(int* context_length) override { - ++(*context_length); - return previous_; - } - }; - // A platform-specific utility to overwrite the accumulator register // with a GC-safe value. void ClearAccumulator(); @@ -462,21 +392,15 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { // Platform-specific code sequences for calls void EmitCall(Call* expr, ConvertReceiverMode = ConvertReceiverMode::kAny); - void EmitSuperConstructorCall(Call* expr); void EmitCallWithLoadIC(Call* expr); - void EmitSuperCallWithLoadIC(Call* expr); void EmitKeyedCallWithLoadIC(Call* expr, Expression* key); - void EmitKeyedSuperCallWithLoadIC(Call* expr); - void EmitPossiblyEvalCall(Call* expr); #define FOR_EACH_FULL_CODE_INTRINSIC(F) \ F(IsSmi) \ F(IsArray) \ F(IsTypedArray) \ - F(IsRegExp) \ F(IsJSProxy) \ F(Call) \ - F(NewObject) \ F(IsJSReceiver) \ F(GetSuperConstructor) \ F(DebugBreakInOptimizedCode) \ @@ -506,23 +430,16 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { void RestoreContext(); // Platform-specific code for loading variables. - void EmitLoadGlobalCheckExtensions(VariableProxy* proxy, - TypeofMode typeof_mode, Label* slow); - MemOperand ContextSlotOperandCheckExtensions(Variable* var, Label* slow); - void EmitDynamicLookupFastCase(VariableProxy* proxy, TypeofMode typeof_mode, - Label* slow, Label* done); void EmitGlobalVariableLoad(VariableProxy* proxy, TypeofMode typeof_mode); void EmitVariableLoad(VariableProxy* proxy, TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); void EmitAccessor(ObjectLiteralProperty* property); - // Expects the arguments and the function already pushed. - void EmitResolvePossiblyDirectEval(Call* expr); - // Platform-specific support for allocating a new closure based on // the given function info. - void EmitNewClosure(Handle<SharedFunctionInfo> info, bool pretenure); + void EmitNewClosure(Handle<SharedFunctionInfo> info, FeedbackVectorSlot slot, + bool pretenure); // Re-usable portions of CallRuntime void EmitLoadJSRuntimeFunction(CallRuntime* expr); @@ -532,26 +449,10 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { // The receiver is left on the stack by the IC. void EmitNamedPropertyLoad(Property* expr); - // Load a value from super.named property. - // Expect receiver ('this' value) and home_object on the stack. - void EmitNamedSuperPropertyLoad(Property* expr); - - // Load a value from super[keyed] property. - // Expect receiver ('this' value), home_object and key on the stack. - void EmitKeyedSuperPropertyLoad(Property* expr); - // Load a value from a keyed property. // The receiver and the key is left on the stack by the IC. void EmitKeyedPropertyLoad(Property* expr); - // Adds the properties to the class (function) object and to its prototype. - // Expects the class (function) in the accumulator. The class (function) is - // in the accumulator after installing all the properties. - void EmitClassDefineProperties(ClassLiteral* lit); - - // Pushes the property key as a Name on the stack. - void EmitPropertyKey(LiteralProperty* property, BailoutId bailout_id); - // Apply the compound assignment operator. Expects the left operand on top // of the stack and the right one in the accumulator. void EmitBinaryOp(BinaryOperation* expr, Token::Value op); @@ -582,14 +483,6 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { // of the stack and the right-hand-side value in the accumulator. void EmitNamedPropertyAssignment(Assignment* expr); - // Complete a super named property assignment. The right-hand-side value - // is expected in accumulator. - void EmitNamedSuperPropertyStore(Property* prop); - - // Complete a super named property assignment. The right-hand-side value - // is expected in accumulator. - void EmitKeyedSuperPropertyStore(Property* prop); - // Complete a keyed property assignment. The receiver and key are // expected on top of the stack and the right-hand-side value in the // accumulator. @@ -648,14 +541,7 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { void RecordStatementPosition(int pos); void RecordPosition(int pos); - // Non-local control flow support. - void EnterTryBlock(int handler_index, Label* handler, - HandlerTable::CatchPrediction catch_prediction); - void ExitTryBlock(int handler_index); - void EnterFinallyBlock(); - void ExitFinallyBlock(); - void ClearPendingMessage(); - + // Local control flow support. void EmitContinue(Statement* target); void EmitBreak(Statement* target); @@ -698,8 +584,6 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { // and PushCatchContext. void PushFunctionArgumentForContextAllocation(); - void PushCalleeAndWithBaseObject(Call* expr); - // AST node visit functions. #define DECLARE_VISIT(type) void Visit##type(type* node); AST_NODE_LIST(DECLARE_VISIT) @@ -714,13 +598,10 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { void Generate(); void PopulateDeoptimizationData(Handle<Code> code); void PopulateTypeFeedbackInfo(Handle<Code> code); - void PopulateHandlerTable(Handle<Code> code); bool MustCreateObjectLiteralWithRuntime(ObjectLiteral* expr) const; bool MustCreateArrayLiteralWithRuntime(ArrayLiteral* expr) const; - int NewHandlerTableEntry(); - struct BailoutEntry { BailoutId id; unsigned pc_and_state; @@ -732,14 +613,6 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { uint32_t loop_depth; }; - struct HandlerTableEntry { - unsigned range_start; - unsigned range_end; - unsigned handler_offset; - int stack_depth; - HandlerTable::CatchPrediction catch_prediction; - }; - class ExpressionContext BASE_EMBEDDED { public: explicit ExpressionContext(FullCodeGenerator* codegen) @@ -937,7 +810,6 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { const ExpressionContext* context_; ZoneList<BailoutEntry> bailout_entries_; ZoneList<BackEdgeEntry> back_edges_; - ZoneVector<HandlerTableEntry> handler_table_; SourcePositionTableBuilder source_position_table_builder_; int ic_total_count_; Handle<Cell> profiling_counter_; |