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

Side by Side Diff: src/factory.cc

Issue 886473005: Add WeakMap to v8.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
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 2218 matching lines...) Expand 10 before | Expand all | Expand 10 after
2229 Handle<JSObject> result = NewJSObjectFromMap(map); 2229 Handle<JSObject> result = NewJSObjectFromMap(map);
2230 Handle<Smi> value(Smi::FromInt(length), isolate()); 2230 Handle<Smi> value(Smi::FromInt(length), isolate());
2231 Object::SetProperty(result, length_string(), value, STRICT).Assert(); 2231 Object::SetProperty(result, length_string(), value, STRICT).Assert();
2232 if (!strict_mode_callee) { 2232 if (!strict_mode_callee) {
2233 Object::SetProperty(result, callee_string(), callee, STRICT).Assert(); 2233 Object::SetProperty(result, callee_string(), callee, STRICT).Assert();
2234 } 2234 }
2235 return result; 2235 return result;
2236 } 2236 }
2237 2237
2238 2238
2239 Handle<JSWeakMap> Factory::NewJSWeakMap() {
2240 Handle<Map> map = NewMap(JS_WEAK_MAP_TYPE, JSWeakMap::kSize);
2241 return Handle<JSWeakMap>::cast(NewJSObjectFromMap(map));
2242 }
2243
2244
2239 Handle<JSFunction> Factory::CreateApiFunction( 2245 Handle<JSFunction> Factory::CreateApiFunction(
2240 Handle<FunctionTemplateInfo> obj, 2246 Handle<FunctionTemplateInfo> obj,
2241 Handle<Object> prototype, 2247 Handle<Object> prototype,
2242 ApiInstanceType instance_type) { 2248 ApiInstanceType instance_type) {
2243 Handle<Code> code = isolate()->builtins()->HandleApiCall(); 2249 Handle<Code> code = isolate()->builtins()->HandleApiCall();
2244 Handle<Code> construct_stub = isolate()->builtins()->JSConstructStubApi(); 2250 Handle<Code> construct_stub = isolate()->builtins()->JSConstructStubApi();
2245 2251
2246 obj->set_instantiated(true); 2252 obj->set_instantiated(true);
2247 Handle<JSFunction> result; 2253 Handle<JSFunction> result;
2248 if (obj->remove_prototype()) { 2254 if (obj->remove_prototype()) {
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
2514 return Handle<Object>::null(); 2520 return Handle<Object>::null();
2515 } 2521 }
2516 2522
2517 2523
2518 Handle<Object> Factory::ToBoolean(bool value) { 2524 Handle<Object> Factory::ToBoolean(bool value) {
2519 return value ? true_value() : false_value(); 2525 return value ? true_value() : false_value();
2520 } 2526 }
2521 2527
2522 2528
2523 } } // namespace v8::internal 2529 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698