// -- lr : return address
// -----------------------------------
SharedFunctionInfo* function_info = function->shared();
- if (false && function_info->HasCustomCallGenerator()) {
+ if (function_info->HasCustomCallGenerator()) {
CustomCallGenerator generator =
ToCData<CustomCallGenerator>(function_info->function_data());
return generator(this, object, holder, function, name, check);
}
+ExternalReference ExternalReference::compile_array_pop_call() {
+ return ExternalReference(FUNCTION_ADDR(CompileArrayPopCall));
+}
+
+
+ExternalReference ExternalReference::compile_array_push_call() {
+ return ExternalReference(FUNCTION_ADDR(CompileArrayPushCall));
+}
+
+
#ifdef V8_NATIVE_REGEXP
ExternalReference ExternalReference::re_check_stack_guard_state() {
static ExternalReference scheduled_exception_address();
+ static ExternalReference compile_array_pop_call();
+ static ExternalReference compile_array_push_call();
+
Address address() const {return reinterpret_cast<Address>(address_);}
#ifdef ENABLE_DEBUGGER_SUPPORT
const int length = str->length();
Object* obj = str->TryFlatten();
if (length <= kMaxAlwaysFlattenLength ||
- unflattended_strings_length_ >= kFlattenLongThreshold) {
+ unflattened_strings_length_ >= kFlattenLongThreshold) {
return obj;
}
if (obj->IsFailure()) {
- unflattended_strings_length_ += length;
+ unflattened_strings_length_ += length;
}
return str;
}
int Heap::mc_count_ = 0;
int Heap::gc_count_ = 0;
-int Heap::unflattended_strings_length_ = 0;
+int Heap::unflattened_strings_length_ = 0;
int Heap::always_allocate_scope_depth_ = 0;
int Heap::linear_allocation_scope_depth_ = 0;
void Heap::GarbageCollectionPrologue() {
TranscendentalCache::Clear();
gc_count_++;
- unflattended_strings_length_ = 0;
+ unflattened_strings_length_ = 0;
#ifdef DEBUG
ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC);
allow_allocation(false);
static int gc_count_; // how many gc happened
// Total length of the strings we failed to flatten since the last GC.
- static int unflattended_strings_length_;
+ static int unflattened_strings_length_;
#define ROOT_ACCESSOR(type, name, camel_name) \
static inline void set_##name(type* value) { \
// -----------------------------------
SharedFunctionInfo* function_info = function->shared();
- if (false && function_info->HasCustomCallGenerator()) {
+ if (function_info->HasCustomCallGenerator()) {
CustomCallGenerator generator =
ToCData<CustomCallGenerator>(function_info->function_data());
return generator(this, object, holder, function, name, check);
static void SetCustomCallGenerator(Handle<JSFunction> function,
- CustomCallGenerator generator) {
+ ExternalReference* generator) {
if (function->shared()->function_data()->IsUndefined()) {
- function->shared()->set_function_data(*FromCData(generator));
+ function->shared()->set_function_data(*FromCData(generator->address()));
}
}
static Handle<JSFunction> InstallBuiltin(Handle<JSObject> holder,
const char* name,
Builtins::Name builtin_name,
- CustomCallGenerator generator = NULL) {
+ ExternalReference* generator = NULL) {
Handle<String> key = Factory::LookupAsciiSymbol(name);
Handle<Code> code(Builtins::builtin(builtin_name));
Handle<JSFunction> optimized = Factory::NewFunction(key,
}
-static Object* CompileArrayPushCall(CallStubCompiler* compiler,
- Object* object,
- JSObject* holder,
- JSFunction* function,
- String* name,
- StubCompiler::CheckType check) {
+Object* CompileArrayPushCall(CallStubCompiler* compiler,
+ Object* object,
+ JSObject* holder,
+ JSFunction* function,
+ String* name,
+ StubCompiler::CheckType check) {
return compiler->CompileArrayPushCall(object, holder, function, name, check);
}
-static Object* CompileArrayPopCall(CallStubCompiler* compiler,
- Object* object,
- JSObject* holder,
- JSFunction* function,
- String* name,
- StubCompiler::CheckType check) {
+Object* CompileArrayPopCall(CallStubCompiler* compiler,
+ Object* object,
+ JSObject* holder,
+ JSFunction* function,
+ String* name,
+ StubCompiler::CheckType check) {
return compiler->CompileArrayPopCall(object, holder, function, name, check);
}
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSObject, holder, 0);
- InstallBuiltin(holder, "pop", Builtins::ArrayPop, CompileArrayPopCall);
- InstallBuiltin(holder, "push", Builtins::ArrayPush, CompileArrayPushCall);
+ ExternalReference pop = ExternalReference::compile_array_pop_call();
+ ExternalReference push = ExternalReference::compile_array_push_call();
+
+ InstallBuiltin(holder, "pop", Builtins::ArrayPop, &pop);
+ InstallBuiltin(holder, "push", Builtins::ArrayPush, &push);
InstallBuiltin(holder, "shift", Builtins::ArrayShift);
InstallBuiltin(holder, "unshift", Builtins::ArrayUnshift);
InstallBuiltin(holder, "slice", Builtins::ArraySlice);
UNCLASSIFIED,
19,
"compare_doubles");
+ Add(ExternalReference::compile_array_pop_call().address(),
+ UNCLASSIFIED,
+ 20,
+ "compile_array_pop");
+ Add(ExternalReference::compile_array_push_call().address(),
+ UNCLASSIFIED,
+ 21,
+ "compile_array_push");
#ifdef V8_NATIVE_REGEXP
Add(ExternalReference::re_case_insensitive_compare_uc16().address(),
UNCLASSIFIED,
- 20,
+ 22,
"NativeRegExpMacroAssembler::CaseInsensitiveCompareUC16()");
Add(ExternalReference::re_check_stack_guard_state().address(),
UNCLASSIFIED,
- 21,
+ 23,
"RegExpMacroAssembler*::CheckStackGuardState()");
Add(ExternalReference::re_grow_stack().address(),
UNCLASSIFIED,
- 22,
+ 24,
"NativeRegExpMacroAssembler::GrowStack()");
Add(ExternalReference::re_word_character_map().address(),
UNCLASSIFIED,
- 23,
+ 25,
"NativeRegExpMacroAssembler::word_character_map");
#endif
// Keyed lookup cache.
Add(ExternalReference::keyed_lookup_cache_keys().address(),
UNCLASSIFIED,
- 24,
+ 26,
"KeyedLookupCache::keys()");
Add(ExternalReference::keyed_lookup_cache_field_offsets().address(),
UNCLASSIFIED,
- 25,
+ 27,
"KeyedLookupCache::field_offsets()");
Add(ExternalReference::transcendental_cache_array_address().address(),
UNCLASSIFIED,
- 26,
+ 28,
"TranscendentalCache::caches()");
}
StubCompiler::CheckType check);
+Object* CompileArrayPushCall(CallStubCompiler* compiler,
+ Object* object,
+ JSObject* holder,
+ JSFunction* function,
+ String* name,
+ StubCompiler::CheckType check);
+
+
+Object* CompileArrayPopCall(CallStubCompiler* compiler,
+ Object* object,
+ JSObject* holder,
+ JSFunction* function,
+ String* name,
+ StubCompiler::CheckType check);
+
+
} } // namespace v8::internal
#endif // V8_STUB_CACHE_H_
// -----------------------------------
SharedFunctionInfo* function_info = function->shared();
- if (false && function_info->HasCustomCallGenerator()) {
+ if (function_info->HasCustomCallGenerator()) {
CustomCallGenerator generator =
ToCData<CustomCallGenerator>(function_info->function_data());
return generator(this, object, holder, function, name, check);