OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/builtins/builtins-utils.h" | 5 #include "src/builtins/builtins-utils.h" |
6 #include "src/builtins/builtins.h" | 6 #include "src/builtins/builtins.h" |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/uri.h" | 10 #include "src/uri.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 Handle<Object> x = args.atOrUndefined(isolate, 1); | 85 Handle<Object> x = args.atOrUndefined(isolate, 1); |
86 Handle<JSFunction> target = args.target(); | 86 Handle<JSFunction> target = args.target(); |
87 Handle<JSObject> target_global_proxy(target->global_proxy(), isolate); | 87 Handle<JSObject> target_global_proxy(target->global_proxy(), isolate); |
88 if (!x->IsString()) return *x; | 88 if (!x->IsString()) return *x; |
89 if (!Builtins::AllowDynamicFunction(isolate, target, target_global_proxy)) { | 89 if (!Builtins::AllowDynamicFunction(isolate, target, target_global_proxy)) { |
90 isolate->CountUsage(v8::Isolate::kFunctionConstructorReturnedUndefined); | 90 isolate->CountUsage(v8::Isolate::kFunctionConstructorReturnedUndefined); |
91 return isolate->heap()->undefined_value(); | 91 return isolate->heap()->undefined_value(); |
92 } | 92 } |
93 Handle<JSFunction> function; | 93 Handle<JSFunction> function; |
94 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 94 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
95 isolate, function, Compiler::GetFunctionFromString( | 95 isolate, function, |
96 handle(target->native_context(), isolate), | 96 Compiler::GetFunctionFromString(handle(target->native_context(), isolate), |
97 Handle<String>::cast(x), NO_PARSE_RESTRICTION)); | 97 Handle<String>::cast(x), |
| 98 NO_PARSE_RESTRICTION, kNoSourcePosition)); |
98 RETURN_RESULT_OR_FAILURE( | 99 RETURN_RESULT_OR_FAILURE( |
99 isolate, | 100 isolate, |
100 Execution::Call(isolate, function, target_global_proxy, 0, nullptr)); | 101 Execution::Call(isolate, function, target_global_proxy, 0, nullptr)); |
101 } | 102 } |
102 | 103 |
103 // ES6 section 18.2.2 isFinite ( number ) | 104 // ES6 section 18.2.2 isFinite ( number ) |
104 void Builtins::Generate_GlobalIsFinite(compiler::CodeAssemblerState* state) { | 105 void Builtins::Generate_GlobalIsFinite(compiler::CodeAssemblerState* state) { |
105 typedef CodeStubAssembler::Label Label; | 106 typedef CodeStubAssembler::Label Label; |
106 typedef compiler::Node Node; | 107 typedef compiler::Node Node; |
107 typedef CodeStubAssembler::Variable Variable; | 108 typedef CodeStubAssembler::Variable Variable; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 203 |
203 assembler.Bind(&return_true); | 204 assembler.Bind(&return_true); |
204 assembler.Return(assembler.BooleanConstant(true)); | 205 assembler.Return(assembler.BooleanConstant(true)); |
205 | 206 |
206 assembler.Bind(&return_false); | 207 assembler.Bind(&return_false); |
207 assembler.Return(assembler.BooleanConstant(false)); | 208 assembler.Return(assembler.BooleanConstant(false)); |
208 } | 209 } |
209 | 210 |
210 } // namespace internal | 211 } // namespace internal |
211 } // namespace v8 | 212 } // namespace v8 |
OLD | NEW |