| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 const int limitOffset) { | 1050 const int limitOffset) { |
| 1051 // Copy all arguments from the array to the stack. | 1051 // Copy all arguments from the array to the stack. |
| 1052 Label entry, loop; | 1052 Label entry, loop; |
| 1053 Register receiver = LoadDescriptor::ReceiverRegister(); | 1053 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 1054 Register key = LoadDescriptor::NameRegister(); | 1054 Register key = LoadDescriptor::NameRegister(); |
| 1055 __ mov(key, Operand(ebp, indexOffset)); | 1055 __ mov(key, Operand(ebp, indexOffset)); |
| 1056 __ jmp(&entry); | 1056 __ jmp(&entry); |
| 1057 __ bind(&loop); | 1057 __ bind(&loop); |
| 1058 __ mov(receiver, Operand(ebp, argumentsOffset)); // load arguments | 1058 __ mov(receiver, Operand(ebp, argumentsOffset)); // load arguments |
| 1059 | 1059 |
| 1060 if (FLAG_vector_ics) { | 1060 // Use inline caching to speed up access to arguments. |
| 1061 // TODO(mvstanton): Vector-based ics need additional infrastructure to | 1061 Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Megamorphic(); |
| 1062 // be embedded here. For now, just call the runtime. | 1062 __ call(ic, RelocInfo::CODE_TARGET); |
| 1063 __ push(receiver); | 1063 // It is important that we do not have a test instruction after the |
| 1064 __ push(key); | 1064 // call. A test instruction after the call is used to indicate that |
| 1065 __ CallRuntime(Runtime::kGetProperty, 2); | 1065 // we have generated an inline version of the keyed load. In this |
| 1066 } else { | 1066 // case, we know that we are not generating a test instruction next. |
| 1067 // Use inline caching to speed up access to arguments. | |
| 1068 Handle<Code> ic = CodeFactory::KeyedLoadIC(masm->isolate()).code(); | |
| 1069 __ call(ic, RelocInfo::CODE_TARGET); | |
| 1070 // It is important that we do not have a test instruction after the | |
| 1071 // call. A test instruction after the call is used to indicate that | |
| 1072 // we have generated an inline version of the keyed load. In this | |
| 1073 // case, we know that we are not generating a test instruction next. | |
| 1074 } | |
| 1075 | 1067 |
| 1076 // Push the nth argument. | 1068 // Push the nth argument. |
| 1077 __ push(eax); | 1069 __ push(eax); |
| 1078 | 1070 |
| 1079 // Update the index on the stack and in register key. | 1071 // Update the index on the stack and in register key. |
| 1080 __ mov(key, Operand(ebp, indexOffset)); | 1072 __ mov(key, Operand(ebp, indexOffset)); |
| 1081 __ add(key, Immediate(1 << kSmiTagSize)); | 1073 __ add(key, Immediate(1 << kSmiTagSize)); |
| 1082 __ mov(Operand(ebp, indexOffset), key); | 1074 __ mov(Operand(ebp, indexOffset), key); |
| 1083 | 1075 |
| 1084 __ bind(&entry); | 1076 __ bind(&entry); |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1695 | 1687 |
| 1696 __ bind(&ok); | 1688 __ bind(&ok); |
| 1697 __ ret(0); | 1689 __ ret(0); |
| 1698 } | 1690 } |
| 1699 | 1691 |
| 1700 #undef __ | 1692 #undef __ |
| 1701 } | 1693 } |
| 1702 } // namespace v8::internal | 1694 } // namespace v8::internal |
| 1703 | 1695 |
| 1704 #endif // V8_TARGET_ARCH_X87 | 1696 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |