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

Side by Side Diff: src/bootstrapper.cc

Issue 7497067: Fix fun.apply(receiver, arguments) optimization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 4 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 | src/hydrogen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 InstallNativeFunctions(); 1580 InstallNativeFunctions();
1581 1581
1582 // Store the map for the string prototype after the natives has been compiled 1582 // Store the map for the string prototype after the natives has been compiled
1583 // and the String function has been setup. 1583 // and the String function has been setup.
1584 Handle<JSFunction> string_function(global_context()->string_function()); 1584 Handle<JSFunction> string_function(global_context()->string_function());
1585 ASSERT(JSObject::cast( 1585 ASSERT(JSObject::cast(
1586 string_function->initial_map()->prototype())->HasFastProperties()); 1586 string_function->initial_map()->prototype())->HasFastProperties());
1587 global_context()->set_string_function_prototype_map( 1587 global_context()->set_string_function_prototype_map(
1588 HeapObject::cast(string_function->initial_map()->prototype())->map()); 1588 HeapObject::cast(string_function->initial_map()->prototype())->map());
1589 1589
1590 InstallBuiltinFunctionIds();
1591
1592 // Install Function.prototype.call and apply. 1590 // Install Function.prototype.call and apply.
1593 { Handle<String> key = factory()->function_class_symbol(); 1591 { Handle<String> key = factory()->function_class_symbol();
1594 Handle<JSFunction> function = 1592 Handle<JSFunction> function =
1595 Handle<JSFunction>::cast(GetProperty(isolate()->global(), key)); 1593 Handle<JSFunction>::cast(GetProperty(isolate()->global(), key));
1596 Handle<JSObject> proto = 1594 Handle<JSObject> proto =
1597 Handle<JSObject>(JSObject::cast(function->instance_prototype())); 1595 Handle<JSObject>(JSObject::cast(function->instance_prototype()));
1598 1596
1599 // Install the call and the apply functions. 1597 // Install the call and the apply functions.
1600 Handle<JSFunction> call = 1598 Handle<JSFunction> call =
1601 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, 1599 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize,
(...skipping 13 matching lines...) Expand all
1615 ASSERT(call->is_compiled()); 1613 ASSERT(call->is_compiled());
1616 1614
1617 // Set the expected parameters for apply to 2; required by builtin. 1615 // Set the expected parameters for apply to 2; required by builtin.
1618 apply->shared()->set_formal_parameter_count(2); 1616 apply->shared()->set_formal_parameter_count(2);
1619 1617
1620 // Set the lengths for the functions to satisfy ECMA-262. 1618 // Set the lengths for the functions to satisfy ECMA-262.
1621 call->shared()->set_length(1); 1619 call->shared()->set_length(1);
1622 apply->shared()->set_length(2); 1620 apply->shared()->set_length(2);
1623 } 1621 }
1624 1622
1623 InstallBuiltinFunctionIds();
1624
1625 // Create a constructor for RegExp results (a variant of Array that 1625 // Create a constructor for RegExp results (a variant of Array that
1626 // predefines the two properties index and match). 1626 // predefines the two properties index and match).
1627 { 1627 {
1628 // RegExpResult initial map. 1628 // RegExpResult initial map.
1629 1629
1630 // Find global.Array.prototype to inherit from. 1630 // Find global.Array.prototype to inherit from.
1631 Handle<JSFunction> array_constructor(global_context()->array_function()); 1631 Handle<JSFunction> array_constructor(global_context()->array_function());
1632 Handle<JSObject> array_prototype( 1632 Handle<JSObject> array_prototype(
1633 JSObject::cast(array_constructor->instance_prototype())); 1633 JSObject::cast(array_constructor->instance_prototype()));
1634 1634
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
2220 return from + sizeof(NestingCounterType); 2220 return from + sizeof(NestingCounterType);
2221 } 2221 }
2222 2222
2223 2223
2224 // Called when the top-level V8 mutex is destroyed. 2224 // Called when the top-level V8 mutex is destroyed.
2225 void Bootstrapper::FreeThreadResources() { 2225 void Bootstrapper::FreeThreadResources() {
2226 ASSERT(!IsActive()); 2226 ASSERT(!IsActive());
2227 } 2227 }
2228 2228
2229 } } // namespace v8::internal 2229 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698