| 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 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1271 return reg; | 1271 return reg; |
| 1272 } | 1272 } |
| 1273 | 1273 |
| 1274 | 1274 |
| 1275 void LoadStubCompiler::GenerateLoadField(Register reg, | 1275 void LoadStubCompiler::GenerateLoadField(Register reg, |
| 1276 Handle<JSObject> holder, | 1276 Handle<JSObject> holder, |
| 1277 PropertyIndex field, | 1277 PropertyIndex field, |
| 1278 Representation representation) { | 1278 Representation representation) { |
| 1279 if (!reg.is(receiver())) __ movq(receiver(), reg); | 1279 if (!reg.is(receiver())) __ movq(receiver(), reg); |
| 1280 if (kind() == Code::LOAD_IC) { | 1280 if (kind() == Code::LOAD_IC) { |
| 1281 LoadFieldStub stub(field.is_inobject(holder), | 1281 LoadFieldStub stub(field.is_inobject(holder->map()), |
| 1282 field.translate(holder), | 1282 field.translate(holder->map()), |
| 1283 representation); | 1283 representation); |
| 1284 GenerateTailCall(masm(), stub.GetCode(isolate())); | 1284 GenerateTailCall(masm(), stub.GetCode(isolate())); |
| 1285 } else { | 1285 } else { |
| 1286 KeyedLoadFieldStub stub(field.is_inobject(holder), | 1286 KeyedLoadFieldStub stub(field.is_inobject(holder->map()), |
| 1287 field.translate(holder), | 1287 field.translate(holder->map()), |
| 1288 representation); | 1288 representation); |
| 1289 GenerateTailCall(masm(), stub.GetCode(isolate())); | 1289 GenerateTailCall(masm(), stub.GetCode(isolate())); |
| 1290 } | 1290 } |
| 1291 } | 1291 } |
| 1292 | 1292 |
| 1293 | 1293 |
| 1294 void LoadStubCompiler::GenerateLoadCallback( | 1294 void LoadStubCompiler::GenerateLoadCallback( |
| 1295 const CallOptimization& call_optimization) { | 1295 const CallOptimization& call_optimization) { |
| 1296 GenerateFastApiCall( | 1296 GenerateFastApiCall( |
| 1297 masm(), call_optimization, receiver(), scratch3(), 0, NULL); | 1297 masm(), call_optimization, receiver(), scratch3(), 0, NULL); |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1561 StackArgumentsAccessor args(rsp, arguments()); | 1561 StackArgumentsAccessor args(rsp, arguments()); |
| 1562 __ movq(rdx, args.GetReceiverOperand()); | 1562 __ movq(rdx, args.GetReceiverOperand()); |
| 1563 | 1563 |
| 1564 // Check that the receiver isn't a smi. | 1564 // Check that the receiver isn't a smi. |
| 1565 __ JumpIfSmi(rdx, &miss); | 1565 __ JumpIfSmi(rdx, &miss); |
| 1566 | 1566 |
| 1567 // Do the right check and compute the holder register. | 1567 // Do the right check and compute the holder register. |
| 1568 Register reg = CheckPrototypes(object, rdx, holder, rbx, rax, rdi, | 1568 Register reg = CheckPrototypes(object, rdx, holder, rbx, rax, rdi, |
| 1569 name, &miss); | 1569 name, &miss); |
| 1570 | 1570 |
| 1571 GenerateFastPropertyLoad(masm(), rdi, reg, index.is_inobject(holder), | 1571 GenerateFastPropertyLoad( |
| 1572 index.translate(holder), Representation::Tagged()); | 1572 masm(), rdi, reg, index.is_inobject(holder->map()), |
| 1573 index.translate(holder->map()), Representation::Tagged()); |
| 1573 | 1574 |
| 1574 // Check that the function really is a function. | 1575 // Check that the function really is a function. |
| 1575 __ JumpIfSmi(rdi, &miss); | 1576 __ JumpIfSmi(rdi, &miss); |
| 1576 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rbx); | 1577 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rbx); |
| 1577 __ j(not_equal, &miss); | 1578 __ j(not_equal, &miss); |
| 1578 | 1579 |
| 1579 // Patch the receiver on the stack with the global proxy if | 1580 // Patch the receiver on the stack with the global proxy if |
| 1580 // necessary. | 1581 // necessary. |
| 1581 if (object->IsGlobalObject()) { | 1582 if (object->IsGlobalObject()) { |
| 1582 __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset)); | 1583 __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset)); |
| (...skipping 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3157 // ----------------------------------- | 3158 // ----------------------------------- |
| 3158 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 3159 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 3159 } | 3160 } |
| 3160 | 3161 |
| 3161 | 3162 |
| 3162 #undef __ | 3163 #undef __ |
| 3163 | 3164 |
| 3164 } } // namespace v8::internal | 3165 } } // namespace v8::internal |
| 3165 | 3166 |
| 3166 #endif // V8_TARGET_ARCH_X64 | 3167 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |