| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1323 // we're running with the --always-opt or the --prepare-always-opt | 1323 // we're running with the --always-opt or the --prepare-always-opt |
| 1324 // flag, we need to use the runtime function so that the new function | 1324 // flag, we need to use the runtime function so that the new function |
| 1325 // we are creating here gets a chance to have its code optimized and | 1325 // we are creating here gets a chance to have its code optimized and |
| 1326 // doesn't just get a copy of the existing unoptimized code. | 1326 // doesn't just get a copy of the existing unoptimized code. |
| 1327 if (!FLAG_always_opt && | 1327 if (!FLAG_always_opt && |
| 1328 !FLAG_prepare_always_opt && | 1328 !FLAG_prepare_always_opt && |
| 1329 !pretenure && | 1329 !pretenure && |
| 1330 scope()->is_function_scope() && | 1330 scope()->is_function_scope() && |
| 1331 info->num_literals() == 0) { | 1331 info->num_literals() == 0) { |
| 1332 FastNewClosureStub stub(info->language_mode(), info->is_generator()); | 1332 FastNewClosureStub stub(info->language_mode(), info->is_generator()); |
| 1333 __ mov(r0, Operand(info)); | 1333 __ mov(r2, Operand(info)); |
| 1334 __ push(r0); | |
| 1335 __ CallStub(&stub); | 1334 __ CallStub(&stub); |
| 1336 } else { | 1335 } else { |
| 1337 __ mov(r0, Operand(info)); | 1336 __ mov(r0, Operand(info)); |
| 1338 __ LoadRoot(r1, pretenure ? Heap::kTrueValueRootIndex | 1337 __ LoadRoot(r1, pretenure ? Heap::kTrueValueRootIndex |
| 1339 : Heap::kFalseValueRootIndex); | 1338 : Heap::kFalseValueRootIndex); |
| 1340 __ Push(cp, r0, r1); | 1339 __ Push(cp, r0, r1); |
| 1341 __ CallRuntime(Runtime::kNewClosure, 3); | 1340 __ CallRuntime(Runtime::kNewClosure, 3); |
| 1342 } | 1341 } |
| 1343 context()->Plug(r0); | 1342 context()->Plug(r0); |
| 1344 } | 1343 } |
| (...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3072 // prototype is the un-modified String prototype. If not result is false. | 3071 // prototype is the un-modified String prototype. If not result is false. |
| 3073 __ ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); | 3072 __ ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); |
| 3074 __ JumpIfSmi(r2, if_false); | 3073 __ JumpIfSmi(r2, if_false); |
| 3075 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset)); | 3074 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset)); |
| 3076 __ ldr(r3, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); | 3075 __ ldr(r3, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
| 3077 __ ldr(r3, FieldMemOperand(r3, GlobalObject::kNativeContextOffset)); | 3076 __ ldr(r3, FieldMemOperand(r3, GlobalObject::kNativeContextOffset)); |
| 3078 __ ldr(r3, ContextOperand(r3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); | 3077 __ ldr(r3, ContextOperand(r3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); |
| 3079 __ cmp(r2, r3); | 3078 __ cmp(r2, r3); |
| 3080 __ b(ne, if_false); | 3079 __ b(ne, if_false); |
| 3081 | 3080 |
| 3082 // Set the bit in the map to indicate that it has been checked safe for | |
| 3083 // default valueOf and set true result. | |
| 3084 __ ldrb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); | |
| 3085 __ orr(r2, r2, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); | |
| 3086 __ strb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); | |
| 3087 __ jmp(if_true); | 3081 __ jmp(if_true); |
| 3088 | 3082 |
| 3089 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3083 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3090 context()->Plug(if_true, if_false); | 3084 context()->Plug(if_true, if_false); |
| 3091 } | 3085 } |
| 3092 | 3086 |
| 3093 | 3087 |
| 3094 void FullCodeGenerator::EmitIsFunction(CallRuntime* expr) { | 3088 void FullCodeGenerator::EmitIsFunction(CallRuntime* expr) { |
| 3095 ZoneList<Expression*>* args = expr->arguments(); | 3089 ZoneList<Expression*>* args = expr->arguments(); |
| 3096 ASSERT(args->length() == 1); | 3090 ASSERT(args->length() == 1); |
| (...skipping 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4892 *context_length = 0; | 4886 *context_length = 0; |
| 4893 return previous_; | 4887 return previous_; |
| 4894 } | 4888 } |
| 4895 | 4889 |
| 4896 | 4890 |
| 4897 #undef __ | 4891 #undef __ |
| 4898 | 4892 |
| 4899 } } // namespace v8::internal | 4893 } } // namespace v8::internal |
| 4900 | 4894 |
| 4901 #endif // V8_TARGET_ARCH_ARM | 4895 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |