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

Side by Side Diff: src/factory.cc

Issue 355663002: Optimize Map/Set.prototype.forEach (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Cleanup Created 6 years, 5 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 | « src/factory.h ('k') | src/objects.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 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/conversions.h" 7 #include "src/conversions.h"
8 #include "src/isolate-inl.h" 8 #include "src/isolate-inl.h"
9 #include "src/macro-assembler.h" 9 #include "src/macro-assembler.h"
10 10
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 !info->is_toplevel() && 1387 !info->is_toplevel() &&
1388 info->allows_lazy_compilation() && 1388 info->allows_lazy_compilation() &&
1389 !info->optimization_disabled() && 1389 !info->optimization_disabled() &&
1390 !isolate()->DebuggerHasBreakPoints()) { 1390 !isolate()->DebuggerHasBreakPoints()) {
1391 result->MarkForOptimization(); 1391 result->MarkForOptimization();
1392 } 1392 }
1393 return result; 1393 return result;
1394 } 1394 }
1395 1395
1396 1396
1397 Handle<JSObject> Factory::NewIteratorResultObject(Handle<Object> value,
1398 bool done) {
1399 Handle<Map> map(isolate()->native_context()->iterator_result_map());
1400 Handle<JSObject> result = NewJSObjectFromMap(map, NOT_TENURED, false);
1401 result->InObjectPropertyAtPut(
1402 JSGeneratorObject::kResultValuePropertyIndex, *value);
1403 result->InObjectPropertyAtPut(
1404 JSGeneratorObject::kResultDonePropertyIndex, *ToBoolean(done));
1405 return result;
1406 }
1407
1408
1409 Handle<ScopeInfo> Factory::NewScopeInfo(int length) { 1397 Handle<ScopeInfo> Factory::NewScopeInfo(int length) {
1410 Handle<FixedArray> array = NewFixedArray(length, TENURED); 1398 Handle<FixedArray> array = NewFixedArray(length, TENURED);
1411 array->set_map_no_write_barrier(*scope_info_map()); 1399 array->set_map_no_write_barrier(*scope_info_map());
1412 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast(array); 1400 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast(array);
1413 return scope_info; 1401 return scope_info;
1414 } 1402 }
1415 1403
1416 1404
1417 Handle<JSObject> Factory::NewExternal(void* value) { 1405 Handle<JSObject> Factory::NewExternal(void* value) {
1418 Handle<Foreign> foreign = NewForeign(static_cast<Address>(value)); 1406 Handle<Foreign> foreign = NewForeign(static_cast<Address>(value));
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
2371 return Handle<Object>::null(); 2359 return Handle<Object>::null();
2372 } 2360 }
2373 2361
2374 2362
2375 Handle<Object> Factory::ToBoolean(bool value) { 2363 Handle<Object> Factory::ToBoolean(bool value) {
2376 return value ? true_value() : false_value(); 2364 return value ? true_value() : false_value();
2377 } 2365 }
2378 2366
2379 2367
2380 } } // namespace v8::internal 2368 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698