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

Side by Side Diff: src/factory.cc

Issue 177683002: Mode clean-up pt 1: rename classic/non-strict mode to sloppy mode (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 } 1241 }
1242 1242
1243 JSFunction::SetPrototype(function, prototype); 1243 JSFunction::SetPrototype(function, prototype);
1244 return function; 1244 return function;
1245 } 1245 }
1246 1246
1247 1247
1248 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name, 1248 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name,
1249 Handle<Code> code) { 1249 Handle<Code> code) {
1250 Handle<JSFunction> function = NewFunctionWithoutPrototype(name, 1250 Handle<JSFunction> function = NewFunctionWithoutPrototype(name,
1251 CLASSIC_MODE); 1251 SLOPPY_MODE);
1252 function->shared()->set_code(*code); 1252 function->shared()->set_code(*code);
1253 function->set_code(*code); 1253 function->set_code(*code);
1254 ASSERT(!function->has_initial_map()); 1254 ASSERT(!function->has_initial_map());
1255 ASSERT(!function->has_prototype()); 1255 ASSERT(!function->has_prototype());
1256 return function; 1256 return function;
1257 } 1257 }
1258 1258
1259 1259
1260 Handle<ScopeInfo> Factory::NewScopeInfo(int length) { 1260 Handle<ScopeInfo> Factory::NewScopeInfo(int length) {
1261 CALL_HEAP_FUNCTION( 1261 CALL_HEAP_FUNCTION(
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 Handle<JSFunction> fun = NewFunctionHelper(name, prototype); 1634 Handle<JSFunction> fun = NewFunctionHelper(name, prototype);
1635 fun->set_context(isolate()->context()->native_context()); 1635 fun->set_context(isolate()->context()->native_context());
1636 return fun; 1636 return fun;
1637 } 1637 }
1638 1638
1639 1639
1640 Handle<JSFunction> Factory::NewFunctionWithoutPrototypeHelper( 1640 Handle<JSFunction> Factory::NewFunctionWithoutPrototypeHelper(
1641 Handle<String> name, 1641 Handle<String> name,
1642 LanguageMode language_mode) { 1642 LanguageMode language_mode) {
1643 Handle<SharedFunctionInfo> function_share = NewSharedFunctionInfo(name); 1643 Handle<SharedFunctionInfo> function_share = NewSharedFunctionInfo(name);
1644 Handle<Map> map = (language_mode == CLASSIC_MODE) 1644 Handle<Map> map = (language_mode == SLOPPY_MODE)
1645 ? isolate()->function_without_prototype_map() 1645 ? isolate()->function_without_prototype_map()
1646 : isolate()->strict_mode_function_without_prototype_map(); 1646 : isolate()->strict_mode_function_without_prototype_map();
1647 CALL_HEAP_FUNCTION(isolate(), 1647 CALL_HEAP_FUNCTION(isolate(),
1648 isolate()->heap()->AllocateFunction( 1648 isolate()->heap()->AllocateFunction(
1649 *map, 1649 *map,
1650 *function_share, 1650 *function_share,
1651 *the_hole_value()), 1651 *the_hole_value()),
1652 JSFunction); 1652 JSFunction);
1653 } 1653 }
1654 1654
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
1988 return Handle<Object>::null(); 1988 return Handle<Object>::null();
1989 } 1989 }
1990 1990
1991 1991
1992 Handle<Object> Factory::ToBoolean(bool value) { 1992 Handle<Object> Factory::ToBoolean(bool value) {
1993 return value ? true_value() : false_value(); 1993 return value ? true_value() : false_value();
1994 } 1994 }
1995 1995
1996 1996
1997 } } // namespace v8::internal 1997 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/execution.cc ('k') | src/full-codegen.h » ('j') | src/globals.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698