vendor/v8/src/full-codegen.h in mustang-0.0.1 vs vendor/v8/src/full-codegen.h in mustang-0.1.0

- old
+ new

@@ -272,16 +272,10 @@ private: Expression* const expr_; ForwardBailoutStack* const parent_; }; - enum ConstantOperand { - kNoConstants, - kLeftConstant, - kRightConstant - }; - // Type of a member function that generates inline code for a native function. typedef void (FullCodeGenerator::*InlineFunctionGenerator) (ZoneList<Expression*>*); static const InlineFunctionGenerator kInlineFunctionGenerators[]; @@ -296,15 +290,10 @@ // Determine whether or not to inline the smi case for the given // operation. bool ShouldInlineSmiCase(Token::Value op); - // Compute which (if any) of the operands is a compile-time constant. - ConstantOperand GetConstantOperand(Token::Value op, - Expression* left, - Expression* right); - // Helper function to convert a pure value into a test context. The value // is expected on the stack or the accumulator, depending on the platform. // See the platform-specific implementation for details. void DoTest(Label* if_true, Label* if_false, Label* fall_through); @@ -430,10 +419,18 @@ TypeofState typeof_state, Label* slow, Label* done); void EmitVariableLoad(Variable* expr); + enum ResolveEvalFlag { + SKIP_CONTEXT_LOOKUP, + PERFORM_CONTEXT_LOOKUP + }; + + // Expects the arguments and the function already pushed. + void EmitResolvePossiblyDirectEval(ResolveEvalFlag flag, int arg_count); + // Platform-specific support for allocating a new closure based on // the given function info. void EmitNewClosure(Handle<SharedFunctionInfo> info, bool pretenure); // Platform-specific support for compiling assignments. @@ -455,39 +452,12 @@ // binary operations. void EmitInlineSmiBinaryOp(Expression* expr, Token::Value op, OverwriteMode mode, Expression* left, - Expression* right, - ConstantOperand constant); + Expression* right); - void EmitConstantSmiBinaryOp(Expression* expr, - Token::Value op, - OverwriteMode mode, - bool left_is_constant_smi, - Smi* value); - - void EmitConstantSmiBitOp(Expression* expr, - Token::Value op, - OverwriteMode mode, - Smi* value); - - void EmitConstantSmiShiftOp(Expression* expr, - Token::Value op, - OverwriteMode mode, - Smi* value); - - void EmitConstantSmiAdd(Expression* expr, - OverwriteMode mode, - bool left_is_constant_smi, - Smi* value); - - void EmitConstantSmiSub(Expression* expr, - OverwriteMode mode, - bool left_is_constant_smi, - Smi* value); - // Assign to the given expression as if via '='. The right-hand-side value // is expected in the accumulator. void EmitAssignment(Expression* expr, int bailout_ast_id); // Complete a variable assignment. The right-hand-side value is expected @@ -529,13 +499,13 @@ const ExpressionContext* context() { return context_; } void set_new_context(const ExpressionContext* context) { context_ = context; } Handle<Script> script() { return info_->script(); } bool is_eval() { return info_->is_eval(); } - bool is_strict() { return function()->strict_mode(); } + bool is_strict_mode() { return function()->strict_mode(); } StrictModeFlag strict_mode_flag() { - return is_strict() ? kStrictMode : kNonStrictMode; + return is_strict_mode() ? kStrictMode : kNonStrictMode; } FunctionLiteral* function() { return info_->function(); } Scope* scope() { return info_->scope(); } static Register result_register(); @@ -580,9 +550,11 @@ } virtual ~ExpressionContext() { codegen_->set_new_context(old_); } + + Isolate* isolate() const { return codegen_->isolate(); } // Convert constant control flow (true or false) to the result expected for // this expression context. virtual void Plug(bool flag) const = 0;