| 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 3152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3163 ASSERT(kSeqStringTag == 0); | 3163 ASSERT(kSeqStringTag == 0); |
| 3164 __ test(ecx, Immediate(kStringRepresentationMask)); | 3164 __ test(ecx, Immediate(kStringRepresentationMask)); |
| 3165 __ j(not_zero, ¬_a_flat_string, not_taken); | 3165 __ j(not_zero, ¬_a_flat_string, not_taken); |
| 3166 | 3166 |
| 3167 // Check for 1-byte or 2-byte string. | 3167 // Check for 1-byte or 2-byte string. |
| 3168 __ test(ecx, Immediate(kStringEncodingMask)); | 3168 __ test(ecx, Immediate(kStringEncodingMask)); |
| 3169 __ j(not_zero, &ascii_string, taken); | 3169 __ j(not_zero, &ascii_string, taken); |
| 3170 | 3170 |
| 3171 // 2-byte string. | 3171 // 2-byte string. |
| 3172 // Load the 2-byte character code. | 3172 // Load the 2-byte character code. |
| 3173 __ movzx_w(eax, FieldOperand(eax, ebx, times_2, TwoByteString::kHeaderSize)); | 3173 __ movzx_w(eax, |
| 3174 FieldOperand(eax, ebx, times_2, SeqTwoByteString::kHeaderSize)); |
| 3174 __ jmp(&got_char_code); | 3175 __ jmp(&got_char_code); |
| 3175 | 3176 |
| 3176 // ASCII string. | 3177 // ASCII string. |
| 3177 __ bind(&ascii_string); | 3178 __ bind(&ascii_string); |
| 3178 // Load the byte. | 3179 // Load the byte. |
| 3179 __ movzx_b(eax, FieldOperand(eax, ebx, times_1, AsciiString::kHeaderSize)); | 3180 __ movzx_b(eax, FieldOperand(eax, ebx, times_1, SeqAsciiString::kHeaderSize)); |
| 3180 | 3181 |
| 3181 __ bind(&got_char_code); | 3182 __ bind(&got_char_code); |
| 3182 ASSERT(kSmiTag == 0); | 3183 ASSERT(kSmiTag == 0); |
| 3183 __ shl(eax, kSmiTagSize); | 3184 __ shl(eax, kSmiTagSize); |
| 3184 __ push(eax); | 3185 __ push(eax); |
| 3185 __ jmp(&end); | 3186 __ jmp(&end); |
| 3186 | 3187 |
| 3187 | 3188 |
| 3188 // Handle non-flat strings. | 3189 // Handle non-flat strings. |
| 3189 __ bind(¬_a_flat_string); | 3190 __ bind(¬_a_flat_string); |
| (...skipping 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5302 bool is_eval) { | 5303 bool is_eval) { |
| 5303 Handle<Code> code = Ia32CodeGenerator::MakeCode(fun, script, is_eval); | 5304 Handle<Code> code = Ia32CodeGenerator::MakeCode(fun, script, is_eval); |
| 5304 if (!code.is_null()) { | 5305 if (!code.is_null()) { |
| 5305 Counters::total_compiled_code_size.Increment(code->instruction_size()); | 5306 Counters::total_compiled_code_size.Increment(code->instruction_size()); |
| 5306 } | 5307 } |
| 5307 return code; | 5308 return code; |
| 5308 } | 5309 } |
| 5309 | 5310 |
| 5310 | 5311 |
| 5311 } } // namespace v8::internal | 5312 } } // namespace v8::internal |
| OLD | NEW |