| OLD | NEW |
| 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 #endif // ENABLE_DISASSEMBLER | 152 #endif // ENABLE_DISASSEMBLER |
| 153 | 153 |
| 154 if (!code.is_null()) { | 154 if (!code.is_null()) { |
| 155 Counters::total_compiled_code_size.Increment(code->instruction_size()); | 155 Counters::total_compiled_code_size.Increment(code->instruction_size()); |
| 156 } | 156 } |
| 157 | 157 |
| 158 return code; | 158 return code; |
| 159 } | 159 } |
| 160 | 160 |
| 161 | 161 |
| 162 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 163 |
| 162 bool CodeGenerator::ShouldGenerateLog(Expression* type) { | 164 bool CodeGenerator::ShouldGenerateLog(Expression* type) { |
| 163 ASSERT(type != NULL); | 165 ASSERT(type != NULL); |
| 164 if (!Logger::is_enabled()) return false; | 166 if (!Logger::is_enabled()) return false; |
| 165 Handle<String> name = Handle<String>::cast(type->AsLiteral()->handle()); | 167 Handle<String> name = Handle<String>::cast(type->AsLiteral()->handle()); |
| 166 if (FLAG_log_regexp) { | 168 if (FLAG_log_regexp) { |
| 167 static Vector<const char> kRegexp = CStrVector("regexp"); | 169 static Vector<const char> kRegexp = CStrVector("regexp"); |
| 168 if (name->IsEqualTo(kRegexp)) | 170 if (name->IsEqualTo(kRegexp)) |
| 169 return true; | 171 return true; |
| 170 } | 172 } |
| 171 return false; | 173 return false; |
| 172 } | 174 } |
| 173 | 175 |
| 176 #endif |
| 177 |
| 174 | 178 |
| 175 // Sets the function info on a function. | 179 // Sets the function info on a function. |
| 176 // The start_position points to the first '(' character after the function name | 180 // The start_position points to the first '(' character after the function name |
| 177 // in the full script source. When counting characters in the script source the | 181 // in the full script source. When counting characters in the script source the |
| 178 // the first character is number 0 (not 1). | 182 // the first character is number 0 (not 1). |
| 179 void CodeGenerator::SetFunctionInfo(Handle<JSFunction> fun, | 183 void CodeGenerator::SetFunctionInfo(Handle<JSFunction> fun, |
| 180 int length, | 184 int length, |
| 181 int function_token_position, | 185 int function_token_position, |
| 182 int start_position, | 186 int start_position, |
| 183 int end_position, | 187 int end_position, |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 void ArgumentsAccessStub::Generate(MacroAssembler* masm) { | 527 void ArgumentsAccessStub::Generate(MacroAssembler* masm) { |
| 524 switch (type_) { | 528 switch (type_) { |
| 525 case READ_LENGTH: GenerateReadLength(masm); break; | 529 case READ_LENGTH: GenerateReadLength(masm); break; |
| 526 case READ_ELEMENT: GenerateReadElement(masm); break; | 530 case READ_ELEMENT: GenerateReadElement(masm); break; |
| 527 case NEW_OBJECT: GenerateNewObject(masm); break; | 531 case NEW_OBJECT: GenerateNewObject(masm); break; |
| 528 } | 532 } |
| 529 } | 533 } |
| 530 | 534 |
| 531 | 535 |
| 532 } } // namespace v8::internal | 536 } } // namespace v8::internal |
| OLD | NEW |