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

Side by Side Diff: src/factory.cc

Issue 2402363002: [Math] implement Math.random as TFJ builtin. (Closed)
Patch Set: fix golden file Created 4 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
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/accessors.h" 7 #include "src/accessors.h"
8 #include "src/allocation-site-scopes.h" 8 #include "src/allocation-site-scopes.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 } 773 }
774 774
775 775
776 Handle<Context> Factory::NewNativeContext() { 776 Handle<Context> Factory::NewNativeContext() {
777 Handle<FixedArray> array = 777 Handle<FixedArray> array =
778 NewFixedArray(Context::NATIVE_CONTEXT_SLOTS, TENURED); 778 NewFixedArray(Context::NATIVE_CONTEXT_SLOTS, TENURED);
779 array->set_map_no_write_barrier(*native_context_map()); 779 array->set_map_no_write_barrier(*native_context_map());
780 Handle<Context> context = Handle<Context>::cast(array); 780 Handle<Context> context = Handle<Context>::cast(array);
781 context->set_native_context(*context); 781 context->set_native_context(*context);
782 context->set_errors_thrown(Smi::kZero); 782 context->set_errors_thrown(Smi::kZero);
783 context->set_math_random_index(Smi::kZero);
783 Handle<WeakCell> weak_cell = NewWeakCell(context); 784 Handle<WeakCell> weak_cell = NewWeakCell(context);
784 context->set_self_weak_cell(*weak_cell); 785 context->set_self_weak_cell(*weak_cell);
785 DCHECK(context->IsNativeContext()); 786 DCHECK(context->IsNativeContext());
786 return context; 787 return context;
787 } 788 }
788 789
789 790
790 Handle<Context> Factory::NewScriptContext(Handle<JSFunction> function, 791 Handle<Context> Factory::NewScriptContext(Handle<JSFunction> function,
791 Handle<ScopeInfo> scope_info) { 792 Handle<ScopeInfo> scope_info) {
792 DCHECK_EQ(scope_info->scope_type(), SCRIPT_SCOPE); 793 DCHECK_EQ(scope_info->scope_type(), SCRIPT_SCOPE);
(...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after
2604 Handle<AccessorInfo> prototype = 2605 Handle<AccessorInfo> prototype =
2605 Accessors::FunctionPrototypeInfo(isolate(), attribs); 2606 Accessors::FunctionPrototypeInfo(isolate(), attribs);
2606 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), 2607 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())),
2607 prototype, attribs); 2608 prototype, attribs);
2608 map->AppendDescriptor(&d); 2609 map->AppendDescriptor(&d);
2609 } 2610 }
2610 } 2611 }
2611 2612
2612 } // namespace internal 2613 } // namespace internal
2613 } // namespace v8 2614 } // namespace v8
OLDNEW
« no previous file with comments | « src/contexts.h ('k') | src/js/collection.js » ('j') | test/mjsunit/debug-script.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698