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/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 RUNTIME_FUNCTION(Runtime_CreateRegExpLiteral) { | 202 RUNTIME_FUNCTION(Runtime_CreateRegExpLiteral) { |
203 HandleScope scope(isolate); | 203 HandleScope scope(isolate); |
204 DCHECK_EQ(4, args.length()); | 204 DCHECK_EQ(4, args.length()); |
205 CONVERT_ARG_HANDLE_CHECKED(JSFunction, closure, 0); | 205 CONVERT_ARG_HANDLE_CHECKED(JSFunction, closure, 0); |
206 CONVERT_SMI_ARG_CHECKED(index, 1); | 206 CONVERT_SMI_ARG_CHECKED(index, 1); |
207 CONVERT_ARG_HANDLE_CHECKED(String, pattern, 2); | 207 CONVERT_ARG_HANDLE_CHECKED(String, pattern, 2); |
208 CONVERT_SMI_ARG_CHECKED(flags, 3); | 208 CONVERT_SMI_ARG_CHECKED(flags, 3); |
209 | 209 |
210 // Check if boilerplate exists. If not, create it first. | 210 // Check if boilerplate exists. If not, create it first. |
211 Handle<Object> boilerplate(closure->literals()->literal(index), isolate); | 211 Handle<Object> boilerplate(closure->literals()->literal(index), isolate); |
212 if (boilerplate->IsUndefined()) { | 212 if (boilerplate->IsUndefined(isolate)) { |
213 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 213 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
214 isolate, boilerplate, JSRegExp::New(pattern, JSRegExp::Flags(flags))); | 214 isolate, boilerplate, JSRegExp::New(pattern, JSRegExp::Flags(flags))); |
215 closure->literals()->set_literal(index, *boilerplate); | 215 closure->literals()->set_literal(index, *boilerplate); |
216 } | 216 } |
217 return *JSRegExp::Copy(Handle<JSRegExp>::cast(boilerplate)); | 217 return *JSRegExp::Copy(Handle<JSRegExp>::cast(boilerplate)); |
218 } | 218 } |
219 | 219 |
220 | 220 |
221 RUNTIME_FUNCTION(Runtime_CreateObjectLiteral) { | 221 RUNTIME_FUNCTION(Runtime_CreateObjectLiteral) { |
222 HandleScope scope(isolate); | 222 HandleScope scope(isolate); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 | 347 |
348 Handle<LiteralsArray> literals(closure->literals(), isolate); | 348 Handle<LiteralsArray> literals(closure->literals(), isolate); |
349 RETURN_RESULT_OR_FAILURE( | 349 RETURN_RESULT_OR_FAILURE( |
350 isolate, | 350 isolate, |
351 CreateArrayLiteralImpl(isolate, literals, literals_index, elements, | 351 CreateArrayLiteralImpl(isolate, literals, literals_index, elements, |
352 ArrayLiteral::kShallowElements)); | 352 ArrayLiteral::kShallowElements)); |
353 } | 353 } |
354 | 354 |
355 } // namespace internal | 355 } // namespace internal |
356 } // namespace v8 | 356 } // namespace v8 |
OLD | NEW |