| Index: src/x64/codegen-x64.h
|
| ===================================================================
|
| --- src/x64/codegen-x64.h (revision 3935)
|
| +++ src/x64/codegen-x64.h (working copy)
|
| @@ -294,15 +294,6 @@
|
|
|
| class CodeGenerator: public AstVisitor {
|
| public:
|
| - // Compilation mode. Either the compiler is used as the primary
|
| - // compiler and needs to setup everything or the compiler is used as
|
| - // the secondary compiler for split compilation and has to handle
|
| - // bailouts.
|
| - enum Mode {
|
| - PRIMARY,
|
| - SECONDARY
|
| - };
|
| -
|
| // Takes a function literal, generates code for it. This function should only
|
| // be called by compiler.cc.
|
| static Handle<Code> MakeCode(CompilationInfo* info);
|
| @@ -385,7 +376,7 @@
|
| void VisitStatementsAndSpill(ZoneList<Statement*>* statements);
|
|
|
| // Main code generation function
|
| - void Generate(CompilationInfo* info, Mode mode);
|
| + void Generate(CompilationInfo* info);
|
|
|
| // Generate the return sequence code. Should be called no more than
|
| // once per compiled function, immediately after binding the return
|
| @@ -484,7 +475,8 @@
|
| Result* right,
|
| OverwriteMode overwrite_mode);
|
|
|
| - void Comparison(Condition cc,
|
| + void Comparison(AstNode* node,
|
| + Condition cc,
|
| bool strict,
|
| ControlDestination* destination);
|
|
|
| @@ -535,6 +527,7 @@
|
| void GenerateIsSmi(ZoneList<Expression*>* args);
|
| void GenerateIsNonNegativeSmi(ZoneList<Expression*>* args);
|
| void GenerateIsArray(ZoneList<Expression*>* args);
|
| + void GenerateIsRegExp(ZoneList<Expression*>* args);
|
| void GenerateIsObject(ZoneList<Expression*>* args);
|
| void GenerateIsFunction(ZoneList<Expression*>* args);
|
| void GenerateIsUndetectableObject(ZoneList<Expression*>* args);
|
| @@ -576,7 +569,14 @@
|
| // Support for direct calls from JavaScript to native RegExp code.
|
| void GenerateRegExpExec(ZoneList<Expression*>* args);
|
|
|
| - // Simple condition analysis.
|
| + // Fast support for number to string.
|
| + void GenerateNumberToString(ZoneList<Expression*>* args);
|
| +
|
| + // Fast call to math functions.
|
| + void GenerateMathSin(ZoneList<Expression*>* args);
|
| + void GenerateMathCos(ZoneList<Expression*>* args);
|
| +
|
| +// Simple condition analysis.
|
| enum ConditionAnalysis {
|
| ALWAYS_TRUE,
|
| ALWAYS_FALSE,
|
| @@ -654,13 +654,15 @@
|
| public:
|
| GenericBinaryOpStub(Token::Value op,
|
| OverwriteMode mode,
|
| - GenericBinaryFlags flags)
|
| + GenericBinaryFlags flags,
|
| + NumberInfo::Type operands_type = NumberInfo::kUnknown)
|
| : op_(op),
|
| mode_(mode),
|
| flags_(flags),
|
| args_in_registers_(false),
|
| args_reversed_(false),
|
| - name_(NULL) {
|
| + name_(NULL),
|
| + operands_type_(operands_type) {
|
| use_sse3_ = CpuFeatures::IsSupported(SSE3);
|
| ASSERT(OpBits::is_valid(Token::NUM_TOKENS));
|
| }
|
| @@ -685,28 +687,32 @@
|
| bool args_reversed_; // Left and right argument are swapped.
|
| bool use_sse3_;
|
| char* name_;
|
| + NumberInfo::Type operands_type_;
|
|
|
| const char* GetName();
|
|
|
| #ifdef DEBUG
|
| void Print() {
|
| - PrintF("GenericBinaryOpStub (op %s), "
|
| - "(mode %d, flags %d, registers %d, reversed %d)\n",
|
| + PrintF("GenericBinaryOpStub %d (op %s), "
|
| + "(mode %d, flags %d, registers %d, reversed %d, only_numbers %s)\n",
|
| + MinorKey(),
|
| Token::String(op_),
|
| static_cast<int>(mode_),
|
| static_cast<int>(flags_),
|
| static_cast<int>(args_in_registers_),
|
| - static_cast<int>(args_reversed_));
|
| + static_cast<int>(args_reversed_),
|
| + NumberInfo::ToString(operands_type_));
|
| }
|
| #endif
|
|
|
| - // Minor key encoding in 16 bits FRASOOOOOOOOOOMM.
|
| + // Minor key encoding in 16 bits NNNFRASOOOOOOOMM.
|
| class ModeBits: public BitField<OverwriteMode, 0, 2> {};
|
| - class OpBits: public BitField<Token::Value, 2, 10> {};
|
| - class SSE3Bits: public BitField<bool, 12, 1> {};
|
| - class ArgsInRegistersBits: public BitField<bool, 13, 1> {};
|
| - class ArgsReversedBits: public BitField<bool, 14, 1> {};
|
| - class FlagBits: public BitField<GenericBinaryFlags, 15, 1> {};
|
| + class OpBits: public BitField<Token::Value, 2, 7> {};
|
| + class SSE3Bits: public BitField<bool, 9, 1> {};
|
| + class ArgsInRegistersBits: public BitField<bool, 10, 1> {};
|
| + class ArgsReversedBits: public BitField<bool, 11, 1> {};
|
| + class FlagBits: public BitField<GenericBinaryFlags, 12, 1> {};
|
| + class NumberInfoBits: public BitField<NumberInfo::Type, 13, 3> {};
|
|
|
| Major MajorKey() { return GenericBinaryOp; }
|
| int MinorKey() {
|
| @@ -716,7 +722,8 @@
|
| | FlagBits::encode(flags_)
|
| | SSE3Bits::encode(use_sse3_)
|
| | ArgsInRegistersBits::encode(args_in_registers_)
|
| - | ArgsReversedBits::encode(args_reversed_);
|
| + | ArgsReversedBits::encode(args_reversed_)
|
| + | NumberInfoBits::encode(operands_type_);
|
| }
|
|
|
| void Generate(MacroAssembler* masm);
|
|
|