Chromium Code Reviews| 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 | |
|
Benedikt Meurer
2015/09/16 08:20:56
Nit: Can we turn this into a helper function on th
Michael Starzinger
2015/09/16 10:39:36
Done. Named it {JavaScriptFrame::HasInlinedFrames}
| |
| 547 // caller has been inlined, better make sure we are not hitting that case. | |
| 548 List<JSFunction*> functions(1); | |
| 549 JavaScriptFrameIterator it(isolate); | |
| 550 it.frame()->GetFunctions(&functions); | |
| 551 DCHECK_EQ(1, functions.length()); | |
| 552 #endif // DEBUG | |
| 545 return *NewSloppyArguments(isolate, callee, parameters, argument_count); | 553 return *NewSloppyArguments(isolate, callee, parameters, argument_count); |
| 546 } | 554 } |
| 547 | 555 |
| 548 | 556 |
| 549 RUNTIME_FUNCTION(Runtime_NewStrictArguments) { | 557 RUNTIME_FUNCTION(Runtime_NewStrictArguments) { |
| 550 HandleScope scope(isolate); | 558 HandleScope scope(isolate); |
| 551 DCHECK(args.length() == 3); | 559 DCHECK(args.length() == 3); |
| 552 CONVERT_ARG_HANDLE_CHECKED(JSFunction, callee, 0) | 560 CONVERT_ARG_HANDLE_CHECKED(JSFunction, callee, 0) |
| 553 Object** parameters = reinterpret_cast<Object**>(args[1]); | 561 Object** parameters = reinterpret_cast<Object**>(args[1]); |
| 554 CONVERT_SMI_ARG_CHECKED(argument_count, 2); | 562 CONVERT_SMI_ARG_CHECKED(argument_count, 2); |
| 563 #ifdef DEBUG | |
| 564 // This runtime function does not materialize the correct arguments when the | |
| 565 // caller has been inlined, better make sure we are not hitting that case. | |
| 566 List<JSFunction*> functions(1); | |
| 567 JavaScriptFrameIterator it(isolate); | |
| 568 it.frame()->GetFunctions(&functions); | |
| 569 DCHECK_EQ(1, functions.length()); | |
| 570 #endif // DEBUG | |
| 555 return *NewStrictArguments(isolate, callee, parameters, argument_count); | 571 return *NewStrictArguments(isolate, callee, parameters, argument_count); |
| 556 } | 572 } |
| 557 | 573 |
| 558 | 574 |
| 559 RUNTIME_FUNCTION(Runtime_NewClosure) { | 575 RUNTIME_FUNCTION(Runtime_NewClosure) { |
| 560 HandleScope scope(isolate); | 576 HandleScope scope(isolate); |
| 561 DCHECK_EQ(1, args.length()); | 577 DCHECK_EQ(1, args.length()); |
| 562 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 0); | 578 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 0); |
| 563 Handle<Context> context(isolate->context(), isolate); | 579 Handle<Context> context(isolate->context(), isolate); |
| 564 return *isolate->factory()->NewFunctionFromSharedFunctionInfo(shared, context, | 580 return *isolate->factory()->NewFunctionFromSharedFunctionInfo(shared, context, |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1118 | 1134 |
| 1119 // Lookup in the initial Object.prototype object. | 1135 // Lookup in the initial Object.prototype object. |
| 1120 Handle<Object> result; | 1136 Handle<Object> result; |
| 1121 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 1137 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 1122 isolate, result, | 1138 isolate, result, |
| 1123 Object::GetProperty(isolate->initial_object_prototype(), key)); | 1139 Object::GetProperty(isolate->initial_object_prototype(), key)); |
| 1124 return *result; | 1140 return *result; |
| 1125 } | 1141 } |
| 1126 } // namespace internal | 1142 } // namespace internal |
| 1127 } // namespace v8 | 1143 } // namespace v8 |
| OLD | NEW |