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

Side by Side Diff: src/factory.cc

Issue 595333002: Non-JSArrays must always have holey elements. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: use CHECK_EQ Created 6 years, 2 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 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/factory.h" 5 #include "src/factory.h"
6 6
7 #include "src/allocation-site-scopes.h" 7 #include "src/allocation-site-scopes.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/conversions.h" 9 #include "src/conversions.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 Handle<JSFunction> Factory::NewFunction(Handle<String> name, 1295 Handle<JSFunction> Factory::NewFunction(Handle<String> name,
1296 Handle<Code> code, 1296 Handle<Code> code,
1297 Handle<Object> prototype, 1297 Handle<Object> prototype,
1298 InstanceType type, 1298 InstanceType type,
1299 int instance_size, 1299 int instance_size,
1300 bool read_only_prototype) { 1300 bool read_only_prototype) {
1301 // Allocate the function 1301 // Allocate the function
1302 Handle<JSFunction> function = NewFunction( 1302 Handle<JSFunction> function = NewFunction(
1303 name, code, prototype, read_only_prototype); 1303 name, code, prototype, read_only_prototype);
1304 1304
1305 Handle<Map> initial_map = NewMap( 1305 ElementsKind elements_kind =
1306 type, instance_size, GetInitialFastElementsKind()); 1306 type == JS_ARRAY_TYPE ? FAST_SMI_ELEMENTS : FAST_HOLEY_SMI_ELEMENTS;
1307 Handle<Map> initial_map = NewMap(type, instance_size, elements_kind);
1307 if (prototype->IsTheHole() && !function->shared()->is_generator()) { 1308 if (prototype->IsTheHole() && !function->shared()->is_generator()) {
1308 prototype = NewFunctionPrototype(function); 1309 prototype = NewFunctionPrototype(function);
1309 } 1310 }
1310 1311
1311 JSFunction::SetInitialMap(function, initial_map, 1312 JSFunction::SetInitialMap(function, initial_map,
1312 Handle<JSReceiver>::cast(prototype)); 1313 Handle<JSReceiver>::cast(prototype));
1313 1314
1314 return function; 1315 return function;
1315 } 1316 }
1316 1317
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 return Handle<Object>::null(); 2398 return Handle<Object>::null();
2398 } 2399 }
2399 2400
2400 2401
2401 Handle<Object> Factory::ToBoolean(bool value) { 2402 Handle<Object> Factory::ToBoolean(bool value) {
2402 return value ? true_value() : false_value(); 2403 return value ? true_value() : false_value();
2403 } 2404 }
2404 2405
2405 2406
2406 } } // namespace v8::internal 2407 } } // namespace v8::internal
OLDNEW
« src/ast.cc ('K') | « src/ast.cc ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698