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/frames-inl.h" | 9 #include "src/frames-inl.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 : *NewSloppyArguments(isolate, callee, parameters, argument_count); | 535 : *NewSloppyArguments(isolate, callee, parameters, argument_count); |
536 } | 536 } |
537 | 537 |
538 | 538 |
539 RUNTIME_FUNCTION(Runtime_NewSloppyArguments) { | 539 RUNTIME_FUNCTION(Runtime_NewSloppyArguments) { |
540 HandleScope scope(isolate); | 540 HandleScope scope(isolate); |
541 DCHECK(args.length() == 3); | 541 DCHECK(args.length() == 3); |
542 CONVERT_ARG_HANDLE_CHECKED(JSFunction, callee, 0); | 542 CONVERT_ARG_HANDLE_CHECKED(JSFunction, callee, 0); |
543 Object** parameters = reinterpret_cast<Object**>(args[1]); | 543 Object** parameters = reinterpret_cast<Object**>(args[1]); |
544 CONVERT_SMI_ARG_CHECKED(argument_count, 2); | 544 CONVERT_SMI_ARG_CHECKED(argument_count, 2); |
| 545 #ifdef DEBUG |
| 546 // This runtime function does not materialize the correct arguments when the |
| 547 // caller has been inlined, better make sure we are not hitting that case. |
| 548 JavaScriptFrameIterator it(isolate); |
| 549 DCHECK(!it.frame()->HasInlinedFrames()); |
| 550 #endif // DEBUG |
545 return *NewSloppyArguments(isolate, callee, parameters, argument_count); | 551 return *NewSloppyArguments(isolate, callee, parameters, argument_count); |
546 } | 552 } |
547 | 553 |
548 | 554 |
549 RUNTIME_FUNCTION(Runtime_NewStrictArguments) { | 555 RUNTIME_FUNCTION(Runtime_NewStrictArguments) { |
550 HandleScope scope(isolate); | 556 HandleScope scope(isolate); |
551 DCHECK(args.length() == 3); | 557 DCHECK(args.length() == 3); |
552 CONVERT_ARG_HANDLE_CHECKED(JSFunction, callee, 0) | 558 CONVERT_ARG_HANDLE_CHECKED(JSFunction, callee, 0) |
553 Object** parameters = reinterpret_cast<Object**>(args[1]); | 559 Object** parameters = reinterpret_cast<Object**>(args[1]); |
554 CONVERT_SMI_ARG_CHECKED(argument_count, 2); | 560 CONVERT_SMI_ARG_CHECKED(argument_count, 2); |
| 561 #ifdef DEBUG |
| 562 // This runtime function does not materialize the correct arguments when the |
| 563 // caller has been inlined, better make sure we are not hitting that case. |
| 564 JavaScriptFrameIterator it(isolate); |
| 565 DCHECK(!it.frame()->HasInlinedFrames()); |
| 566 #endif // DEBUG |
555 return *NewStrictArguments(isolate, callee, parameters, argument_count); | 567 return *NewStrictArguments(isolate, callee, parameters, argument_count); |
556 } | 568 } |
557 | 569 |
558 | 570 |
559 RUNTIME_FUNCTION(Runtime_NewClosure) { | 571 RUNTIME_FUNCTION(Runtime_NewClosure) { |
560 HandleScope scope(isolate); | 572 HandleScope scope(isolate); |
561 DCHECK_EQ(1, args.length()); | 573 DCHECK_EQ(1, args.length()); |
562 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 0); | 574 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 0); |
563 Handle<Context> context(isolate->context(), isolate); | 575 Handle<Context> context(isolate->context(), isolate); |
564 return *isolate->factory()->NewFunctionFromSharedFunctionInfo(shared, context, | 576 return *isolate->factory()->NewFunctionFromSharedFunctionInfo(shared, context, |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 | 1130 |
1119 // Lookup in the initial Object.prototype object. | 1131 // Lookup in the initial Object.prototype object. |
1120 Handle<Object> result; | 1132 Handle<Object> result; |
1121 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 1133 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
1122 isolate, result, | 1134 isolate, result, |
1123 Object::GetProperty(isolate->initial_object_prototype(), key)); | 1135 Object::GetProperty(isolate->initial_object_prototype(), key)); |
1124 return *result; | 1136 return *result; |
1125 } | 1137 } |
1126 } // namespace internal | 1138 } // namespace internal |
1127 } // namespace v8 | 1139 } // namespace v8 |
OLD | NEW |