Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2211)

Side by Side Diff: src/runtime/runtime-function.cc

Issue 1433923002: Maintain a FixedArray for the optimized code map. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Missed a case, also turn on flag for testing. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/objects.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/compiler.h" 9 #include "src/compiler.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 RUNTIME_FUNCTION(Runtime_FunctionBindArguments) { 384 RUNTIME_FUNCTION(Runtime_FunctionBindArguments) {
385 HandleScope scope(isolate); 385 HandleScope scope(isolate);
386 DCHECK(args.length() == 4); 386 DCHECK(args.length() == 4);
387 CONVERT_ARG_HANDLE_CHECKED(JSFunction, bound_function, 0); 387 CONVERT_ARG_HANDLE_CHECKED(JSFunction, bound_function, 0);
388 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, bindee, 1); 388 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, bindee, 1);
389 CONVERT_ARG_HANDLE_CHECKED(Object, this_object, 2); 389 CONVERT_ARG_HANDLE_CHECKED(Object, this_object, 2);
390 CONVERT_NUMBER_ARG_HANDLE_CHECKED(new_length, 3); 390 CONVERT_NUMBER_ARG_HANDLE_CHECKED(new_length, 3);
391 391
392 // TODO(lrn): Create bound function in C++ code from premade shared info. 392 // TODO(lrn): Create bound function in C++ code from premade shared info.
393 bound_function->shared()->set_bound(true); 393 bound_function->shared()->set_bound(true);
394 bound_function->shared()->set_optimized_code_map(Smi::FromInt(0)); 394 bound_function->shared()->set_optimized_code_map(
395 isolate->heap()->cleared_optimized_code_map());
395 bound_function->shared()->set_inferred_name(isolate->heap()->empty_string()); 396 bound_function->shared()->set_inferred_name(isolate->heap()->empty_string());
396 // Get all arguments of calling function (Function.prototype.bind). 397 // Get all arguments of calling function (Function.prototype.bind).
397 int argc = 0; 398 int argc = 0;
398 base::SmartArrayPointer<Handle<Object>> arguments = 399 base::SmartArrayPointer<Handle<Object>> arguments =
399 Runtime::GetCallerArguments(isolate, 0, &argc); 400 Runtime::GetCallerArguments(isolate, 0, &argc);
400 // Don't count the this-arg. 401 // Don't count the this-arg.
401 if (argc > 0) { 402 if (argc > 0) {
402 RUNTIME_ASSERT(arguments[0].is_identical_to(this_object)); 403 RUNTIME_ASSERT(arguments[0].is_identical_to(this_object));
403 argc--; 404 argc--;
404 } else { 405 } else {
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 609
609 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) { 610 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) {
610 HandleScope scope(isolate); 611 HandleScope scope(isolate);
611 DCHECK(args.length() == 0); 612 DCHECK(args.length() == 0);
612 THROW_NEW_ERROR_RETURN_FAILURE(isolate, 613 THROW_NEW_ERROR_RETURN_FAILURE(isolate,
613 NewTypeError(MessageTemplate::kStrongArity)); 614 NewTypeError(MessageTemplate::kStrongArity));
614 } 615 }
615 616
616 } // namespace internal 617 } // namespace internal
617 } // namespace v8 618 } // namespace v8
OLDNEW
« src/objects.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698