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.h" | 9 #include "src/ast.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } | 235 } |
236 } | 236 } |
237 | 237 |
238 | 238 |
239 RUNTIME_FUNCTION(Runtime_CreateRegExpLiteral) { | 239 RUNTIME_FUNCTION(Runtime_CreateRegExpLiteral) { |
240 HandleScope scope(isolate); | 240 HandleScope scope(isolate); |
241 DCHECK_EQ(4, args.length()); | 241 DCHECK_EQ(4, args.length()); |
242 CONVERT_ARG_HANDLE_CHECKED(JSFunction, closure, 0); | 242 CONVERT_ARG_HANDLE_CHECKED(JSFunction, closure, 0); |
243 CONVERT_SMI_ARG_CHECKED(index, 1); | 243 CONVERT_SMI_ARG_CHECKED(index, 1); |
244 CONVERT_ARG_HANDLE_CHECKED(String, pattern, 2); | 244 CONVERT_ARG_HANDLE_CHECKED(String, pattern, 2); |
245 CONVERT_ARG_HANDLE_CHECKED(String, flags, 3); | 245 CONVERT_SMI_ARG_CHECKED(flags, 3); |
246 | 246 |
247 // Check if boilerplate exists. If not, create it first. | 247 // Check if boilerplate exists. If not, create it first. |
248 Handle<Object> boilerplate(closure->literals()->literal(index), isolate); | 248 Handle<Object> boilerplate(closure->literals()->literal(index), isolate); |
249 if (boilerplate->IsUndefined()) { | 249 if (boilerplate->IsUndefined()) { |
250 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, boilerplate, | 250 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
251 JSRegExp::New(pattern, flags)); | 251 isolate, boilerplate, JSRegExp::New(pattern, JSRegExp::Flags(flags))); |
252 closure->literals()->set_literal(index, *boilerplate); | 252 closure->literals()->set_literal(index, *boilerplate); |
253 } | 253 } |
254 return *JSRegExp::Copy(Handle<JSRegExp>::cast(boilerplate)); | 254 return *JSRegExp::Copy(Handle<JSRegExp>::cast(boilerplate)); |
255 } | 255 } |
256 | 256 |
257 | 257 |
258 RUNTIME_FUNCTION(Runtime_CreateObjectLiteral) { | 258 RUNTIME_FUNCTION(Runtime_CreateObjectLiteral) { |
259 HandleScope scope(isolate); | 259 HandleScope scope(isolate); |
260 DCHECK_EQ(4, args.length()); | 260 DCHECK_EQ(4, args.length()); |
261 CONVERT_ARG_HANDLE_CHECKED(JSFunction, closure, 0); | 261 CONVERT_ARG_HANDLE_CHECKED(JSFunction, closure, 0); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 JSObject::TransitionElementsKind(boilerplate_object, transitioned_kind); | 451 JSObject::TransitionElementsKind(boilerplate_object, transitioned_kind); |
452 } | 452 } |
453 } | 453 } |
454 FixedArray* object_array = FixedArray::cast(object->elements()); | 454 FixedArray* object_array = FixedArray::cast(object->elements()); |
455 object_array->set(store_index, *value); | 455 object_array->set(store_index, *value); |
456 } | 456 } |
457 return *object; | 457 return *object; |
458 } | 458 } |
459 } // namespace internal | 459 } // namespace internal |
460 } // namespace v8 | 460 } // namespace v8 |
OLD | NEW |