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

Unified Diff: src/factory.cc

Issue 227603004: Handlify deoptimization data allocators. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.h ('k') | src/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index d3a69744d2d7250a2666af9312c9104cbb9b7b32..08e859b340ccae71e390260322b1007c0c87145b 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -156,11 +156,8 @@ Handle<DeoptimizationInputData> Factory::NewDeoptimizationInputData(
int deopt_entry_count,
PretenureFlag pretenure) {
ASSERT(deopt_entry_count > 0);
- CALL_HEAP_FUNCTION(isolate(),
- DeoptimizationInputData::Allocate(isolate(),
- deopt_entry_count,
- pretenure),
- DeoptimizationInputData);
+ int len = DeoptimizationInputData::LengthFor(deopt_entry_count);
+ return Handle<DeoptimizationInputData>::cast(NewFixedArray(len, pretenure));
}
@@ -168,11 +165,8 @@ Handle<DeoptimizationOutputData> Factory::NewDeoptimizationOutputData(
int deopt_entry_count,
PretenureFlag pretenure) {
ASSERT(deopt_entry_count > 0);
- CALL_HEAP_FUNCTION(isolate(),
- DeoptimizationOutputData::Allocate(isolate(),
- deopt_entry_count,
- pretenure),
- DeoptimizationOutputData);
+ int len = DeoptimizationOutputData::LengthOfFixedArray(deopt_entry_count);
+ return Handle<DeoptimizationOutputData>::cast(NewFixedArray(len, pretenure));
}
@@ -982,11 +976,7 @@ Handle<HeapNumber> Factory::NewHeapNumber(double value,
Handle<JSObject> Factory::NewNeanderObject() {
- CALL_HEAP_FUNCTION(
- isolate(),
- isolate()->heap()->AllocateJSObjectFromMap(
- isolate()->heap()->neander_map()),
- JSObject);
+ return NewJSObjectFromMap(neander_map());
}
@@ -1449,30 +1439,21 @@ Handle<JSGeneratorObject> Factory::NewJSGeneratorObject(
JSFunction::EnsureHasInitialMap(function);
Handle<Map> map(function->initial_map());
ASSERT(map->instance_type() == JS_GENERATOR_OBJECT_TYPE);
- CALL_HEAP_FUNCTION(
- isolate(),
- isolate()->heap()->AllocateJSObjectFromMap(*map),
- JSGeneratorObject);
+ return Handle<JSGeneratorObject>::cast(NewJSObjectFromMap(map));
}
Handle<JSArrayBuffer> Factory::NewJSArrayBuffer() {
Handle<JSFunction> array_buffer_fun(
isolate()->context()->native_context()->array_buffer_fun());
- CALL_HEAP_FUNCTION(
- isolate(),
- isolate()->heap()->AllocateJSObject(*array_buffer_fun),
- JSArrayBuffer);
+ return Handle<JSArrayBuffer>::cast(NewJSObject(array_buffer_fun));
}
Handle<JSDataView> Factory::NewJSDataView() {
Handle<JSFunction> data_view_fun(
isolate()->context()->native_context()->data_view_fun());
- CALL_HEAP_FUNCTION(
- isolate(),
- isolate()->heap()->AllocateJSObject(*data_view_fun),
- JSDataView);
+ return Handle<JSDataView>::cast(NewJSObject(data_view_fun));
}
@@ -1496,11 +1477,7 @@ static JSFunction* GetTypedArrayFun(ExternalArrayType type,
Handle<JSTypedArray> Factory::NewJSTypedArray(ExternalArrayType type) {
Handle<JSFunction> typed_array_fun_handle(GetTypedArrayFun(type, isolate()));
-
- CALL_HEAP_FUNCTION(
- isolate(),
- isolate()->heap()->AllocateJSObject(*typed_array_fun_handle),
- JSTypedArray);
+ return Handle<JSTypedArray>::cast(NewJSObject(typed_array_fun_handle));
}
« no previous file with comments | « src/factory.h ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698