Commit 5b8d4225 authored by whesse@chromium.org's avatar whesse@chromium.org

Remove one of the GCs performed by the --gc-greedy flag. The GC performed by...

Remove one of the GCs performed by the --gc-greedy flag.  The GC performed by CEntryStub before the first call to C, when --gc-greedy is set, caused a bug in calling API callbacks.
Review URL: http://codereview.chromium.org/171104

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2706 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1656dd63
......@@ -39,7 +39,7 @@ namespace internal {
void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) {
// TODO(1238487): Don't pass the function in a static variable.
// TODO(428): Don't pass the function in a static variable.
__ mov(ip, Operand(ExternalReference::builtin_passed_function()));
__ str(r1, MemOperand(ip, 0));
......
......@@ -5890,16 +5890,11 @@ void CEntryStub::GenerateBody(MacroAssembler* masm, bool is_debug_break) {
Label throw_out_of_memory_exception;
Label throw_normal_exception;
// Call into the runtime system. Collect garbage before the call if
// running with --gc-greedy set.
if (FLAG_gc_greedy) {
Failure* failure = Failure::RetryAfterGC(0);
__ mov(r0, Operand(reinterpret_cast<intptr_t>(failure)));
}
// Call into the runtime system.
GenerateCore(masm, &throw_normal_exception,
&throw_out_of_memory_exception,
frame_type,
FLAG_gc_greedy,
false,
false);
// Do space-specific GC and retry runtime call.
......
......@@ -61,7 +61,7 @@ namespace internal {
// ----------------------------------------------------------------------------
// TODO(1238487): We should consider passing whether or not the
// TODO(428): We should consider passing whether or not the
// builtin was invoked as a constructor as part of the
// arguments. Maybe we also want to pass the called function?
#define BUILTIN(name) \
......@@ -336,9 +336,7 @@ BUILTIN(HandleApiCall) {
HandleScope scope;
bool is_construct = CalledAsConstructor();
// TODO(1238487): This is not nice. We need to get rid of this
// kludgy behavior and start handling API calls in a more direct
// way - maybe compile specialized stubs lazily?.
// TODO(428): Remove use of static variable, handle API callbacks directly.
Handle<JSFunction> function =
Handle<JSFunction>(JSFunction::cast(Builtins::builtin_passed_function));
......
......@@ -37,7 +37,7 @@ namespace internal {
void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) {
// TODO(1238487): Don't pass the function in a static variable.
// TODO(428): Don't pass the function in a static variable.
ExternalReference passed = ExternalReference::builtin_passed_function();
__ mov(Operand::StaticVariable(passed), edi);
......
......@@ -7670,16 +7670,11 @@ void CEntryStub::GenerateBody(MacroAssembler* masm, bool is_debug_break) {
Label throw_out_of_memory_exception;
Label throw_normal_exception;
// Call into the runtime system. Collect garbage before the call if
// running with --gc-greedy set.
if (FLAG_gc_greedy) {
Failure* failure = Failure::RetryAfterGC(0);
__ mov(eax, Immediate(reinterpret_cast<int32_t>(failure)));
}
// Call into the runtime system.
GenerateCore(masm, &throw_normal_exception,
&throw_out_of_memory_exception,
frame_type,
FLAG_gc_greedy,
false,
false);
// Do space-specific GC and retry runtime call.
......
......@@ -35,7 +35,7 @@ namespace internal {
#define __ ACCESS_MASM(masm)
void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) {
// TODO(1238487): Don't pass the function in a static variable.
// TODO(428): Don't pass the function in a static variable.
ExternalReference passed = ExternalReference::builtin_passed_function();
__ movq(kScratchRegister, passed.address(), RelocInfo::EXTERNAL_REFERENCE);
__ movq(Operand(kScratchRegister, 0), rdi);
......
......@@ -6950,17 +6950,12 @@ void CEntryStub::GenerateBody(MacroAssembler* masm, bool is_debug_break) {
Label throw_out_of_memory_exception;
Label throw_normal_exception;
// Call into the runtime system. Collect garbage before the call if
// running with --gc-greedy set.
if (FLAG_gc_greedy) {
Failure* failure = Failure::RetryAfterGC(0);
__ movq(rax, failure, RelocInfo::NONE);
}
// Call into the runtime system.
GenerateCore(masm,
&throw_normal_exception,
&throw_out_of_memory_exception,
frame_type,
FLAG_gc_greedy,
false,
false);
// Do space-specific GC and retry runtime call.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment