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/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 elements->set(i, *--parameters); | 652 elements->set(i, *--parameters); |
653 } | 653 } |
654 return isolate->factory()->NewJSArrayWithElements( | 654 return isolate->factory()->NewJSArrayWithElements( |
655 elements, FAST_ELEMENTS, num_elements, strength(language_mode)); | 655 elements, FAST_ELEMENTS, num_elements, strength(language_mode)); |
656 } | 656 } |
657 | 657 |
658 | 658 |
659 RUNTIME_FUNCTION(Runtime_NewRestParam) { | 659 RUNTIME_FUNCTION(Runtime_NewRestParam) { |
660 HandleScope scope(isolate); | 660 HandleScope scope(isolate); |
661 DCHECK(args.length() == 4); | 661 DCHECK(args.length() == 4); |
662 Object** parameters = reinterpret_cast<Object**>(args[0]); | 662 CONVERT_SMI_ARG_CHECKED(num_params, 0); |
663 CONVERT_SMI_ARG_CHECKED(num_params, 1); | 663 Object** parameters = reinterpret_cast<Object**>(args[1]); |
664 CONVERT_SMI_ARG_CHECKED(rest_index, 2); | 664 CONVERT_SMI_ARG_CHECKED(rest_index, 2); |
665 CONVERT_SMI_ARG_CHECKED(language_mode, 3); | 665 CONVERT_SMI_ARG_CHECKED(language_mode, 3); |
666 | 666 |
667 return *NewRestParam(isolate, parameters, num_params, rest_index, | 667 return *NewRestParam(isolate, parameters, num_params, rest_index, |
668 static_cast<LanguageMode>(language_mode)); | 668 static_cast<LanguageMode>(language_mode)); |
669 } | 669 } |
670 | 670 |
671 | 671 |
672 RUNTIME_FUNCTION(Runtime_NewRestParamSlow) { | 672 RUNTIME_FUNCTION(Runtime_NewRestParamSlow) { |
673 HandleScope scope(isolate); | 673 HandleScope scope(isolate); |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 | 1214 |
1215 // Lookup in the initial Object.prototype object. | 1215 // Lookup in the initial Object.prototype object. |
1216 Handle<Object> result; | 1216 Handle<Object> result; |
1217 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 1217 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
1218 isolate, result, | 1218 isolate, result, |
1219 Object::GetProperty(isolate->initial_object_prototype(), key)); | 1219 Object::GetProperty(isolate->initial_object_prototype(), key)); |
1220 return *result; | 1220 return *result; |
1221 } | 1221 } |
1222 } // namespace internal | 1222 } // namespace internal |
1223 } // namespace v8 | 1223 } // namespace v8 |
OLD | NEW |