OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 RegisterAllocator* allocator() const { return allocator_; } | 319 RegisterAllocator* allocator() const { return allocator_; } |
320 | 320 |
321 CodeGenState* state() { return state_; } | 321 CodeGenState* state() { return state_; } |
322 void set_state(CodeGenState* state) { state_ = state; } | 322 void set_state(CodeGenState* state) { state_ = state; } |
323 | 323 |
324 void AddDeferred(DeferredCode* code) { deferred_.Add(code); } | 324 void AddDeferred(DeferredCode* code) { deferred_.Add(code); } |
325 | 325 |
326 bool in_spilled_code() const { return in_spilled_code_; } | 326 bool in_spilled_code() const { return in_spilled_code_; } |
327 void set_in_spilled_code(bool flag) { in_spilled_code_ = flag; } | 327 void set_in_spilled_code(bool flag) { in_spilled_code_ = flag; } |
328 | 328 |
329 static const uint32_t kTwoToThePowerOf63Exponent = | |
330 (HeapNumber::kExponentBias + 63) << HeapNumber::kExponentShift; | |
331 | |
332 private: | 329 private: |
333 // Construction/Destruction | 330 // Construction/Destruction |
334 CodeGenerator(int buffer_size, Handle<Script> script, bool is_eval); | 331 CodeGenerator(int buffer_size, Handle<Script> script, bool is_eval); |
335 virtual ~CodeGenerator() { delete masm_; } | 332 virtual ~CodeGenerator() { delete masm_; } |
336 | 333 |
337 // Accessors | 334 // Accessors |
338 Scope* scope() const { return scope_; } | 335 Scope* scope() const { return scope_; } |
339 bool is_eval() { return is_eval_; } | 336 bool is_eval() { return is_eval_; } |
340 | 337 |
341 // Generating deferred code. | 338 // Generating deferred code. |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 // Fast support for object equality testing. | 534 // Fast support for object equality testing. |
538 void GenerateObjectEquals(ZoneList<Expression*>* args); | 535 void GenerateObjectEquals(ZoneList<Expression*>* args); |
539 | 536 |
540 void GenerateLog(ZoneList<Expression*>* args); | 537 void GenerateLog(ZoneList<Expression*>* args); |
541 | 538 |
542 void GenerateGetFramePointer(ZoneList<Expression*>* args); | 539 void GenerateGetFramePointer(ZoneList<Expression*>* args); |
543 | 540 |
544 // Fast support for Math.random(). | 541 // Fast support for Math.random(). |
545 void GenerateRandomPositiveSmi(ZoneList<Expression*>* args); | 542 void GenerateRandomPositiveSmi(ZoneList<Expression*>* args); |
546 | 543 |
547 // Fast support for Math.sin and Math.cos. | |
548 enum MathOp { SIN, COS }; | |
549 void GenerateFastMathOp(MathOp op, ZoneList<Expression*>* args); | |
550 inline void GenerateMathSin(ZoneList<Expression*>* args); | |
551 inline void GenerateMathCos(ZoneList<Expression*>* args); | |
552 | |
553 // Fast support for StringAdd. | 544 // Fast support for StringAdd. |
554 void GenerateStringAdd(ZoneList<Expression*>* args); | 545 void GenerateStringAdd(ZoneList<Expression*>* args); |
555 | 546 |
556 // Simple condition analysis. | 547 // Simple condition analysis. |
557 enum ConditionAnalysis { | 548 enum ConditionAnalysis { |
558 ALWAYS_TRUE, | 549 ALWAYS_TRUE, |
559 ALWAYS_FALSE, | 550 ALWAYS_FALSE, |
560 DONT_KNOW | 551 DONT_KNOW |
561 }; | 552 }; |
562 ConditionAnalysis AnalyzeCondition(Expression* cond); | 553 ConditionAnalysis AnalyzeCondition(Expression* cond); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 bool ascii); | 764 bool ascii); |
774 | 765 |
775 // Should the stub check whether arguments are strings? | 766 // Should the stub check whether arguments are strings? |
776 bool string_check_; | 767 bool string_check_; |
777 }; | 768 }; |
778 | 769 |
779 | 770 |
780 } } // namespace v8::internal | 771 } } // namespace v8::internal |
781 | 772 |
782 #endif // V8_IA32_CODEGEN_IA32_H_ | 773 #endif // V8_IA32_CODEGEN_IA32_H_ |
OLD | NEW |