| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 // CodeGenerator | 188 // CodeGenerator |
| 189 | 189 |
| 190 class CodeGenerator: public AstVisitor { | 190 class CodeGenerator: public AstVisitor { |
| 191 public: | 191 public: |
| 192 // Takes a function literal, generates code for it. This function should only | 192 // Takes a function literal, generates code for it. This function should only |
| 193 // be called by compiler.cc. | 193 // be called by compiler.cc. |
| 194 static Handle<Code> MakeCode(FunctionLiteral* fun, | 194 static Handle<Code> MakeCode(FunctionLiteral* fun, |
| 195 Handle<Script> script, | 195 Handle<Script> script, |
| 196 bool is_eval); | 196 bool is_eval); |
| 197 | 197 |
| 198 static bool ShouldGenerateLog(Expression* type); |
| 199 |
| 198 static void SetFunctionInfo(Handle<JSFunction> fun, | 200 static void SetFunctionInfo(Handle<JSFunction> fun, |
| 199 int length, | 201 int length, |
| 200 int function_token_position, | 202 int function_token_position, |
| 201 int start_position, | 203 int start_position, |
| 202 int end_position, | 204 int end_position, |
| 203 bool is_expression, | 205 bool is_expression, |
| 204 bool is_toplevel, | 206 bool is_toplevel, |
| 205 Handle<Script> script); | 207 Handle<Script> script); |
| 206 | 208 |
| 207 // Accessors | 209 // Accessors |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 // Support for accessing the value field of an object (used by Date). | 319 // Support for accessing the value field of an object (used by Date). |
| 318 void GenerateValueOf(ZoneList<Expression*>* args); | 320 void GenerateValueOf(ZoneList<Expression*>* args); |
| 319 void GenerateSetValueOf(ZoneList<Expression*>* args); | 321 void GenerateSetValueOf(ZoneList<Expression*>* args); |
| 320 | 322 |
| 321 // Fast support for charCodeAt(n). | 323 // Fast support for charCodeAt(n). |
| 322 void GenerateFastCharCodeAt(ZoneList<Expression*>* args); | 324 void GenerateFastCharCodeAt(ZoneList<Expression*>* args); |
| 323 | 325 |
| 324 // Fast support for object equality testing. | 326 // Fast support for object equality testing. |
| 325 void GenerateObjectEquals(ZoneList<Expression*>* args); | 327 void GenerateObjectEquals(ZoneList<Expression*>* args); |
| 326 | 328 |
| 329 void GenerateLog(ZoneList<Expression*>* args); |
| 330 |
| 327 // Methods and constants for fast case switch statement support. | 331 // Methods and constants for fast case switch statement support. |
| 328 // | 332 // |
| 329 // Only allow fast-case switch if the range of labels is at most | 333 // Only allow fast-case switch if the range of labels is at most |
| 330 // this factor times the number of case labels. | 334 // this factor times the number of case labels. |
| 331 // Value is derived from comparing the size of code generated by the normal | 335 // Value is derived from comparing the size of code generated by the normal |
| 332 // switch code for Smi-labels to the size of a single pointer. If code | 336 // switch code for Smi-labels to the size of a single pointer. If code |
| 333 // quality increases this number should be decreased to match. | 337 // quality increases this number should be decreased to match. |
| 334 static const int kFastSwitchMaxOverheadFactor = 10; | 338 static const int kFastSwitchMaxOverheadFactor = 10; |
| 335 | 339 |
| 336 // Minimal number of switch cases required before we allow jump-table | 340 // Minimal number of switch cases required before we allow jump-table |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 | 406 |
| 403 friend class VirtualFrame; | 407 friend class VirtualFrame; |
| 404 friend class Reference; | 408 friend class Reference; |
| 405 | 409 |
| 406 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | 410 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
| 407 }; | 411 }; |
| 408 | 412 |
| 409 } } // namespace v8::internal | 413 } } // namespace v8::internal |
| 410 | 414 |
| 411 #endif // V8_CODEGEN_ARM_H_ | 415 #endif // V8_CODEGEN_ARM_H_ |
| OLD | NEW |