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

Side by Side Diff: src/factory.cc

Issue 9428001: Remove redundant statements in NewFunctionFromSharedFunctionInfo. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 int number_of_literals = function_info->num_literals(); 540 int number_of_literals = function_info->num_literals();
541 Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure); 541 Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure);
542 if (number_of_literals > 0) { 542 if (number_of_literals > 0) {
543 // Store the object, regexp and array functions in the literals 543 // Store the object, regexp and array functions in the literals
544 // array prefix. These functions will be used when creating 544 // array prefix. These functions will be used when creating
545 // object, regexp and array literals in this function. 545 // object, regexp and array literals in this function.
546 literals->set(JSFunction::kLiteralGlobalContextIndex, 546 literals->set(JSFunction::kLiteralGlobalContextIndex,
547 context->global_context()); 547 context->global_context());
548 } 548 }
549 result->set_literals(*literals); 549 result->set_literals(*literals);
550 } else {
551 result->set_function_bindings(isolate()->heap()->empty_fixed_array());
552 } 550 }
553 result->set_next_function_link(isolate()->heap()->undefined_value());
ulan 2012/02/21 12:51:13 Heap::InitializeFunction sets these fields.
554
555 if (V8::UseCrankshaft() && 551 if (V8::UseCrankshaft() &&
556 FLAG_always_opt && 552 FLAG_always_opt &&
557 result->is_compiled() && 553 result->is_compiled() &&
558 !function_info->is_toplevel() && 554 !function_info->is_toplevel() &&
559 function_info->allows_lazy_compilation()) { 555 function_info->allows_lazy_compilation()) {
560 result->MarkForLazyRecompilation(); 556 result->MarkForLazyRecompilation();
561 } 557 }
562 return result; 558 return result;
563 } 559 }
564 560
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
1422 1418
1423 1419
1424 Handle<Object> Factory::ToBoolean(bool value) { 1420 Handle<Object> Factory::ToBoolean(bool value) {
1425 return Handle<Object>(value 1421 return Handle<Object>(value
1426 ? isolate()->heap()->true_value() 1422 ? isolate()->heap()->true_value()
1427 : isolate()->heap()->false_value()); 1423 : isolate()->heap()->false_value());
1428 } 1424 }
1429 1425
1430 1426
1431 } } // namespace v8::internal 1427 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698