| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 __ movq(rsp, rbp); | 112 __ movq(rsp, rbp); |
| 113 __ pop(rbx); | 113 __ pop(rbx); |
| 114 __ pop(rcx); | 114 __ pop(rcx); |
| 115 __ popfq(); | 115 __ popfq(); |
| 116 __ pop(rbp); | 116 __ pop(rbp); |
| 117 __ ret(0); | 117 __ ret(0); |
| 118 #undef __ | 118 #undef __ |
| 119 | 119 |
| 120 CodeDesc desc; | 120 CodeDesc desc; |
| 121 assm.GetCode(&desc); | 121 assm.GetCode(&desc); |
| 122 MaybeObject* maybe_code = HEAP->CreateCode(desc, | 122 Isolate* isolate = Isolate::Current(); |
| 123 Code::ComputeFlags(Code::STUB), | 123 MaybeObject* maybe_code = |
| 124 Handle<Object>()); | 124 isolate->heap()->CreateCode(desc, |
| 125 Code::ComputeFlags(Code::STUB), |
| 126 Handle<Object>()); |
| 125 Object* code; | 127 Object* code; |
| 126 if (!maybe_code->ToObject(&code)) return; | 128 if (!maybe_code->ToObject(&code)) return; |
| 127 if (!code->IsCode()) return; | 129 if (!code->IsCode()) return; |
| 128 PROFILE(CodeCreateEvent(Logger::BUILTIN_TAG, | 130 PROFILE(isolate, |
| 131 CodeCreateEvent(Logger::BUILTIN_TAG, |
| 129 Code::cast(code), "CpuFeatures::Probe")); | 132 Code::cast(code), "CpuFeatures::Probe")); |
| 130 typedef uint64_t (*F0)(); | 133 typedef uint64_t (*F0)(); |
| 131 F0 probe = FUNCTION_CAST<F0>(Code::cast(code)->entry()); | 134 F0 probe = FUNCTION_CAST<F0>(Code::cast(code)->entry()); |
| 132 supported_ = probe(); | 135 supported_ = probe(); |
| 133 found_by_runtime_probing_ = supported_; | 136 found_by_runtime_probing_ = supported_; |
| 134 found_by_runtime_probing_ &= ~kDefaultCpuFeatures; | 137 found_by_runtime_probing_ &= ~kDefaultCpuFeatures; |
| 135 uint64_t os_guarantees = OS::CpuFeaturesImpliedByPlatform(); | 138 uint64_t os_guarantees = OS::CpuFeaturesImpliedByPlatform(); |
| 136 supported_ |= os_guarantees; | 139 supported_ |= os_guarantees; |
| 137 found_by_runtime_probing_ &= portable ? ~os_guarantees : 0; | 140 found_by_runtime_probing_ &= portable ? ~os_guarantees : 0; |
| 138 // SSE2 and CMOV must be available on an X64 CPU. | 141 // SSE2 and CMOV must be available on an X64 CPU. |
| (...skipping 3020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3159 // specially coded on x64 means that it is a relative 32 bit address, as used | 3162 // specially coded on x64 means that it is a relative 32 bit address, as used |
| 3160 // by branch instructions. | 3163 // by branch instructions. |
| 3161 return (1 << rmode_) & kApplyMask; | 3164 return (1 << rmode_) & kApplyMask; |
| 3162 } | 3165 } |
| 3163 | 3166 |
| 3164 | 3167 |
| 3165 | 3168 |
| 3166 } } // namespace v8::internal | 3169 } } // namespace v8::internal |
| 3167 | 3170 |
| 3168 #endif // V8_TARGET_ARCH_X64 | 3171 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |