| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 CompilationInfo* info() const { return info_; } | 70 CompilationInfo* info() const { return info_; } |
| 71 Isolate* isolate() const { return info_->isolate(); } | 71 Isolate* isolate() const { return info_->isolate(); } |
| 72 Factory* factory() const { return isolate()->factory(); } | 72 Factory* factory() const { return isolate()->factory(); } |
| 73 Heap* heap() const { return isolate()->heap(); } | 73 Heap* heap() const { return isolate()->heap(); } |
| 74 | 74 |
| 75 // Support for converting LOperands to assembler types. | 75 // Support for converting LOperands to assembler types. |
| 76 Register ToRegister(LOperand* op) const; | 76 Register ToRegister(LOperand* op) const; |
| 77 XMMRegister ToDoubleRegister(LOperand* op) const; | 77 XMMRegister ToDoubleRegister(LOperand* op) const; |
| 78 bool IsInteger32Constant(LConstantOperand* op) const; | 78 bool IsInteger32Constant(LConstantOperand* op) const; |
| 79 int ToInteger32(LConstantOperand* op) const; | 79 int ToInteger32(LConstantOperand* op) const; |
| 80 double ToDouble(LConstantOperand* op) const; |
| 80 bool IsTaggedConstant(LConstantOperand* op) const; | 81 bool IsTaggedConstant(LConstantOperand* op) const; |
| 81 Handle<Object> ToHandle(LConstantOperand* op) const; | 82 Handle<Object> ToHandle(LConstantOperand* op) const; |
| 82 Operand ToOperand(LOperand* op) const; | 83 Operand ToOperand(LOperand* op) const; |
| 83 | 84 |
| 84 // Try to generate code for the entire chunk, but it may fail if the | 85 // Try to generate code for the entire chunk, but it may fail if the |
| 85 // chunk contains constructs we cannot handle. Returns true if the | 86 // chunk contains constructs we cannot handle. Returns true if the |
| 86 // code generation attempt succeeded. | 87 // code generation attempt succeeded. |
| 87 bool GenerateCode(); | 88 bool GenerateCode(); |
| 88 | 89 |
| 89 // Finish the code by setting stack height, safepoint, and bailout | 90 // Finish the code by setting stack height, safepoint, and bailout |
| (...skipping 28 matching lines...) Expand all Loading... |
| 118 GENERATING, | 119 GENERATING, |
| 119 DONE, | 120 DONE, |
| 120 ABORTED | 121 ABORTED |
| 121 }; | 122 }; |
| 122 | 123 |
| 123 bool is_unused() const { return status_ == UNUSED; } | 124 bool is_unused() const { return status_ == UNUSED; } |
| 124 bool is_generating() const { return status_ == GENERATING; } | 125 bool is_generating() const { return status_ == GENERATING; } |
| 125 bool is_done() const { return status_ == DONE; } | 126 bool is_done() const { return status_ == DONE; } |
| 126 bool is_aborted() const { return status_ == ABORTED; } | 127 bool is_aborted() const { return status_ == ABORTED; } |
| 127 | 128 |
| 128 int strict_mode_flag() const { | 129 StrictModeFlag strict_mode_flag() const { |
| 129 return info()->is_strict_mode() ? kStrictMode : kNonStrictMode; | 130 return info()->strict_mode_flag(); |
| 130 } | 131 } |
| 131 | 132 |
| 132 LChunk* chunk() const { return chunk_; } | 133 LChunk* chunk() const { return chunk_; } |
| 133 Scope* scope() const { return scope_; } | 134 Scope* scope() const { return scope_; } |
| 134 HGraph* graph() const { return chunk_->graph(); } | 135 HGraph* graph() const { return chunk_->graph(); } |
| 135 | 136 |
| 136 int GetNextEmittedBlock(int block); | 137 int GetNextEmittedBlock(int block); |
| 137 LInstruction* GetNextInstruction(); | 138 LInstruction* GetNextInstruction(); |
| 138 | 139 |
| 139 void EmitClassOfTest(Label* if_true, | 140 void EmitClassOfTest(Label* if_true, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 int num_arguments, | 184 int num_arguments, |
| 184 LInstruction* instr) { | 185 LInstruction* instr) { |
| 185 const Runtime::Function* function = Runtime::FunctionForId(id); | 186 const Runtime::Function* function = Runtime::FunctionForId(id); |
| 186 CallRuntime(function, num_arguments, instr); | 187 CallRuntime(function, num_arguments, instr); |
| 187 } | 188 } |
| 188 | 189 |
| 189 void CallRuntimeFromDeferred(Runtime::FunctionId id, | 190 void CallRuntimeFromDeferred(Runtime::FunctionId id, |
| 190 int argc, | 191 int argc, |
| 191 LInstruction* instr); | 192 LInstruction* instr); |
| 192 | 193 |
| 193 | |
| 194 // Generate a direct call to a known function. Expects the function | 194 // Generate a direct call to a known function. Expects the function |
| 195 // to be in edi. | 195 // to be in rdi. |
| 196 void CallKnownFunction(Handle<JSFunction> function, | 196 void CallKnownFunction(Handle<JSFunction> function, |
| 197 int arity, | 197 int arity, |
| 198 LInstruction* instr, | 198 LInstruction* instr, |
| 199 CallKind call_kind); | 199 CallKind call_kind); |
| 200 | 200 |
| 201 void LoadHeapObject(Register result, Handle<HeapObject> object); | 201 void LoadHeapObject(Register result, Handle<HeapObject> object); |
| 202 | 202 |
| 203 void RegisterLazyDeoptimization(LInstruction* instr, | 203 void RegisterLazyDeoptimization(LInstruction* instr, |
| 204 SafepointMode safepoint_mode, | 204 SafepointMode safepoint_mode, |
| 205 int argc); | 205 int argc); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 int arguments, | 244 int arguments, |
| 245 int deoptimization_index); | 245 int deoptimization_index); |
| 246 void RecordPosition(int position); | 246 void RecordPosition(int position); |
| 247 int LastSafepointEnd() { | 247 int LastSafepointEnd() { |
| 248 return static_cast<int>(safepoints_.GetPcAfterGap()); | 248 return static_cast<int>(safepoints_.GetPcAfterGap()); |
| 249 } | 249 } |
| 250 | 250 |
| 251 static Condition TokenToCondition(Token::Value op, bool is_unsigned); | 251 static Condition TokenToCondition(Token::Value op, bool is_unsigned); |
| 252 void EmitGoto(int block); | 252 void EmitGoto(int block); |
| 253 void EmitBranch(int left_block, int right_block, Condition cc); | 253 void EmitBranch(int left_block, int right_block, Condition cc); |
| 254 void EmitCmpI(LOperand* left, LOperand* right); | |
| 255 void EmitNumberUntagD(Register input, | 254 void EmitNumberUntagD(Register input, |
| 256 XMMRegister result, | 255 XMMRegister result, |
| 257 bool deoptimize_on_undefined, | 256 bool deoptimize_on_undefined, |
| 258 LEnvironment* env); | 257 LEnvironment* env); |
| 259 | 258 |
| 260 // Emits optimized code for typeof x == "y". Modifies input register. | 259 // Emits optimized code for typeof x == "y". Modifies input register. |
| 261 // Returns the condition on which a final split to | 260 // Returns the condition on which a final split to |
| 262 // true and false label should be made, to optimize fallthrough. | 261 // true and false label should be made, to optimize fallthrough. |
| 263 Condition EmitTypeofIs(Label* true_label, Label* false_label, | 262 Condition EmitTypeofIs(Label* true_label, |
| 264 Register input, Handle<String> type_name); | 263 Label* false_label, |
| 264 Register input, |
| 265 Handle<String> type_name); |
| 265 | 266 |
| 266 // Emits optimized code for %_IsObject(x). Preserves input register. | 267 // Emits optimized code for %_IsObject(x). Preserves input register. |
| 267 // Returns the condition on which a final split to | 268 // Returns the condition on which a final split to |
| 268 // true and false label should be made, to optimize fallthrough. | 269 // true and false label should be made, to optimize fallthrough. |
| 269 Condition EmitIsObject(Register input, | 270 Condition EmitIsObject(Register input, |
| 270 Label* is_not_object, | 271 Label* is_not_object, |
| 271 Label* is_object); | 272 Label* is_object); |
| 272 | 273 |
| 273 // Emits optimized code for %_IsConstructCall(). | 274 // Emits optimized code for %_IsConstructCall(). |
| 274 // Caller should branch on equal condition. | 275 // Caller should branch on equal condition. |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 LCodeGen* codegen_; | 370 LCodeGen* codegen_; |
| 370 Label entry_; | 371 Label entry_; |
| 371 Label exit_; | 372 Label exit_; |
| 372 Label* external_exit_; | 373 Label* external_exit_; |
| 373 int instruction_index_; | 374 int instruction_index_; |
| 374 }; | 375 }; |
| 375 | 376 |
| 376 } } // namespace v8::internal | 377 } } // namespace v8::internal |
| 377 | 378 |
| 378 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ | 379 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ |
| OLD | NEW |