[Sheriff] Revert "Add support for keyed-call on arrays of fast elements"
authormachenbach@chromium.org <machenbach@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 14 Nov 2013 15:00:13 +0000 (15:00 +0000)
committermachenbach@chromium.org <machenbach@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 14 Nov 2013 15:00:13 +0000 (15:00 +0000)
This reverts commit r17746 for breaking layout tests.

TBR=verwaest@chromium.org
BUG=

Review URL: https://codereview.chromium.org/72753002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17751 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

32 files changed:
src/arm/code-stubs-arm.cc
src/arm/lithium-arm.cc
src/arm/lithium-codegen-arm.cc
src/ast.cc
src/ast.h
src/code-stubs-hydrogen.cc
src/code-stubs.cc
src/code-stubs.h
src/compiler.cc
src/compiler.h
src/deoptimizer.cc
src/frames.cc
src/heap.cc
src/heap.h
src/hydrogen-instructions.h
src/hydrogen.cc
src/hydrogen.h
src/ia32/code-stubs-ia32.cc
src/ia32/lithium-codegen-ia32.cc
src/ia32/lithium-ia32.cc
src/ic.cc
src/ic.h
src/isolate.cc
src/lithium.cc
src/objects-inl.h
src/type-info.cc
src/type-info.h
src/typing.cc
src/x64/code-stubs-x64.cc
src/x64/lithium-codegen-x64.cc
src/x64/lithium-x64.cc
test/mjsunit/keyed-array-call.js [deleted file]

index 0fe6fa8825171a3b95a4fe5a2879c4af79c2f91c..8db65bcfd481dbbb4185135a6e46617e6951a594 100644 (file)
@@ -133,19 +133,6 @@ void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
 }
 
 
-void KeyedArrayCallStub::InitializeInterfaceDescriptor(
-    Isolate* isolate,
-    CodeStubInterfaceDescriptor* descriptor) {
-  static Register registers[] = { r2 };
-  descriptor->register_param_count_ = 1;
-  descriptor->register_params_ = registers;
-  descriptor->continuation_type_ = TAIL_CALL_CONTINUATION;
-  descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
-  descriptor->deoptimization_handler_ =
-      FUNCTION_ADDR(KeyedCallIC_MissFromStubFailure);
-}
-
-
 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
     Isolate* isolate,
     CodeStubInterfaceDescriptor* descriptor) {
@@ -5706,24 +5693,6 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
 }
 
 
-void StubFailureTailCallTrampolineStub::Generate(MacroAssembler* masm) {
-  CEntryStub ces(1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs);
-  __ Call(ces.GetCode(masm->isolate()), RelocInfo::CODE_TARGET);
-  __ mov(r1, r0);
-  int parameter_count_offset =
-      StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
-  __ ldr(r0, MemOperand(fp, parameter_count_offset));
-  // The parameter count above includes the receiver for the arguments passed to
-  // the deoptimization handler. Subtract the receiver for the parameter count
-  // for the call.
-  __ sub(r0, r0, Operand(1));
-  masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
-  ParameterCount argument_count(r0);
-  __ InvokeFunction(
-      r1, argument_count, JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD);
-}
-
-
 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
   if (masm->isolate()->function_entry_hook() != NULL) {
     PredictableCodeSizeScope predictable(masm, 4 * Assembler::kInstrSize);
index 53ba309e61a3f5274121e3f0afc5ff87274baea1..787fc81aa881eaa26685e76c4627f30bd2e9c12a 100644 (file)
@@ -1328,10 +1328,8 @@ LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) {
 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) {
   LOperand* context = UseFixed(instr->context(), cp);
   LOperand* function = UseFixed(instr->function(), r1);
-  LCallFunction* call = new(zone()) LCallFunction(context, function);
-  LInstruction* result = DefineFixed(call, r0);
-  if (instr->IsTailCall()) return result;
-  return MarkAsCall(result, instr);
+  return MarkAsCall(
+      DefineFixed(new(zone()) LCallFunction(context, function), r0), instr);
 }
 
 
index de9123d5c4ce0d2d1688b8f40d862f3c586540da..207dd8cdaa40550343a1d7a7a31fc6ff5bbc5bc7 100644 (file)
@@ -509,36 +509,17 @@ Operand LCodeGen::ToOperand(LOperand* op) {
 }
 
 
-static int ArgumentsOffsetWithoutFrame(int index) {
-  ASSERT(index < 0);
-  return -(index + 1) * kPointerSize;
-}
-
-
 MemOperand LCodeGen::ToMemOperand(LOperand* op) const {
   ASSERT(!op->IsRegister());
   ASSERT(!op->IsDoubleRegister());
   ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot());
-  if (NeedsEagerFrame()) {
-    return MemOperand(fp, StackSlotOffset(op->index()));
-  } else {
-    // Retrieve parameter without eager stack-frame relative to the
-    // stack-pointer.
-    return MemOperand(sp, ArgumentsOffsetWithoutFrame(op->index()));
-  }
+  return MemOperand(fp, StackSlotOffset(op->index()));
 }
 
 
 MemOperand LCodeGen::ToHighMemOperand(LOperand* op) const {
   ASSERT(op->IsDoubleStackSlot());
-  if (NeedsEagerFrame()) {
-    return MemOperand(fp, StackSlotOffset(op->index()) + kPointerSize);
-  } else {
-    // Retrieve parameter without eager stack-frame relative to the
-    // stack-pointer.
-    return MemOperand(
-        sp, ArgumentsOffsetWithoutFrame(op->index()) + kPointerSize);
-  }
+  return MemOperand(fp, StackSlotOffset(op->index()) + kPointerSize);
 }
 
 
@@ -4126,12 +4107,7 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) {
 
   int arity = instr->arity();
   CallFunctionStub stub(arity, NO_CALL_FUNCTION_FLAGS);
-  if (instr->hydrogen()->IsTailCall()) {
-    if (NeedsEagerFrame()) __ mov(sp, fp);
-    __ Jump(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
-  } else {
-    CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
-  }
+  CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
 }
 
 
index adf0fb8703dc68800cf8b34fbf1624d71a70383f..9deb71d0afeb9667a586c0600756d01be9db983c 100644 (file)
@@ -776,7 +776,7 @@ void Call::RecordTypeFeedback(TypeFeedbackOracle* oracle,
   if (property == NULL) {
     // Function call.  Specialize for monomorphic calls.
     if (is_monomorphic_) target_ = oracle->GetCallTarget(this);
-  } else if (property->key()->IsPropertyName()) {
+  } else {
     // Method call.  Specialize for the receiver types seen at runtime.
     Literal* key = property->key()->AsLiteral();
     ASSERT(key != NULL && key->value()->IsString());
@@ -803,10 +803,6 @@ void Call::RecordTypeFeedback(TypeFeedbackOracle* oracle,
       Handle<Map> map = receiver_types_.first();
       is_monomorphic_ = ComputeTarget(map, name);
     }
-  } else {
-    if (is_monomorphic_) {
-      keyed_array_call_is_holey_ = oracle->KeyedArrayCallIsHoley(this);
-    }
   }
 }
 
index 2a8669690d835a1d36682e385cfe4612fa9b67ef..42f6c8bd939423cc08c48b69191594ed7dc37d11 100644 (file)
--- a/src/ast.h
+++ b/src/ast.h
@@ -1728,7 +1728,6 @@ class Call V8_FINAL : public Expression {
     return &receiver_types_;
   }
   virtual bool IsMonomorphic() V8_OVERRIDE { return is_monomorphic_; }
-  bool KeyedArrayCallIsHoley() { return keyed_array_call_is_holey_; }
   CheckType check_type() const { return check_type_; }
 
   void set_string_check(Handle<JSObject> holder) {
@@ -1779,7 +1778,6 @@ class Call V8_FINAL : public Expression {
         expression_(expression),
         arguments_(arguments),
         is_monomorphic_(false),
-        keyed_array_call_is_holey_(true),
         check_type_(RECEIVER_MAP_CHECK),
         return_id_(GetNextId(isolate)) { }
 
@@ -1788,7 +1786,6 @@ class Call V8_FINAL : public Expression {
   ZoneList<Expression*>* arguments_;
 
   bool is_monomorphic_;
-  bool keyed_array_call_is_holey_;
   CheckType check_type_;
   SmallMapList receiver_types_;
   Handle<JSFunction> target_;
index d65026b843ca4ec6d70947c7e03e39e18ccc5e18..eb3bac8fbf4056609374e4c3f4fc44187e92f945 100644 (file)
@@ -594,32 +594,6 @@ Handle<Code> KeyedLoadFieldStub::GenerateCode(Isolate* isolate) {
 }
 
 
-template<>
-HValue* CodeStubGraphBuilder<KeyedArrayCallStub>::BuildCodeStub() {
-  int argc = casted_stub()->argc() + 1;
-  info()->set_parameter_count(argc);
-
-  HValue* receiver = Add<HParameter>(1);
-
-  // Load the expected initial array map from the context.
-  JSArrayBuilder array_builder(this, casted_stub()->elements_kind());
-  HValue* map = array_builder.EmitMapCode();
-
-  HValue* checked_receiver = Add<HCheckMapValue>(receiver, map);
-
-  HValue* function = BuildUncheckedMonomorphicElementAccess(
-      checked_receiver, GetParameter(0),
-      NULL, true, casted_stub()->elements_kind(),
-      false, NEVER_RETURN_HOLE, STANDARD_STORE);
-  return Add<HCallFunction>(function, argc, TAIL_CALL);
-}
-
-
-Handle<Code> KeyedArrayCallStub::GenerateCode(Isolate* isolate) {
-  return DoGenerateCode(isolate, this);
-}
-
-
 template <>
 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() {
   BuildUncheckedMonomorphicElementAccess(
index c37c56e4f75b6c0bb2faa7fa70f00e055ebe3c16..f6e880f61062e4f6286d48089d83d77812b89f55 100644 (file)
@@ -43,7 +43,6 @@ CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor()
     : register_param_count_(-1),
       stack_parameter_count_(no_reg),
       hint_stack_parameter_count_(-1),
-      continuation_type_(NORMAL_CONTINUATION),
       function_mode_(NOT_JS_FUNCTION_STUB_MODE),
       register_params_(NULL),
       deoptimization_handler_(NULL),
@@ -52,11 +51,6 @@ CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor()
       has_miss_handler_(false) { }
 
 
-void CodeStub::GenerateStubsRequiringBuiltinsAheadOfTime(Isolate* isolate) {
-  StubFailureTailCallTrampolineStub::GenerateAheadOfTime(isolate);
-}
-
-
 bool CodeStub::FindCodeInCache(Code** code_out, Isolate* isolate) {
   UnseededNumberDictionary* stubs = isolate->heap()->code_stubs();
   int index = stubs->FindEntry(GetKey());
@@ -1115,12 +1109,6 @@ void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) {
 }
 
 
-void StubFailureTailCallTrampolineStub::GenerateAheadOfTime(Isolate* isolate) {
-  StubFailureTailCallTrampolineStub stub;
-  stub.GetCode(isolate)->set_is_pregenerated(true);
-}
-
-
 void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function,
                                                intptr_t stack_pointer,
                                                Isolate* isolate) {
index cd14047abd6cdffd84c9b89de4c5b2b931a43129..8f1b686743317a39f95b764933a901de4b788214 100644 (file)
@@ -90,15 +90,13 @@ namespace internal {
   V(TransitionElementsKind)              \
   V(StoreArrayLiteralElement)            \
   V(StubFailureTrampoline)               \
-  V(StubFailureTailCallTrampoline)       \
   V(ArrayConstructor)                    \
   V(InternalArrayConstructor)            \
   V(ProfileEntryHook)                    \
   V(StoreGlobal)                         \
   /* IC Handler stubs */                 \
   V(LoadField)                           \
-  V(KeyedLoadField)                      \
-  V(KeyedArrayCall)
+  V(KeyedLoadField)
 
 // List of code stubs only used on ARM platforms.
 #if V8_TARGET_ARCH_ARM
@@ -172,7 +170,6 @@ class CodeStub BASE_EMBEDDED {
   virtual bool IsPregenerated(Isolate* isolate) { return false; }
 
   static void GenerateStubsAheadOfTime(Isolate* isolate);
-  static void GenerateStubsRequiringBuiltinsAheadOfTime(Isolate* isolate);
   static void GenerateFPStubs(Isolate* isolate);
 
   // Some stubs put untagged junk on the stack that cannot be scanned by the
@@ -282,9 +279,6 @@ class PlatformCodeStub : public CodeStub {
 enum StubFunctionMode { NOT_JS_FUNCTION_STUB_MODE, JS_FUNCTION_STUB_MODE };
 enum HandlerArgumentsMode { DONT_PASS_ARGUMENTS, PASS_ARGUMENTS };
 
-enum ContinuationType { NORMAL_CONTINUATION, TAIL_CALL_CONTINUATION };
-
-
 struct CodeStubInterfaceDescriptor {
   CodeStubInterfaceDescriptor();
   int register_param_count_;
@@ -293,23 +287,18 @@ struct CodeStubInterfaceDescriptor {
   // if hint_stack_parameter_count_ > 0, the code stub can optimize the
   // return sequence. Default value is -1, which means it is ignored.
   int hint_stack_parameter_count_;
-  ContinuationType continuation_type_;
   StubFunctionMode function_mode_;
   Register* register_params_;
 
   Address deoptimization_handler_;
   HandlerArgumentsMode handler_arguments_mode_;
 
-  bool initialized() const { return register_param_count_ >= 0; }
-
-  bool HasTailCallContinuation() const {
-    return continuation_type_ == TAIL_CALL_CONTINUATION;
-  }
-
   int environment_length() const {
     return register_param_count_;
   }
 
+  bool initialized() const { return register_param_count_ >= 0; }
+
   void SetMissHandler(ExternalReference handler) {
     miss_handler_ = handler;
     has_miss_handler_ = true;
@@ -887,11 +876,6 @@ class HandlerStub: public HICStub {
  public:
   virtual Code::Kind GetCodeKind() const { return Code::HANDLER; }
   virtual int GetStubFlags() { return kind(); }
-
- protected:
-  HandlerStub() : HICStub() { }
-  virtual int NotMissMinorKey() { return bit_field_; }
-  int bit_field_;
 };
 
 
@@ -953,6 +937,9 @@ class LoadFieldStub: public HandlerStub {
   class IndexBits: public BitField<int, 5, 11> {};
   class UnboxedDoubleBits: public BitField<bool, 16, 1> {};
   virtual CodeStub::Major MajorKey() { return LoadField; }
+  virtual int NotMissMinorKey() { return bit_field_; }
+
+  int bit_field_;
 };
 
 
@@ -1031,52 +1018,6 @@ class KeyedLoadFieldStub: public LoadFieldStub {
 };
 
 
-class KeyedArrayCallStub: public HICStub {
- public:
-  KeyedArrayCallStub(bool holey, int argc) : HICStub(), argc_(argc) {
-    bit_field_ = KindBits::encode(Code::KEYED_CALL_IC)
-        | HoleyBits::encode(holey);
-  }
-
-  virtual Code::Kind kind() const {
-    return KindBits::decode(bit_field_);
-  }
-
-  virtual Code::ExtraICState GetExtraICState() { return bit_field_; }
-
-  ElementsKind elements_kind() {
-    return HoleyBits::decode(bit_field_) ? FAST_HOLEY_ELEMENTS : FAST_ELEMENTS;
-  }
-
-  int argc() { return argc_; }
-  virtual int GetStubFlags() { return argc(); }
-
-  static bool IsHoley(Handle<Code> code) {
-    Code::ExtraICState state = code->extra_ic_state();
-    return HoleyBits::decode(state);
-  }
-
-  virtual void InitializeInterfaceDescriptor(
-      Isolate* isolate,
-      CodeStubInterfaceDescriptor* descriptor);
-
-  virtual Handle<Code> GenerateCode(Isolate* isolate);
-
- private:
-  virtual int NotMissMinorKey() {
-    return GetExtraICState() | ArgcBits::encode(argc_);
-  }
-
-  STATIC_ASSERT(KindBits::kSize == 4);
-  class HoleyBits: public BitField<bool, 4, 1> {};
-  STATIC_ASSERT(Code::kArgumentsBits <= kStubMinorKeyBits - 5);
-  class ArgcBits: public BitField<int, 5, Code::kArgumentsBits> {};
-  virtual CodeStub::Major MajorKey() { return KeyedArrayCall; }
-  int bit_field_;
-  int argc_;
-};
-
-
 class BinaryOpStub: public HydrogenCodeStub {
  public:
   BinaryOpStub(Token::Value op, OverwriteMode mode)
@@ -2458,27 +2399,6 @@ class StubFailureTrampolineStub : public PlatformCodeStub {
 };
 
 
-class StubFailureTailCallTrampolineStub : public PlatformCodeStub {
- public:
-  StubFailureTailCallTrampolineStub() : fp_registers_(CanUseFPRegisters()) {}
-
-  virtual bool IsPregenerated(Isolate* isolate) V8_OVERRIDE { return true; }
-
-  static void GenerateAheadOfTime(Isolate* isolate);
-
- private:
-  class FPRegisters: public BitField<bool, 0, 1> {};
-  Major MajorKey() { return StubFailureTailCallTrampoline; }
-  int MinorKey() { return FPRegisters::encode(fp_registers_); }
-
-  void Generate(MacroAssembler* masm);
-
-  bool fp_registers_;
-
-  DISALLOW_COPY_AND_ASSIGN(StubFailureTailCallTrampolineStub);
-};
-
-
 class ProfileEntryHookStub : public PlatformCodeStub {
  public:
   explicit ProfileEntryHookStub() {}
index 1ec2626da9b2ce22eefd25de31468035ba3804c1..e86baa02aa3faee01657ee2a7bc980dfc25210b0 100644 (file)
@@ -59,8 +59,7 @@ CompilationInfo::CompilationInfo(Handle<Script> script,
     : flags_(LanguageModeField::encode(CLASSIC_MODE)),
       script_(script),
       osr_ast_id_(BailoutId::None()),
-      osr_pc_offset_(0),
-      parameter_count_(0) {
+      osr_pc_offset_(0) {
   Initialize(script->GetIsolate(), BASE, zone);
 }
 
@@ -71,8 +70,7 @@ CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info,
       shared_info_(shared_info),
       script_(Handle<Script>(Script::cast(shared_info->script()))),
       osr_ast_id_(BailoutId::None()),
-      osr_pc_offset_(0),
-      parameter_count_(0) {
+      osr_pc_offset_(0) {
   Initialize(script_->GetIsolate(), BASE, zone);
 }
 
@@ -85,8 +83,7 @@ CompilationInfo::CompilationInfo(Handle<JSFunction> closure,
       script_(Handle<Script>(Script::cast(shared_info_->script()))),
       context_(closure->context()),
       osr_ast_id_(BailoutId::None()),
-      osr_pc_offset_(0),
-      parameter_count_(0) {
+      osr_pc_offset_(0) {
   Initialize(script_->GetIsolate(), BASE, zone);
 }
 
@@ -97,8 +94,7 @@ CompilationInfo::CompilationInfo(HydrogenCodeStub* stub,
     : flags_(LanguageModeField::encode(CLASSIC_MODE) |
              IsLazy::encode(true)),
       osr_ast_id_(BailoutId::None()),
-      osr_pc_offset_(0),
-      parameter_count_(0) {
+      osr_pc_offset_(0) {
   Initialize(isolate, STUB, zone);
   code_stub_ = stub;
 }
@@ -188,12 +184,8 @@ void CompilationInfo::RollbackDependencies() {
 
 
 int CompilationInfo::num_parameters() const {
-  if (IsStub()) {
-    ASSERT(parameter_count_ > 0);
-    return parameter_count_;
-  } else {
-    return scope()->num_parameters();
-  }
+  ASSERT(!IsStub());
+  return scope()->num_parameters();
 }
 
 
index 5ebcfd97cb1c40457f6a43c5b4c14b256a782da9..2d9e52a8e3e23de7e30c25f766cb43b58aec5b39 100644 (file)
@@ -98,10 +98,6 @@ class CompilationInfo {
     ASSERT(!is_lazy());
     flags_ |= IsGlobal::encode(true);
   }
-  void set_parameter_count(int parameter_count) {
-    ASSERT(IsStub());
-    parameter_count_ = parameter_count;
-  }
   void SetLanguageMode(LanguageMode language_mode) {
     ASSERT(this->language_mode() == CLASSIC_MODE ||
            this->language_mode() == language_mode ||
@@ -446,9 +442,6 @@ class CompilationInfo {
   // during graph optimization.
   int opt_count_;
 
-  // Number of parameters used for compilation of stubs that require arguments.
-  int parameter_count_;
-
   Handle<Foreign> object_wrapper_;
 
   DISALLOW_COPY_AND_ASSIGN(CompilationInfo);
index 2f4d7dc79e0c1b0ec996447d6d13d18be5394032..ef4e39e8c2b1e143adeea7f8687cb0392ab5791b 100644 (file)
@@ -1465,9 +1465,8 @@ void Deoptimizer::DoComputeCompiledStubFrame(TranslationIterator* iterator,
   int output_frame_size = height_in_bytes + fixed_frame_size;
   if (trace_scope_ != NULL) {
     PrintF(trace_scope_->file(),
-           "  translating %s => StubFailure%sTrampolineStub, height=%d\n",
+           "  translating %s => StubFailureTrampolineStub, height=%d\n",
            CodeStub::MajorName(static_cast<CodeStub::Major>(major_key), false),
-           descriptor->HasTailCallContinuation() ? "TailCall" : "",
            height_in_bytes);
   }
 
@@ -1539,8 +1538,7 @@ void Deoptimizer::DoComputeCompiledStubFrame(TranslationIterator* iterator,
            top_address + output_frame_offset, output_frame_offset, value);
   }
 
-  intptr_t caller_arg_count = descriptor->HasTailCallContinuation()
-      ? compiled_code_->arguments_count() + 1 : 0;
+  intptr_t caller_arg_count = 0;
   bool arg_count_known = !descriptor->stack_parameter_count_.is_valid();
 
   // Build the Arguments object for the caller's parameters and a pointer to it.
@@ -1636,13 +1634,9 @@ void Deoptimizer::DoComputeCompiledStubFrame(TranslationIterator* iterator,
 
   // Compute this frame's PC, state, and continuation.
   Code* trampoline = NULL;
-  if (descriptor->HasTailCallContinuation()) {
-    StubFailureTailCallTrampolineStub().FindCodeInCache(&trampoline, isolate_);
-  } else {
-    StubFunctionMode function_mode = descriptor->function_mode_;
-    StubFailureTrampolineStub(function_mode).FindCodeInCache(&trampoline,
-                                                             isolate_);
-  }
+  StubFunctionMode function_mode = descriptor->function_mode_;
+  StubFailureTrampolineStub(function_mode).FindCodeInCache(&trampoline,
+                                                           isolate_);
   ASSERT(trampoline != NULL);
   output_frame->SetPc(reinterpret_cast<intptr_t>(
       trampoline->instruction_start()));
index 4abacad9ef9f72ed80cfd2e3fddc088b52647208..167277f799617974fdd08c84e7fc71a0f5005610 100644 (file)
@@ -1401,11 +1401,6 @@ Code* StubFailureTrampolineFrame::unchecked_code() const {
     return trampoline;
   }
 
-  StubFailureTailCallTrampolineStub().FindCodeInCache(&trampoline, isolate());
-  if (trampoline->contains(pc())) {
-    return trampoline;
-  }
-
   UNREACHABLE();
   return NULL;
 }
index 3283c95648ee8ee87ca07cff5ff936ec0284fbdc..e77d8d5454977cd42f96016db61ac2af1220a444 100644 (file)
@@ -3115,12 +3115,6 @@ void Heap::CreateFixedStubs() {
 }
 
 
-void Heap::CreateStubsRequiringBuiltins() {
-  HandleScope scope(isolate());
-  CodeStub::GenerateStubsRequiringBuiltinsAheadOfTime(isolate());
-}
-
-
 bool Heap::CreateInitialObjects() {
   Object* obj;
 
index 7e2eda2529cdd42e2eed94127c5421f46f0c019b..a0c85e5c7728e6df8dfbe6720a7070b0d5c85a93 100644 (file)
@@ -2124,7 +2124,6 @@ class Heap {
   NO_INLINE(void CreateJSConstructEntryStub());
 
   void CreateFixedStubs();
-  void CreateStubsRequiringBuiltins();
 
   MUST_USE_RESULT MaybeObject* CreateOddball(const char* to_string,
                                              Object* to_number,
index adf088d61ce3d72ce0e52634269165cf49bf58cf..9bd0b90b4c3b55b0b958cfeb0ee4b59e7dd52a42 100644 (file)
@@ -2289,38 +2289,19 @@ class HCallNamed V8_FINAL : public HUnaryCall {
 };
 
 
-enum CallMode {
-  NORMAL_CALL,
-  TAIL_CALL
-};
-
-
 class HCallFunction V8_FINAL : public HBinaryCall {
  public:
   DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallFunction, HValue*, int);
-  DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(
-      HCallFunction, HValue*, int, CallMode);
-
-  bool IsTailCall() const { return call_mode_ == TAIL_CALL; }
 
   HValue* context() { return first(); }
   HValue* function() { return second(); }
 
   DECLARE_CONCRETE_INSTRUCTION(CallFunction)
 
-  virtual int argument_delta() const V8_OVERRIDE {
-    if (IsTailCall()) return 0;
-    return -argument_count();
-  }
-
  private:
-  HCallFunction(HValue* context,
-                HValue* function,
-                int argument_count,
-                CallMode mode = NORMAL_CALL)
-      : HBinaryCall(context, function, argument_count), call_mode_(mode) {
+  HCallFunction(HValue* context, HValue* function, int argument_count)
+      : HBinaryCall(context, function, argument_count) {
   }
-  CallMode call_mode_;
 };
 
 
@@ -7202,8 +7183,6 @@ class HCheckMapValue V8_FINAL : public HTemplateInstruction<2> {
   DECLARE_CONCRETE_INSTRUCTION(CheckMapValue)
 
  protected:
-  virtual int RedefinedOperandIndex() { return 0; }
-
   virtual bool DataEquals(HValue* other) V8_OVERRIDE {
     return true;
   }
index d5b42a28c957c057cddfb525efa8d7e7781ee841..b47ec8010d25d10a76a1b203fa4bde3e5f39ba01 100644 (file)
@@ -2426,7 +2426,7 @@ HValue* HGraphBuilder::JSArrayBuilder::EmitMapCode() {
     return builder()->Add<HConstant>(map);
   }
 
-  if (constructor_function_ != NULL && kind_ == GetInitialFastElementsKind()) {
+  if (kind_ == GetInitialFastElementsKind()) {
     // No need for a context lookup if the kind_ matches the initial
     // map, because we can just load the map in that case.
     HObjectAccess access = HObjectAccess::ForPrototypeOrInitialMap();
@@ -7404,30 +7404,18 @@ void HOptimizedGraphBuilder::VisitCall(Call* expr) {
   if (prop != NULL) {
     if (!prop->key()->IsPropertyName()) {
       // Keyed function call.
-      CHECK_ALIVE(VisitForValue(prop->obj()));
-      CHECK_ALIVE(VisitForValue(prop->key()));
+      CHECK_ALIVE(VisitArgument(prop->obj()));
 
+      CHECK_ALIVE(VisitForValue(prop->key()));
       // Push receiver and key like the non-optimized code generator expects it.
       HValue* key = Pop();
       HValue* receiver = Pop();
       Push(key);
-      Push(Add<HPushArgument>(receiver));
-      CHECK_ALIVE(VisitArgumentList(expr->arguments()));
-
-      if (expr->IsMonomorphic()) {
-        BuildCheckHeapObject(receiver);
-        ElementsKind kind = expr->KeyedArrayCallIsHoley()
-            ? FAST_HOLEY_ELEMENTS : FAST_ELEMENTS;
-
-        Handle<Map> map(isolate()->get_initial_js_array_map(kind));
+      Push(receiver);
 
-        HValue* function = BuildMonomorphicElementAccess(
-            receiver, key, NULL, NULL, map, false, STANDARD_STORE);
+      CHECK_ALIVE(VisitArgumentList(expr->arguments()));
 
-        call = New<HCallFunction>(function, argument_count);
-      } else {
-        call = New<HCallKeyed>(key, argument_count);
-      }
+      call = New<HCallKeyed>(key, argument_count);
       Drop(argument_count + 1);  // 1 is the key.
       return ast_context()->ReturnInstruction(call, expr->id());
     }
index 0e742f90ffacc5e9da3274a6da3eb28802867799..7987a97a51dd8eb221cd39871164ecd289bd28de 100644 (file)
@@ -1583,7 +1583,7 @@ class HGraphBuilder {
 
     JSArrayBuilder(HGraphBuilder* builder,
                    ElementsKind kind,
-                   HValue* constructor_function = NULL);
+                   HValue* constructor_function);
 
     enum FillMode {
       DONT_FILL_WITH_HOLE,
@@ -1596,7 +1596,6 @@ class HGraphBuilder {
     HValue* AllocateArray(HValue* capacity, HValue* length_field,
                           FillMode fill_mode = FILL_WITH_HOLE);
     HValue* GetElementsLocation() { return elements_location_; }
-    HValue* EmitMapCode();
 
    private:
     Zone* zone() const { return builder_->zone(); }
@@ -1610,6 +1609,7 @@ class HGraphBuilder {
       return JSArray::kPreallocatedArrayElements;
     }
 
+    HValue* EmitMapCode();
     HValue* EmitInternalMapCode();
     HValue* EstablishEmptyArrayAllocationSize();
     HValue* EstablishAllocationSize(HValue* length_node);
index f3de5fd8b18d3b74e02c3ccafb746deefc08ecf4..a1aa0220200d4309716ba5e6af46577036e180da 100644 (file)
@@ -138,19 +138,6 @@ void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
 }
 
 
-void KeyedArrayCallStub::InitializeInterfaceDescriptor(
-    Isolate* isolate,
-    CodeStubInterfaceDescriptor* descriptor) {
-  static Register registers[] = { ecx };
-  descriptor->register_param_count_ = 1;
-  descriptor->register_params_ = registers;
-  descriptor->continuation_type_ = TAIL_CALL_CONTINUATION;
-  descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
-  descriptor->deoptimization_handler_ =
-      FUNCTION_ADDR(KeyedCallIC_MissFromStubFailure);
-}
-
-
 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
     Isolate* isolate,
     CodeStubInterfaceDescriptor* descriptor) {
@@ -5672,24 +5659,6 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
 }
 
 
-void StubFailureTailCallTrampolineStub::Generate(MacroAssembler* masm) {
-  CEntryStub ces(1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs);
-  __ call(ces.GetCode(masm->isolate()), RelocInfo::CODE_TARGET);
-  __ mov(edi, eax);
-  int parameter_count_offset =
-      StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
-  __ mov(eax, MemOperand(ebp, parameter_count_offset));
-  // The parameter count above includes the receiver for the arguments passed to
-  // the deoptimization handler. Subtract the receiver for the parameter count
-  // for the call.
-  __ sub(eax, Immediate(1));
-  masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
-  ParameterCount argument_count(eax);
-  __ InvokeFunction(
-      edi, argument_count, JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD);
-}
-
-
 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
   if (masm->isolate()->function_entry_hook() != NULL) {
     // It's always safe to call the entry hook stub, as the hook itself
index e6b1c8f533bd4fdb4d5442c21cd04a9dce34570f..de52fadda939f9e5c93be34d664355dab12ec445 100644 (file)
@@ -781,36 +781,17 @@ bool LCodeGen::IsSmi(LConstantOperand* op) const {
 }
 
 
-static int ArgumentsOffsetWithoutFrame(int index) {
-  ASSERT(index < 0);
-  return -(index + 1) * kPointerSize + kPCOnStackSize;
-}
-
-
 Operand LCodeGen::ToOperand(LOperand* op) const {
   if (op->IsRegister()) return Operand(ToRegister(op));
   if (op->IsDoubleRegister()) return Operand(ToDoubleRegister(op));
   ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot());
-  if (NeedsEagerFrame()) {
-    return Operand(ebp, StackSlotOffset(op->index()));
-  } else {
-    // Retrieve parameter without eager stack-frame relative to the
-    // stack-pointer.
-    return Operand(esp, ArgumentsOffsetWithoutFrame(op->index()));
-  }
+  return Operand(ebp, StackSlotOffset(op->index()));
 }
 
 
 Operand LCodeGen::HighOperand(LOperand* op) {
   ASSERT(op->IsDoubleStackSlot());
-  if (NeedsEagerFrame()) {
-    return Operand(ebp, StackSlotOffset(op->index()) + kPointerSize);
-  } else {
-    // Retrieve parameter without eager stack-frame relative to the
-    // stack-pointer.
-    return Operand(
-        esp, ArgumentsOffsetWithoutFrame(op->index()) + kPointerSize);
-  }
+  return Operand(ebp, StackSlotOffset(op->index()) + kPointerSize);
 }
 
 
@@ -4395,12 +4376,7 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) {
 
   int arity = instr->arity();
   CallFunctionStub stub(arity, NO_CALL_FUNCTION_FLAGS);
-  if (instr->hydrogen()->IsTailCall()) {
-    if (NeedsEagerFrame()) __ leave();
-    __ jmp(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
-  } else {
-    CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
-  }
+  CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
 }
 
 
index 278d60030464f8ba83de548fcc6196ed7cb11342..29b42fe0ffc7d1377e9d616fff8e7b8b2ab2275d 100644 (file)
@@ -1410,10 +1410,8 @@ LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) {
 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) {
   LOperand* context = UseFixed(instr->context(), esi);
   LOperand* function = UseFixed(instr->function(), edi);
-  LCallFunction* call = new(zone()) LCallFunction(context, function);
-  LInstruction* result = DefineFixed(call, eax);
-  if (instr->IsTailCall()) return result;
-  return MarkAsCall(result, instr);
+  LCallFunction* result = new(zone()) LCallFunction(context, function);
+  return MarkAsCall(DefineFixed(result, eax), instr);
 }
 
 
index de137985a86efff463e4462f2a6ae0ac320276c9..640b188ab23bb1b62b59b5f9458ea6b811660f4e 100644 (file)
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -804,34 +804,16 @@ MaybeObject* KeyedCallIC::LoadFunction(Handle<Object> object,
   if (use_ic && state() != MEGAMORPHIC) {
     ASSERT(!object->IsJSGlobalProxy());
     int argc = target()->arguments_count();
-    Handle<Code> stub;
-
-    // Use the KeyedArrayCallStub if the call is of the form array[smi](...),
-    // where array is an instance of one of the initial array maps (without
-    // extra named properties).
-    // TODO(verwaest): Also support keyed calls on instances of other maps.
-    if (object->IsJSArray() && key->IsSmi()) {
-      Handle<JSArray> array = Handle<JSArray>::cast(object);
-      ElementsKind kind = array->map()->elements_kind();
-      if (IsFastObjectElementsKind(kind) &&
-          array->map() == isolate()->get_initial_js_array_map(kind)) {
-        KeyedArrayCallStub stub_gen(IsHoleyElementsKind(kind), argc);
-        stub = stub_gen.GetCode(isolate());
-      }
-    }
-
-    if (stub.is_null()) {
-      stub = isolate()->stub_cache()->ComputeCallMegamorphic(
-          argc, Code::KEYED_CALL_IC, Code::kNoExtraICState);
-      if (object->IsJSObject()) {
-        Handle<JSObject> receiver = Handle<JSObject>::cast(object);
-        if (receiver->elements()->map() ==
-            isolate()->heap()->non_strict_arguments_elements_map()) {
-          stub = isolate()->stub_cache()->ComputeCallArguments(argc);
-        }
+    Handle<Code> stub = isolate()->stub_cache()->ComputeCallMegamorphic(
+        argc, Code::KEYED_CALL_IC, Code::kNoExtraICState);
+    if (object->IsJSObject()) {
+      Handle<JSObject> receiver = Handle<JSObject>::cast(object);
+      if (receiver->elements()->map() ==
+          isolate()->heap()->non_strict_arguments_elements_map()) {
+        stub = isolate()->stub_cache()->ComputeCallArguments(argc);
       }
-      ASSERT(!stub.is_null());
     }
+    ASSERT(!stub.is_null());
     set_target(*stub);
     TRACE_IC("CallIC", key);
   }
@@ -2140,28 +2122,6 @@ RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure) {
 }
 
 
-RUNTIME_FUNCTION(MaybeObject*, KeyedCallIC_MissFromStubFailure) {
-  HandleScope scope(isolate);
-  ASSERT(args.length() == 2);
-  KeyedCallIC ic(isolate);
-  Arguments* caller_args = reinterpret_cast<Arguments*>(args[0]);
-  Handle<Object> key = args.at<Object>(1);
-  Handle<Object> receiver((*caller_args)[0], isolate);
-
-  ic.UpdateState(receiver, key);
-  MaybeObject* maybe_result = ic.LoadFunction(receiver, key);
-  // Result could be a function or a failure.
-  JSFunction* raw_function = NULL;
-  if (!maybe_result->To(&raw_function)) return maybe_result;
-
-  if (raw_function->is_compiled()) return raw_function;
-
-  Handle<JSFunction> function(raw_function, isolate);
-  JSFunction::CompileLazy(function, CLEAR_EXCEPTION);
-  return *function;
-}
-
-
 RUNTIME_FUNCTION(MaybeObject*, StoreIC_ArrayLength) {
   SealHandleScope shs(isolate);
 
index 630c7ea976ce06f050a7f0bf2d6633aa610edc53..fde4bc77a58f915c7d2772e75218c15c373eec85 100644 (file)
--- a/src/ic.h
+++ b/src/ic.h
@@ -886,7 +886,6 @@ DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure);
 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure);
 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss);
 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure);
-DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedCallIC_MissFromStubFailure);
 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss);
 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss);
 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss);
index 07bb2ae5300f192e65f973482a0684429f48501c..740cce00476a3ab66ea35fbf48e411f7bbc06da2 100644 (file)
@@ -2238,8 +2238,6 @@ bool Isolate::Init(Deserializer* des) {
   bootstrapper_->Initialize(create_heap_objects);
   builtins_.SetUp(this, create_heap_objects);
 
-  if (create_heap_objects) heap_.CreateStubsRequiringBuiltins();
-
   // Only preallocate on the first initialization.
   if (FLAG_preallocate_message_memory && preallocated_message_space_ == NULL) {
     // Start the thread which will set aside some memory.
@@ -2316,7 +2314,6 @@ bool Isolate::Init(Deserializer* des) {
     CodeStub::GenerateFPStubs(this);
     StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(this);
     StubFailureTrampolineStub::GenerateAheadOfTime(this);
-    StubFailureTailCallTrampolineStub::GenerateAheadOfTime(this);
     // TODO(mstarzinger): The following is an ugly hack to make sure the
     // interface descriptor is initialized even when stubs have been
     // deserialized out of the snapshot without the graph builder.
index 432e81b80be6a4d00f8de6b819a86a85534cb53d..966afa9c0b881f16d5c69b5748250707d5dd1d84 100644 (file)
@@ -372,8 +372,7 @@ int LChunk::GetParameterStackSlot(int index) const {
   // shift all parameter indexes down by the number of parameters, and
   // make sure they end up negative so they are distinguishable from
   // spill slots.
-  int result = index - info()->num_parameters() - 1;
-
+  int result = index - info()->scope()->num_parameters() - 1;
   ASSERT(result < 0);
   return result;
 }
index ff25ca255aa3142941190b6861d0137d5d267fe8..5014c91e1352bc1ded9f1eba4d90f70a375252cf 100644 (file)
@@ -3904,7 +3904,6 @@ int Code::major_key() {
          kind() == STORE_IC ||
          kind() == LOAD_IC ||
          kind() == KEYED_LOAD_IC ||
-         kind() == KEYED_CALL_IC ||
          kind() == TO_BOOLEAN_IC);
   return StubMajorKeyField::decode(
       READ_UINT32_FIELD(this, kKindSpecificFlags2Offset));
@@ -3921,7 +3920,6 @@ void Code::set_major_key(int major) {
          kind() == KEYED_LOAD_IC ||
          kind() == STORE_IC ||
          kind() == KEYED_STORE_IC ||
-         kind() == KEYED_CALL_IC ||
          kind() == TO_BOOLEAN_IC);
   ASSERT(0 <= major && major < 256);
   int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
index 7a7f992cd9a61b8300664a282029954381b84f48..65d1364058eaf672d99a583480028a37d4da6030 100644 (file)
@@ -200,15 +200,7 @@ bool TypeFeedbackOracle::StoreIsKeyedPolymorphic(TypeFeedbackId ast_id) {
 bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) {
   Handle<Object> value = GetInfo(expr->CallFeedbackId());
   return value->IsMap() || value->IsAllocationSite() || value->IsJSFunction() ||
-      value->IsSmi() ||
-      (value->IsCode() && Handle<Code>::cast(value)->ic_state() == MONOMORPHIC);
-}
-
-
-bool TypeFeedbackOracle::KeyedArrayCallIsHoley(Call* expr) {
-  Handle<Object> value = GetInfo(expr->CallFeedbackId());
-  Handle<Code> code = Handle<Code>::cast(value);
-  return KeyedArrayCallStub::IsHoley(code);
+      value->IsSmi();
 }
 
 
@@ -628,6 +620,7 @@ void TypeFeedbackOracle::ProcessRelocInfos(ZoneList<RelocInfo>* infos) {
       case Code::LOAD_IC:
       case Code::STORE_IC:
       case Code::CALL_IC:
+      case Code::KEYED_CALL_IC:
         if (target->ic_state() == MONOMORPHIC) {
           if (target->kind() == Code::CALL_IC &&
               target->check_type() != RECEIVER_MAP_CHECK) {
@@ -647,7 +640,6 @@ void TypeFeedbackOracle::ProcessRelocInfos(ZoneList<RelocInfo>* infos) {
         }
         break;
 
-      case Code::KEYED_CALL_IC:
       case Code::KEYED_LOAD_IC:
       case Code::KEYED_STORE_IC:
       case Code::BINARY_OP_IC:
index a116971051eba074c2fe4b0f656bf74169140d4c..f295c06dac7feaa52a91a88c031bb755098b3ef3 100644 (file)
@@ -250,7 +250,6 @@ class TypeFeedbackOracle: public ZoneObject {
   bool StoreIsPreMonomorphic(TypeFeedbackId ast_id);
   bool StoreIsKeyedPolymorphic(TypeFeedbackId ast_id);
   bool CallIsMonomorphic(Call* expr);
-  bool KeyedArrayCallIsHoley(Call* expr);
   bool CallNewIsMonomorphic(CallNew* expr);
   bool ObjectLiteralStoreIsMonomorphic(ObjectLiteralProperty* prop);
 
index 84f596859d76d48892d9cc4a976e8e6165439316..03c1ad16ef853a25a5b5a363ccf857dcd3ae55ae 100644 (file)
@@ -450,7 +450,8 @@ void AstTyper::VisitCall(Call* expr) {
   Expression* callee = expr->expression();
   Property* prop = callee->AsProperty();
   if (prop != NULL) {
-    expr->RecordTypeFeedback(oracle(), CALL_AS_METHOD);
+    if (prop->key()->IsPropertyName())
+      expr->RecordTypeFeedback(oracle(), CALL_AS_METHOD);
   } else {
     expr->RecordTypeFeedback(oracle(), CALL_AS_FUNCTION);
   }
index 425fdb50152411acb307337399c9ddab22a96eb1..4ccda2df8b1e2040c73a8fbe858677ad64f1911f 100644 (file)
@@ -134,19 +134,6 @@ void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
 }
 
 
-void KeyedArrayCallStub::InitializeInterfaceDescriptor(
-    Isolate* isolate,
-    CodeStubInterfaceDescriptor* descriptor) {
-  static Register registers[] = { rcx };
-  descriptor->register_param_count_ = 1;
-  descriptor->register_params_ = registers;
-  descriptor->continuation_type_ = TAIL_CALL_CONTINUATION;
-  descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
-  descriptor->deoptimization_handler_ =
-      FUNCTION_ADDR(KeyedCallIC_MissFromStubFailure);
-}
-
-
 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
     Isolate* isolate,
     CodeStubInterfaceDescriptor* descriptor) {
@@ -5471,24 +5458,6 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
 }
 
 
-void StubFailureTailCallTrampolineStub::Generate(MacroAssembler* masm) {
-  CEntryStub ces(1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs);
-  __ Call(ces.GetCode(masm->isolate()), RelocInfo::CODE_TARGET);
-  __ movq(rdi, rax);
-  int parameter_count_offset =
-      StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
-  __ movq(rax, MemOperand(rbp, parameter_count_offset));
-  // The parameter count above includes the receiver for the arguments passed to
-  // the deoptimization handler. Subtract the receiver for the parameter count
-  // for the call.
-  __ subl(rax, Immediate(1));
-  masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
-  ParameterCount argument_count(rax);
-  __ InvokeFunction(
-      rdi, argument_count, JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD);
-}
-
-
 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
   if (masm->isolate()->function_entry_hook() != NULL) {
     // It's always safe to call the entry hook stub, as the hook itself
index 242f7493401e86cb96bf214a2dde9eb071e52268..dc6ddf9f7e41595e10b58c033e04fdc4cd958e93 100644 (file)
@@ -415,23 +415,11 @@ Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const {
 }
 
 
-static int ArgumentsOffsetWithoutFrame(int index) {
-  ASSERT(index < 0);
-  return -(index + 1) * kPointerSize + kPCOnStackSize;
-}
-
-
 Operand LCodeGen::ToOperand(LOperand* op) const {
   // Does not handle registers. In X64 assembler, plain registers are not
   // representable as an Operand.
   ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot());
-  if (NeedsEagerFrame()) {
-    return Operand(rbp, StackSlotOffset(op->index()));
-  } else {
-    // Retrieve parameter without eager stack-frame relative to the
-    // stack-pointer.
-    return Operand(rsp, ArgumentsOffsetWithoutFrame(op->index()));
-  }
+  return Operand(rbp, StackSlotOffset(op->index()));
 }
 
 
@@ -3922,12 +3910,7 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) {
 
   int arity = instr->arity();
   CallFunctionStub stub(arity, NO_CALL_FUNCTION_FLAGS);
-  if (instr->hydrogen()->IsTailCall()) {
-    if (NeedsEagerFrame()) __ leave();
-    __ jmp(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
-  } else {
-    CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
-  }
+  CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
 }
 
 
index c4cb64289aaf9dd02cabe793a5cbb2c4c1004020..a1216466df133c9a45c992d78cd3c3a981521c94 100644 (file)
@@ -1323,10 +1323,8 @@ LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) {
 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) {
   LOperand* context = UseFixed(instr->context(), rsi);
   LOperand* function = UseFixed(instr->function(), rdi);
-  LCallFunction* call = new(zone()) LCallFunction(context, function);
-  LInstruction* result = DefineFixed(call, rax);
-  if (instr->IsTailCall()) return result;
-  return MarkAsCall(result, instr);
+  LCallFunction* result = new(zone()) LCallFunction(context, function);
+  return MarkAsCall(DefineFixed(result, rax), instr);
 }
 
 
diff --git a/test/mjsunit/keyed-array-call.js b/test/mjsunit/keyed-array-call.js
deleted file mode 100644 (file)
index b97da3c..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-//       copyright notice, this list of conditions and the following
-//       disclaimer in the documentation and/or other materials provided
-//       with the distribution.
-//     * Neither the name of Google Inc. nor the names of its
-//       contributors may be used to endorse or promote products derived
-//       from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-var a = [function(a) { return a+10; },
-         function(a) { return a+20; }];
-a.__proto__.test = function(a) { return a+30; }
-function f(i) {
-  return "r" + (1, a[i](i+1), a[i](i+2));
-}
-
-assertEquals("r12", f(0));
-assertEquals("r12", f(0));
-assertEquals("r23", f(1));
-assertEquals("r23", f(1));
-
-// Deopt the stub.
-assertEquals("rtest230", f("test"));
-
-var a2 = [function(a) { return a+10; },,
-          function(a) { return a+20; }];
-a2.__proto__.test = function(a) { return a+30; }
-function f2(i) {
-  return "r" + (1, a2[i](i+1), a2[i](i+2));
-}
-
-assertEquals("r12", f2(0));
-assertEquals("r12", f2(0));
-assertEquals("r24", f2(2));
-assertEquals("r24", f2(2));
-
-// Deopt the stub. This will throw given that undefined is not a function.
-assertThrows(function() { f2(1) });