Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/asmjs/asm-js.h" | 8 #include "src/asmjs/asm-js.h" |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 memory = args.at<i::JSArrayBuffer>(3); | 94 memory = args.at<i::JSArrayBuffer>(3); |
| 95 } | 95 } |
| 96 if (args[1]->IsJSObject()) { | 96 if (args[1]->IsJSObject()) { |
| 97 MaybeHandle<Object> result; | 97 MaybeHandle<Object> result; |
| 98 result = AsmJs::InstantiateAsmWasm( | 98 result = AsmJs::InstantiateAsmWasm( |
| 99 isolate, handle(function->shared()->asm_wasm_data()), memory, foreign); | 99 isolate, handle(function->shared()->asm_wasm_data()), memory, foreign); |
| 100 if (!result.is_null()) { | 100 if (!result.is_null()) { |
| 101 return *result.ToHandleChecked(); | 101 return *result.ToHandleChecked(); |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 // Remove wasm data and return a smi 0 to indicate failure. | 104 // Return a smi 0 to indicate failure. |
| 105 function->shared()->ClearAsmWasmData(); | 105 // AsmWasmData will get removed later as a consequence (but is kept so we |
|
Michael Starzinger
2016/08/11 11:44:10
See comments in compiler.cc about this.
bradn
2016/08/12 01:17:09
Done.
| |
| 106 // know we've tried this and failed). | |
| 106 return Smi::FromInt(0); | 107 return Smi::FromInt(0); |
| 107 } | 108 } |
| 108 | 109 |
| 109 RUNTIME_FUNCTION(Runtime_NotifyStubFailure) { | 110 RUNTIME_FUNCTION(Runtime_NotifyStubFailure) { |
| 110 HandleScope scope(isolate); | 111 HandleScope scope(isolate); |
| 111 DCHECK(args.length() == 0); | 112 DCHECK(args.length() == 0); |
| 112 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); | 113 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); |
| 113 DCHECK(AllowHeapAllocation::IsAllowed()); | 114 DCHECK(AllowHeapAllocation::IsAllowed()); |
| 114 delete deoptimizer; | 115 delete deoptimizer; |
| 115 return isolate->heap()->undefined_value(); | 116 return isolate->heap()->undefined_value(); |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 429 DCHECK(is_valid_language_mode(args.smi_at(3))); | 430 DCHECK(is_valid_language_mode(args.smi_at(3))); |
| 430 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); | 431 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); |
| 431 DCHECK(args[4]->IsSmi()); | 432 DCHECK(args[4]->IsSmi()); |
| 432 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), | 433 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), |
| 433 isolate); | 434 isolate); |
| 434 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, | 435 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, |
| 435 language_mode, args.smi_at(4), args.smi_at(5)); | 436 language_mode, args.smi_at(4), args.smi_at(5)); |
| 436 } | 437 } |
| 437 } // namespace internal | 438 } // namespace internal |
| 438 } // namespace v8 | 439 } // namespace v8 |
| OLD | NEW |