diff options
author | Ali Ijaz Sheikh <ofrobots@google.com> | 2016-04-07 14:06:55 -0700 |
---|---|---|
committer | Ali Ijaz Sheikh <ofrobots@google.com> | 2016-04-14 10:03:39 -0700 |
commit | 52af5c4eebf4de8638aef0338bd826656312a02a (patch) | |
tree | 628dc9fb0b558c3a73a2160706fef368876fe548 /deps/v8/src/ic | |
parent | 6e3e8acc7cc7ebd3d67db5ade1247b8b558efe09 (diff) | |
download | android-node-v8-52af5c4eebf4de8638aef0338bd826656312a02a.tar.gz android-node-v8-52af5c4eebf4de8638aef0338bd826656312a02a.tar.bz2 android-node-v8-52af5c4eebf4de8638aef0338bd826656312a02a.zip |
deps: upgrade V8 to 5.0.71.32
* Pick up the branch head for V8 5.0 stable [1]
* Edit v8 gitignore to allow trace_event copy
* Update V8 DEP trace_event as per deps/v8/DEPS [2]
[1] https://chromium.googlesource.com/v8/v8.git/+/3c67831
[2] https://chromium.googlesource.com/chromium/src/base/trace_event/common/+/4b09207e447ae5bd34643b4c6321bee7b76d35f9
Ref: https://github.com/nodejs/node/pull/5945
PR-URL: https://github.com/nodejs/node/pull/6111
Reviewed-By: targos - Michaƫl Zasso <mic.besace@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
Diffstat (limited to 'deps/v8/src/ic')
28 files changed, 798 insertions, 966 deletions
diff --git a/deps/v8/src/ic/arm/handler-compiler-arm.cc b/deps/v8/src/ic/arm/handler-compiler-arm.cc index e293965e6f..5f2b861d08 100644 --- a/deps/v8/src/ic/arm/handler-compiler-arm.cc +++ b/deps/v8/src/ic/arm/handler-compiler-arm.cc @@ -4,8 +4,10 @@ #if V8_TARGET_ARCH_ARM -#include "src/ic/call-optimization.h" #include "src/ic/handler-compiler.h" + +#include "src/field-type.h" +#include "src/ic/call-optimization.h" #include "src/ic/ic.h" #include "src/isolate-inl.h" @@ -286,11 +288,17 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( call_data_undefined = true; __ LoadRoot(data, Heap::kUndefinedValueRootIndex); } else { - __ ldr(data, - FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); - __ ldr(data, - FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); - __ ldr(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + if (optimization.is_constant_call()) { + __ ldr(data, + FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); + __ ldr(data, + FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); + __ ldr(data, + FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + } else { + __ ldr(data, + FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); + } __ ldr(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); } @@ -309,7 +317,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( __ mov(api_function_address, Operand(ref)); // Jump to stub. - CallApiAccessorStub stub(isolate, is_store, call_data_undefined); + CallApiAccessorStub stub(isolate, is_store, call_data_undefined, + !optimization.is_constant_call()); __ TailCallStub(&stub); } @@ -394,8 +403,7 @@ void NamedStoreHandlerCompiler::GenerateConstantCheck(Register map_reg, __ b(ne, miss_label); } - -void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, +void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, Register value_reg, Label* miss_label) { Register map_reg = scratch1(); @@ -403,20 +411,11 @@ void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, DCHECK(!value_reg.is(map_reg)); DCHECK(!value_reg.is(scratch)); __ JumpIfSmi(value_reg, miss_label); - HeapType::Iterator<Map> it = field_type->Classes(); - if (!it.Done()) { + if (field_type->IsClass()) { __ ldr(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); - Label do_store; - while (true) { - __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); - it.Advance(); - if (it.Done()) { - __ b(ne, miss_label); - break; - } - __ b(eq, &do_store); - } - __ bind(&do_store); + __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), + scratch); + __ b(ne, miss_label); } } @@ -594,38 +593,39 @@ void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { void NamedLoadHandlerCompiler::GenerateLoadCallback( - Register reg, Handle<ExecutableAccessorInfo> callback) { - // Build AccessorInfo::args_ list on the stack and push property name below - // the exit frame to make GC aware of them and store pointers to them. - STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0); - STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 1); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 2); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 3); - STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4); - STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5); - STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 6); - DCHECK(!scratch2().is(reg)); - DCHECK(!scratch3().is(reg)); - DCHECK(!scratch4().is(reg)); + Register reg, Handle<AccessorInfo> callback) { + DCHECK(!AreAliased(scratch2(), scratch3(), scratch4(), receiver())); + DCHECK(!AreAliased(scratch2(), scratch3(), scratch4(), reg)); + + // Build v8::PropertyCallbackInfo::args_ array on the stack and push property + // name below the exit frame to make GC aware of them. + STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0); + STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1); + STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4); + STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5); + STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6); + STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7); + __ push(receiver()); - // Push data from ExecutableAccessorInfo. + // Push data from AccessorInfo. Handle<Object> data(callback->data(), isolate()); if (data->IsUndefined() || data->IsSmi()) { - __ Move(scratch3(), data); + __ Move(scratch2(), data); } else { Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(Handle<HeapObject>::cast(data)); // The callback is alive if this instruction is executed, // so the weak cell is not cleared and points to data. - __ GetWeakValue(scratch3(), cell); + __ GetWeakValue(scratch2(), cell); } - __ push(scratch3()); - __ LoadRoot(scratch3(), Heap::kUndefinedValueRootIndex); - __ mov(scratch4(), scratch3()); - __ Push(scratch3(), scratch4()); - __ mov(scratch4(), Operand(ExternalReference::isolate_address(isolate()))); - __ Push(scratch4(), reg); - __ mov(scratch2(), sp); // scratch2 = PropertyAccessorInfo::args_ + __ push(scratch2()); + __ LoadRoot(scratch2(), Heap::kUndefinedValueRootIndex); + __ Push(scratch2(), scratch2()); + __ mov(scratch2(), Operand(ExternalReference::isolate_address(isolate()))); + __ Push(scratch2(), reg); + __ Push(Smi::FromInt(0)); // should_throw_on_error -> false __ push(name()); // Abi for CallApiGetter @@ -714,8 +714,8 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( - Handle<JSObject> object, Handle<Name> name, - Handle<ExecutableAccessorInfo> callback) { + Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, + LanguageMode language_mode) { Register holder_reg = Frontend(name); __ push(receiver()); // receiver @@ -732,6 +732,7 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( __ push(ip); __ mov(ip, Operand(name)); __ Push(ip, value()); + __ Push(Smi::FromInt(language_mode)); // Do tail-call to the runtime system. __ TailCallRuntime(Runtime::kStoreCallbackProperty); @@ -780,7 +781,7 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( } Counters* counters = isolate()->counters(); - __ IncrementCounter(counters->named_load_global_stub(), 1, r1, r3); + __ IncrementCounter(counters->ic_named_load_global_stub(), 1, r1, r3); if (IC::ICUseVector(kind())) { DiscardVectorAndSlot(); } diff --git a/deps/v8/src/ic/arm/ic-arm.cc b/deps/v8/src/ic/arm/ic-arm.cc index f59ac074be..14ed8b41a5 100644 --- a/deps/v8/src/ic/arm/ic-arm.cc +++ b/deps/v8/src/ic/arm/ic-arm.cc @@ -157,8 +157,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm, static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, Register key, Register elements, Register scratch1, Register scratch2, - Register result, Label* slow, - LanguageMode language_mode) { + Register result, Label* slow) { // Register use: // // receiver - holds the receiver on entry. @@ -215,13 +214,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, __ jmp(&check_next_prototype); __ bind(&absent); - if (is_strong(language_mode)) { - // Strong mode accesses must throw in this case, so call the runtime. - __ jmp(slow); - } else { - __ LoadRoot(result, Heap::kUndefinedValueRootIndex); - __ jmp(&done); - } + __ LoadRoot(result, Heap::kUndefinedValueRootIndex); + __ jmp(&done); __ bind(&in_bounds); // Fast case: Do the load. @@ -264,8 +258,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key, __ bind(&unique); } - -void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { +void LoadIC::GenerateNormal(MacroAssembler* masm) { Register dictionary = r0; DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); @@ -280,7 +273,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { // Dictionary load failed, go slow (but don't miss). __ bind(&slow); - GenerateRuntimeGetProperty(masm, language_mode); + GenerateRuntimeGetProperty(masm); } @@ -304,7 +297,7 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { DCHECK(!AreAliased(r4, r5, LoadWithVectorDescriptor::SlotRegister(), LoadWithVectorDescriptor::VectorRegister())); - __ IncrementCounter(isolate->counters()->load_miss(), 1, r4, r5); + __ IncrementCounter(isolate->counters()->ic_load_miss(), 1, r4, r5); LoadIC_PushArgs(masm); @@ -312,17 +305,14 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kLoadIC_Miss); } - -void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is in lr. __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong - : Runtime::kGetProperty); + __ TailCallRuntime(Runtime::kGetProperty); } @@ -332,7 +322,7 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { DCHECK(!AreAliased(r4, r5, LoadWithVectorDescriptor::SlotRegister(), LoadWithVectorDescriptor::VectorRegister())); - __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r4, r5); + __ IncrementCounter(isolate->counters()->ic_keyed_load_miss(), 1, r4, r5); LoadIC_PushArgs(masm); @@ -340,22 +330,17 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); } - -void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is in lr. __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); // Perform tail call to the entry. // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong - : Runtime::kKeyedGetProperty); + __ TailCallRuntime(Runtime::kKeyedGetProperty); } - -void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) { // The return address is in lr. Label slow, check_name, index_smi, index_name, property_array_property; Label probe_dictionary, check_number_dictionary; @@ -379,9 +364,9 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, // Check the receiver's map to see if it has fast elements. __ CheckFastElements(r0, r3, &check_number_dictionary); - GenerateFastArrayLoad(masm, receiver, key, r0, r3, r4, r0, &slow, - language_mode); - __ IncrementCounter(isolate->counters()->keyed_load_generic_smi(), 1, r4, r3); + GenerateFastArrayLoad(masm, receiver, key, r0, r3, r4, r0, &slow); + __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_smi(), 1, r4, + r3); __ Ret(); __ bind(&check_number_dictionary); @@ -400,9 +385,9 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, // Slow case, key and receiver still in r2 and r1. __ bind(&slow); - __ IncrementCounter(isolate->counters()->keyed_load_generic_slow(), 1, r4, + __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_slow(), 1, r4, r3); - GenerateRuntimeGetProperty(masm, language_mode); + GenerateRuntimeGetProperty(masm); __ bind(&check_name); GenerateKeyNameCheck(masm, key, r0, r3, &index_name, &slow); @@ -446,8 +431,8 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, GenerateGlobalInstanceTypeCheck(masm, r0, &slow); // Load the property to r0. GenerateDictionaryLoad(masm, &slow, r3, key, r0, r5, r4); - __ IncrementCounter(isolate->counters()->keyed_load_generic_symbol(), 1, r4, - r3); + __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_symbol(), 1, + r4, r3); __ Ret(); __ bind(&index_name); @@ -793,11 +778,11 @@ void StoreIC::GenerateNormal(MacroAssembler* masm) { GenerateDictionaryStore(masm, &miss, dictionary, name, value, r6, r9); Counters* counters = masm->isolate()->counters(); - __ IncrementCounter(counters->store_normal_hit(), 1, r6, r9); + __ IncrementCounter(counters->ic_store_normal_hit(), 1, r6, r9); __ Ret(); __ bind(&miss); - __ IncrementCounter(counters->store_normal_miss(), 1, r6, r9); + __ IncrementCounter(counters->ic_store_normal_miss(), 1, r6, r9); GenerateMiss(masm); } diff --git a/deps/v8/src/ic/arm64/handler-compiler-arm64.cc b/deps/v8/src/ic/arm64/handler-compiler-arm64.cc index 7cfef6a1b4..51ae3b50cf 100644 --- a/deps/v8/src/ic/arm64/handler-compiler-arm64.cc +++ b/deps/v8/src/ic/arm64/handler-compiler-arm64.cc @@ -4,8 +4,10 @@ #if V8_TARGET_ARCH_ARM64 -#include "src/ic/call-optimization.h" #include "src/ic/handler-compiler.h" + +#include "src/field-type.h" +#include "src/ic/call-optimization.h" #include "src/ic/ic.h" #include "src/isolate-inl.h" @@ -198,11 +200,17 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( call_data_undefined = true; __ LoadRoot(data, Heap::kUndefinedValueRootIndex); } else { - __ Ldr(data, - FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); - __ Ldr(data, - FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); - __ Ldr(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + if (optimization.is_constant_call()) { + __ Ldr(data, + FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); + __ Ldr(data, + FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); + __ Ldr(data, + FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + } else { + __ Ldr(data, + FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); + } __ Ldr(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); } @@ -221,7 +229,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( __ Mov(api_function_address, ref); // Jump to stub. - CallApiAccessorStub stub(isolate, is_store, call_data_undefined); + CallApiAccessorStub stub(isolate, is_store, call_data_undefined, + !optimization.is_constant_call()); __ TailCallStub(&stub); } @@ -358,7 +367,7 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( } Counters* counters = isolate()->counters(); - __ IncrementCounter(counters->named_load_global_stub(), 1, x1, x3); + __ IncrementCounter(counters->ic_named_load_global_stub(), 1, x1, x3); if (IC::ICUseVector(kind())) { DiscardVectorAndSlot(); } @@ -441,8 +450,7 @@ void NamedStoreHandlerCompiler::GenerateConstantCheck(Register map_reg, __ B(ne, miss_label); } - -void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, +void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, Register value_reg, Label* miss_label) { Register map_reg = scratch1(); @@ -450,20 +458,11 @@ void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, DCHECK(!value_reg.is(map_reg)); DCHECK(!value_reg.is(scratch)); __ JumpIfSmi(value_reg, miss_label); - HeapType::Iterator<Map> it = field_type->Classes(); - if (!it.Done()) { + if (field_type->IsClass()) { __ Ldr(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); - Label do_store; - while (true) { - __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); - it.Advance(); - if (it.Done()) { - __ B(ne, miss_label); - break; - } - __ B(eq, &do_store); - } - __ Bind(&do_store); + __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), + scratch); + __ B(ne, miss_label); } } @@ -645,19 +644,20 @@ void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { void NamedLoadHandlerCompiler::GenerateLoadCallback( - Register reg, Handle<ExecutableAccessorInfo> callback) { + Register reg, Handle<AccessorInfo> callback) { + DCHECK(!AreAliased(scratch2(), scratch3(), scratch4(), receiver())); DCHECK(!AreAliased(scratch2(), scratch3(), scratch4(), reg)); - // Build ExecutableAccessorInfo::args_ list on the stack and push property - // name below the exit frame to make GC aware of them and store pointers to - // them. - STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0); - STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 1); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 2); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 3); - STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4); - STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5); - STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 6); + // Build v8::PropertyCallbackInfo::args_ array on the stack and push property + // name below the exit frame to make GC aware of them. + STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0); + STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1); + STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4); + STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5); + STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6); + STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7); __ Push(receiver()); @@ -673,18 +673,9 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback( } __ LoadRoot(scratch4(), Heap::kUndefinedValueRootIndex); __ Mov(scratch2(), Operand(ExternalReference::isolate_address(isolate()))); - __ Push(scratch3(), scratch4(), scratch4(), scratch2(), reg, name()); - - Register args_addr = scratch2(); - __ Add(args_addr, __ StackPointer(), kPointerSize); - - // Stack at this point: - // sp[40] callback data - // sp[32] undefined - // sp[24] undefined - // sp[16] isolate - // args_addr -> sp[8] reg - // sp[0] name + __ Push(scratch3(), scratch4(), scratch4(), scratch2(), reg); + __ Push(Smi::FromInt(0)); // should_throw_on_error -> false + __ Push(name()); // Abi for CallApiGetter. Register getter_address_reg = x2; @@ -774,8 +765,8 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( - Handle<JSObject> object, Handle<Name> name, - Handle<ExecutableAccessorInfo> callback) { + Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, + LanguageMode language_mode) { ASM_LOCATION("NamedStoreHandlerCompiler::CompileStoreCallback"); Register holder_reg = Frontend(name); @@ -795,6 +786,7 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( } __ Mov(scratch2(), Operand(name)); __ Push(receiver(), holder_reg, scratch1(), scratch2(), value()); + __ Push(Smi::FromInt(language_mode)); // Do tail-call to the runtime system. __ TailCallRuntime(Runtime::kStoreCallbackProperty); diff --git a/deps/v8/src/ic/arm64/ic-arm64.cc b/deps/v8/src/ic/arm64/ic-arm64.cc index eb933c78ec..726a68e45f 100644 --- a/deps/v8/src/ic/arm64/ic-arm64.cc +++ b/deps/v8/src/ic/arm64/ic-arm64.cc @@ -164,8 +164,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm, static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, Register key, Register elements, Register scratch1, Register scratch2, - Register result, Label* slow, - LanguageMode language_mode) { + Register result, Label* slow) { DCHECK(!AreAliased(receiver, key, elements, scratch1, scratch2)); Label check_prototypes, check_next_prototype; @@ -203,13 +202,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, __ B(&check_next_prototype); __ Bind(&absent); - if (is_strong(language_mode)) { - // Strong mode accesses must throw in this case, so call the runtime. - __ B(slow); - } else { - __ LoadRoot(result, Heap::kUndefinedValueRootIndex); - __ B(&done); - } + __ LoadRoot(result, Heap::kUndefinedValueRootIndex); + __ B(&done); __ Bind(&in_bounds); // Fast case: Do the load. @@ -260,8 +254,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key, // Fall through if the key is a unique name. } - -void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { +void LoadIC::GenerateNormal(MacroAssembler* masm) { Register dictionary = x0; DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); @@ -275,7 +268,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { // Dictionary load failed, go slow (but don't miss). __ Bind(&slow); - GenerateRuntimeGetProperty(masm, language_mode); + GenerateRuntimeGetProperty(masm); } @@ -286,7 +279,7 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { DCHECK(!AreAliased(x4, x5, LoadWithVectorDescriptor::SlotRegister(), LoadWithVectorDescriptor::VectorRegister())); - __ IncrementCounter(isolate->counters()->load_miss(), 1, x4, x5); + __ IncrementCounter(isolate->counters()->ic_load_miss(), 1, x4, x5); // Perform tail call to the entry. __ Push(LoadWithVectorDescriptor::ReceiverRegister(), @@ -296,15 +289,12 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kLoadIC_Miss); } - -void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is in lr. __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong - : Runtime::kGetProperty); + __ TailCallRuntime(Runtime::kGetProperty); } @@ -314,7 +304,7 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { DCHECK(!AreAliased(x10, x11, LoadWithVectorDescriptor::SlotRegister(), LoadWithVectorDescriptor::VectorRegister())); - __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, x10, x11); + __ IncrementCounter(isolate->counters()->ic_keyed_load_miss(), 1, x10, x11); __ Push(LoadWithVectorDescriptor::ReceiverRegister(), LoadWithVectorDescriptor::NameRegister(), @@ -325,24 +315,19 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); } - -void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is in lr. __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong - : Runtime::kKeyedGetProperty); + __ TailCallRuntime(Runtime::kKeyedGetProperty); } - static void GenerateKeyedLoadWithSmiKey(MacroAssembler* masm, Register key, Register receiver, Register scratch1, Register scratch2, Register scratch3, Register scratch4, Register scratch5, - Label* slow, - LanguageMode language_mode) { + Label* slow) { DCHECK(!AreAliased(key, receiver, scratch1, scratch2, scratch3, scratch4, scratch5)); @@ -358,8 +343,8 @@ static void GenerateKeyedLoadWithSmiKey(MacroAssembler* masm, Register key, __ CheckFastElements(scratch1, scratch2, &check_number_dictionary); GenerateFastArrayLoad(masm, receiver, key, scratch3, scratch2, scratch1, - result, slow, language_mode); - __ IncrementCounter(isolate->counters()->keyed_load_generic_smi(), 1, + result, slow); + __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_smi(), 1, scratch1, scratch2); __ Ret(); @@ -424,14 +409,12 @@ static void GenerateKeyedLoadWithNameKey(MacroAssembler* masm, Register key, GenerateGlobalInstanceTypeCheck(masm, scratch1, slow); // Load the property. GenerateDictionaryLoad(masm, slow, scratch2, key, result, scratch1, scratch3); - __ IncrementCounter(isolate->counters()->keyed_load_generic_symbol(), 1, + __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_symbol(), 1, scratch1, scratch2); __ Ret(); } - -void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) { // The return address is in lr. Label slow, check_name, index_smi, index_name; @@ -444,14 +427,13 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, __ Bind(&index_smi); // Now the key is known to be a smi. This place is also jumped to from below // where a numeric string is converted to a smi. - GenerateKeyedLoadWithSmiKey(masm, key, receiver, x7, x3, x4, x5, x6, &slow, - language_mode); + GenerateKeyedLoadWithSmiKey(masm, key, receiver, x7, x3, x4, x5, x6, &slow); // Slow case. __ Bind(&slow); - __ IncrementCounter(masm->isolate()->counters()->keyed_load_generic_slow(), 1, - x4, x3); - GenerateRuntimeGetProperty(masm, language_mode); + __ IncrementCounter(masm->isolate()->counters()->ic_keyed_load_generic_slow(), + 1, x4, x3); + GenerateRuntimeGetProperty(masm); __ Bind(&check_name); GenerateKeyNameCheck(masm, key, x0, x3, &index_name, &slow); @@ -783,12 +765,12 @@ void StoreIC::GenerateNormal(MacroAssembler* masm) { GenerateDictionaryStore(masm, &miss, dictionary, name, value, x6, x7); Counters* counters = masm->isolate()->counters(); - __ IncrementCounter(counters->store_normal_hit(), 1, x6, x7); + __ IncrementCounter(counters->ic_store_normal_hit(), 1, x6, x7); __ Ret(); // Cache miss: Jump to runtime. __ Bind(&miss); - __ IncrementCounter(counters->store_normal_miss(), 1, x6, x7); + __ IncrementCounter(counters->ic_store_normal_miss(), 1, x6, x7); GenerateMiss(masm); } diff --git a/deps/v8/src/ic/call-optimization.cc b/deps/v8/src/ic/call-optimization.cc index 45717b50a7..571b614dde 100644 --- a/deps/v8/src/ic/call-optimization.cc +++ b/deps/v8/src/ic/call-optimization.cc @@ -8,8 +8,16 @@ namespace v8 { namespace internal { -CallOptimization::CallOptimization(Handle<JSFunction> function) { - Initialize(function); +CallOptimization::CallOptimization(Handle<Object> function) { + constant_function_ = Handle<JSFunction>::null(); + is_simple_api_call_ = false; + expected_receiver_type_ = Handle<FunctionTemplateInfo>::null(); + api_call_info_ = Handle<CallHandlerInfo>::null(); + if (function->IsJSFunction()) { + Initialize(Handle<JSFunction>::cast(function)); + } else if (function->IsFunctionTemplateInfo()) { + Initialize(Handle<FunctionTemplateInfo>::cast(function)); + } } @@ -27,9 +35,8 @@ Handle<JSObject> CallOptimization::LookupHolderOfExpectedType( return Handle<JSObject>::null(); } for (int depth = 1; true; depth++) { - if (!object_map->prototype()->IsJSObject()) break; + if (!object_map->has_hidden_prototype()) break; Handle<JSObject> prototype(JSObject::cast(object_map->prototype())); - if (!prototype->map()->is_hidden_prototype()) break; object_map = handle(prototype->map()); if (expected_receiver_type_->IsTemplateFor(*object_map)) { *holder_lookup = kHolderFound; @@ -80,13 +87,20 @@ bool CallOptimization::IsCompatibleReceiverMap(Handle<Map> map, return false; } +void CallOptimization::Initialize( + Handle<FunctionTemplateInfo> function_template_info) { + if (function_template_info->call_code()->IsUndefined()) return; + api_call_info_ = + handle(CallHandlerInfo::cast(function_template_info->call_code())); -void CallOptimization::Initialize(Handle<JSFunction> function) { - constant_function_ = Handle<JSFunction>::null(); - is_simple_api_call_ = false; - expected_receiver_type_ = Handle<FunctionTemplateInfo>::null(); - api_call_info_ = Handle<CallHandlerInfo>::null(); + if (!function_template_info->signature()->IsUndefined()) { + expected_receiver_type_ = + handle(FunctionTemplateInfo::cast(function_template_info->signature())); + } + is_simple_api_call_ = true; +} +void CallOptimization::Initialize(Handle<JSFunction> function) { if (function.is_null() || !function->is_compiled()) return; constant_function_ = function; diff --git a/deps/v8/src/ic/call-optimization.h b/deps/v8/src/ic/call-optimization.h index 7963d1ce67..efabd3387c 100644 --- a/deps/v8/src/ic/call-optimization.h +++ b/deps/v8/src/ic/call-optimization.h @@ -15,7 +15,7 @@ namespace internal { // Holds information about possible function call optimizations. class CallOptimization BASE_EMBEDDED { public: - explicit CallOptimization(Handle<JSFunction> function); + explicit CallOptimization(Handle<Object> function); bool is_constant_call() const { return !constant_function_.is_null(); } @@ -51,6 +51,7 @@ class CallOptimization BASE_EMBEDDED { private: void Initialize(Handle<JSFunction> function); + void Initialize(Handle<FunctionTemplateInfo> function_template_info); // Determines whether the given function can be called using the // fast api call builtin. diff --git a/deps/v8/src/ic/handler-compiler.cc b/deps/v8/src/ic/handler-compiler.cc index b353628053..803281e24d 100644 --- a/deps/v8/src/ic/handler-compiler.cc +++ b/deps/v8/src/ic/handler-compiler.cc @@ -4,9 +4,10 @@ #include "src/ic/handler-compiler.h" +#include "src/field-type.h" #include "src/ic/call-optimization.h" -#include "src/ic/ic.h" #include "src/ic/ic-inl.h" +#include "src/ic/ic.h" #include "src/isolate-inl.h" #include "src/profiler/cpu-profiler.h" @@ -56,11 +57,7 @@ Handle<Code> NamedLoadHandlerCompiler::ComputeLoadNonexistent( if (name->IsPrivate()) { // TODO(verwaest): Use nonexistent_private_symbol. cache_name = name; - JSReceiver* prototype = JSReceiver::cast(current_map->prototype()); - if (!prototype->map()->is_hidden_prototype() && - !prototype->map()->IsJSGlobalObjectMap()) { - break; - } + if (!current_map->has_hidden_prototype()) break; } last = handle(JSObject::cast(current_map->prototype())); @@ -228,7 +225,7 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadNonexistent( Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback( - Handle<Name> name, Handle<ExecutableAccessorInfo> callback) { + Handle<Name> name, Handle<AccessorInfo> callback) { Register reg = Frontend(name); GenerateLoadCallback(reg, callback); return GetCode(kind(), Code::FAST, name); @@ -278,7 +275,7 @@ void NamedLoadHandlerCompiler::InterceptorVectorSlotPop(Register holder_reg, Handle<Code> NamedLoadHandlerCompiler::CompileLoadInterceptor( LookupIterator* it) { // So far the most popular follow ups for interceptor loads are DATA and - // ExecutableAccessorInfo, so inline only them. Other cases may be added + // AccessorInfo, so inline only them. Other cases may be added // later. bool inline_followup = false; switch (it->state()) { @@ -296,20 +293,20 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadInterceptor( break; case LookupIterator::ACCESSOR: { Handle<Object> accessors = it->GetAccessors(); - if (accessors->IsExecutableAccessorInfo()) { - Handle<ExecutableAccessorInfo> info = - Handle<ExecutableAccessorInfo>::cast(accessors); - inline_followup = info->getter() != NULL && - ExecutableAccessorInfo::IsCompatibleReceiverMap( - isolate(), info, map()); + if (accessors->IsAccessorInfo()) { + Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors); + inline_followup = + info->getter() != NULL && + AccessorInfo::IsCompatibleReceiverMap(isolate(), info, map()); } else if (accessors->IsAccessorPair()) { Handle<JSObject> property_holder(it->GetHolder<JSObject>()); Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), isolate()); - if (!getter->IsJSFunction()) break; + if (!(getter->IsJSFunction() || getter->IsFunctionTemplateInfo())) { + break; + } if (!property_holder->HasFastProperties()) break; - auto function = Handle<JSFunction>::cast(getter); - CallOptimization call_optimization(function); + CallOptimization call_optimization(getter); Handle<Map> receiver_map = map(); inline_followup = call_optimization.is_simple_api_call() && call_optimization.IsCompatibleReceiverMap( @@ -396,14 +393,14 @@ void NamedLoadHandlerCompiler::GenerateLoadPostInterceptor( break; } case LookupIterator::ACCESSOR: - if (it->GetAccessors()->IsExecutableAccessorInfo()) { - Handle<ExecutableAccessorInfo> info = - Handle<ExecutableAccessorInfo>::cast(it->GetAccessors()); + if (it->GetAccessors()->IsAccessorInfo()) { + Handle<AccessorInfo> info = + Handle<AccessorInfo>::cast(it->GetAccessors()); DCHECK_NOT_NULL(info->getter()); GenerateLoadCallback(reg, info); } else { - auto function = handle(JSFunction::cast( - AccessorPair::cast(*it->GetAccessors())->getter())); + Handle<Object> function = handle( + AccessorPair::cast(*it->GetAccessors())->getter(), isolate()); CallOptimization call_optimization(function); GenerateApiAccessorCall(masm(), call_optimization, holder_map, receiver(), scratch2(), false, no_reg, reg, @@ -437,8 +434,9 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreTransition( PrototypeIterator::WhereToEnd end = name->IsPrivate() ? PrototypeIterator::END_AT_NON_HIDDEN : PrototypeIterator::END_AT_NULL; - PrototypeIterator iter(isolate(), holder()); - while (!iter.IsAtEnd(end)) { + PrototypeIterator iter(isolate(), holder(), + PrototypeIterator::START_AT_PROTOTYPE, end); + while (!iter.IsAtEnd()) { last = PrototypeIterator::GetCurrent<JSObject>(iter); iter.Advance(); } @@ -510,10 +508,9 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreTransition( return GetCode(kind(), Code::FAST, name); } - bool NamedStoreHandlerCompiler::RequiresFieldTypeChecks( - HeapType* field_type) const { - return !field_type->Classes().Done(); + FieldType* field_type) const { + return field_type->IsClass(); } @@ -521,7 +518,7 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreField(LookupIterator* it) { Label miss; DCHECK(it->representation().IsHeapObject()); - HeapType* field_type = *it->GetFieldType(); + FieldType* field_type = *it->GetFieldType(); bool need_save_restore = false; if (RequiresFieldTypeChecks(field_type)) { need_save_restore = IC::ICUseVector(kind()); @@ -564,10 +561,8 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( #undef __ - void ElementHandlerCompiler::CompileElementHandlers( - MapHandleList* receiver_maps, CodeHandleList* handlers, - LanguageMode language_mode) { + MapHandleList* receiver_maps, CodeHandleList* handlers) { for (int i = 0; i < receiver_maps->length(); ++i) { Handle<Map> receiver_map = receiver_maps->at(i); Handle<Code> cached_stub; @@ -575,9 +570,7 @@ void ElementHandlerCompiler::CompileElementHandlers( if (receiver_map->IsStringMap()) { cached_stub = LoadIndexedStringStub(isolate()).GetCode(); } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { - cached_stub = is_strong(language_mode) - ? isolate()->builtins()->KeyedLoadIC_Slow_Strong() - : isolate()->builtins()->KeyedLoadIC_Slow(); + cached_stub = isolate()->builtins()->KeyedLoadIC_Slow(); } else { bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; ElementsKind elements_kind = receiver_map->elements_kind(); @@ -586,9 +579,7 @@ void ElementHandlerCompiler::CompileElementHandlers( // generated stub code needs to check that dynamically anyway. bool convert_hole_to_undefined = (is_js_array && elements_kind == FAST_HOLEY_ELEMENTS && - *receiver_map == - isolate()->get_initial_js_array_map(elements_kind)) && - !is_strong(language_mode); + *receiver_map == isolate()->get_initial_js_array_map(elements_kind)); if (receiver_map->has_indexed_interceptor()) { cached_stub = LoadIndexedInterceptorStub(isolate()).GetCode(); @@ -600,9 +591,7 @@ void ElementHandlerCompiler::CompileElementHandlers( convert_hole_to_undefined).GetCode(); } else { DCHECK(elements_kind == DICTIONARY_ELEMENTS); - LoadICState state = - LoadICState(is_strong(language_mode) ? LoadICState::kStrongModeState - : kNoExtraICState); + LoadICState state = LoadICState(kNoExtraICState); cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); } } diff --git a/deps/v8/src/ic/handler-compiler.h b/deps/v8/src/ic/handler-compiler.h index fe59210353..45d7d73089 100644 --- a/deps/v8/src/ic/handler-compiler.h +++ b/deps/v8/src/ic/handler-compiler.h @@ -123,7 +123,7 @@ class NamedLoadHandlerCompiler : public PropertyHandlerCompiler { Handle<Code> CompileLoadField(Handle<Name> name, FieldIndex index); Handle<Code> CompileLoadCallback(Handle<Name> name, - Handle<ExecutableAccessorInfo> callback); + Handle<AccessorInfo> callback); Handle<Code> CompileLoadCallback(Handle<Name> name, const CallOptimization& call_optimization, @@ -180,8 +180,7 @@ class NamedLoadHandlerCompiler : public PropertyHandlerCompiler { private: Handle<Code> CompileLoadNonexistent(Handle<Name> name); void GenerateLoadConstant(Handle<Object> value); - void GenerateLoadCallback(Register reg, - Handle<ExecutableAccessorInfo> callback); + void GenerateLoadCallback(Register reg, Handle<AccessorInfo> callback); void GenerateLoadCallback(const CallOptimization& call_optimization, Handle<Map> receiver_map); @@ -224,7 +223,8 @@ class NamedStoreHandlerCompiler : public PropertyHandlerCompiler { Handle<Name> name); Handle<Code> CompileStoreField(LookupIterator* it); Handle<Code> CompileStoreCallback(Handle<JSObject> object, Handle<Name> name, - Handle<ExecutableAccessorInfo> callback); + Handle<AccessorInfo> callback, + LanguageMode language_mode); Handle<Code> CompileStoreCallback(Handle<JSObject> object, Handle<Name> name, const CallOptimization& call_optimization, int accessor_index); @@ -265,8 +265,8 @@ class NamedStoreHandlerCompiler : public PropertyHandlerCompiler { Register value_reg, Register scratch, Label* miss_label); - bool RequiresFieldTypeChecks(HeapType* field_type) const; - void GenerateFieldTypeChecks(HeapType* field_type, Register value_reg, + bool RequiresFieldTypeChecks(FieldType* field_type) const; + void GenerateFieldTypeChecks(FieldType* field_type, Register value_reg, Label* miss_label); static Builtins::Name SlowBuiltin(Code::Kind kind) { @@ -295,8 +295,7 @@ class ElementHandlerCompiler : public PropertyHandlerCompiler { virtual ~ElementHandlerCompiler() {} void CompileElementHandlers(MapHandleList* receiver_maps, - CodeHandleList* handlers, - LanguageMode language_mode); + CodeHandleList* handlers); static void GenerateStoreSlow(MacroAssembler* masm); }; diff --git a/deps/v8/src/ic/ia32/handler-compiler-ia32.cc b/deps/v8/src/ic/ia32/handler-compiler-ia32.cc index 0b380b3ee2..3bdddf9b6d 100644 --- a/deps/v8/src/ic/ia32/handler-compiler-ia32.cc +++ b/deps/v8/src/ic/ia32/handler-compiler-ia32.cc @@ -4,8 +4,10 @@ #if V8_TARGET_ARCH_IA32 -#include "src/ic/call-optimization.h" #include "src/ic/handler-compiler.h" + +#include "src/field-type.h" +#include "src/ic/call-optimization.h" #include "src/ic/ic.h" #include "src/isolate-inl.h" @@ -197,9 +199,13 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( call_data_undefined = true; __ mov(data, Immediate(isolate->factory()->undefined_value())); } else { - __ mov(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); - __ mov(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); - __ mov(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + if (optimization.is_constant_call()) { + __ mov(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); + __ mov(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); + __ mov(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + } else { + __ mov(data, FieldOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); + } __ mov(data, FieldOperand(data, CallHandlerInfo::kDataOffset)); } @@ -214,7 +220,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( __ mov(api_function_address, Immediate(function_address)); // Jump to stub. - CallApiAccessorStub stub(isolate, is_store, call_data_undefined); + CallApiAccessorStub stub(isolate, is_store, call_data_undefined, + !optimization.is_constant_call()); __ TailCallStub(&stub); } @@ -399,8 +406,7 @@ void NamedStoreHandlerCompiler::GenerateConstantCheck(Register map_reg, __ j(not_equal, miss_label); } - -void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, +void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, Register value_reg, Label* miss_label) { Register map_reg = scratch1(); @@ -408,20 +414,11 @@ void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, DCHECK(!value_reg.is(map_reg)); DCHECK(!value_reg.is(scratch)); __ JumpIfSmi(value_reg, miss_label); - HeapType::Iterator<Map> it = field_type->Classes(); - if (!it.Done()) { - Label do_store; + if (field_type->IsClass()) { __ mov(map_reg, FieldOperand(value_reg, HeapObject::kMapOffset)); - while (true) { - __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); - it.Advance(); - if (it.Done()) { - __ j(not_equal, miss_label); - break; - } - __ j(equal, &do_store, Label::kNear); - } - __ bind(&do_store); + __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), + scratch); + __ j(not_equal, miss_label); } } @@ -593,24 +590,30 @@ void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { void NamedLoadHandlerCompiler::GenerateLoadCallback( - Register reg, Handle<ExecutableAccessorInfo> callback) { + Register reg, Handle<AccessorInfo> callback) { + DCHECK(!AreAliased(scratch2(), scratch3(), receiver())); + DCHECK(!AreAliased(scratch2(), scratch3(), reg)); + // Insert additional parameters into the stack frame above return address. - DCHECK(!scratch3().is(reg)); __ pop(scratch3()); // Get return address to place it below. - STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0); - STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 1); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 2); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 3); - STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4); - STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5); + // Build v8::PropertyCallbackInfo::args_ array on the stack and push property + // name below the exit frame to make GC aware of them. + STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0); + STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1); + STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4); + STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5); + STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6); + STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7); + __ push(receiver()); // receiver - // Push data from ExecutableAccessorInfo. + // Push data from AccessorInfo. Handle<Object> data(callback->data(), isolate()); if (data->IsUndefined() || data->IsSmi()) { __ push(Immediate(data)); } else { - DCHECK(!scratch2().is(reg)); Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(Handle<HeapObject>::cast(data)); // The callback is alive if this instruction is executed, @@ -623,13 +626,9 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback( __ push(Immediate(isolate()->factory()->undefined_value())); __ push(Immediate(reinterpret_cast<int>(isolate()))); __ push(reg); // holder - - // Save a pointer to where we pushed the arguments. This will be - // passed as the const PropertyAccessorInfo& to the C++ callback. - __ push(esp); + __ push(Immediate(Smi::FromInt(0))); // should_throw_on_error -> false __ push(name()); // name - __ push(scratch3()); // Restore return address. // Abi for CallApiGetter @@ -731,8 +730,8 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( - Handle<JSObject> object, Handle<Name> name, - Handle<ExecutableAccessorInfo> callback) { + Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, + LanguageMode language_mode) { Register holder_reg = Frontend(name); __ pop(scratch1()); // remove the return address @@ -748,6 +747,7 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( } __ Push(name); __ push(value()); + __ push(Immediate(Smi::FromInt(language_mode))); __ push(scratch1()); // restore return address // Do tail-call to the runtime system. @@ -802,7 +802,7 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( } Counters* counters = isolate()->counters(); - __ IncrementCounter(counters->named_load_global_stub(), 1); + __ IncrementCounter(counters->ic_named_load_global_stub(), 1); // The code above already loads the result into the return register. if (IC::ICUseVector(kind())) { DiscardVectorAndSlot(); diff --git a/deps/v8/src/ic/ia32/ic-ia32.cc b/deps/v8/src/ic/ia32/ic-ia32.cc index 88947e47e7..0eba42720d 100644 --- a/deps/v8/src/ic/ia32/ic-ia32.cc +++ b/deps/v8/src/ic/ia32/ic-ia32.cc @@ -167,7 +167,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm, static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, Register key, Register scratch, Register scratch2, Register result, - Label* slow, LanguageMode language_mode) { + Label* slow) { // Register use: // receiver - holds the receiver and is unchanged. // key - holds the key and is unchanged (must be a smi). @@ -211,13 +211,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, __ jmp(&check_next_prototype); __ bind(&absent); - if (is_strong(language_mode)) { - // Strong mode accesses must throw in this case, so call the runtime. - __ jmp(slow); - } else { - __ mov(result, masm->isolate()->factory()->undefined_value()); - __ jmp(&done); - } + __ mov(result, masm->isolate()->factory()->undefined_value()); + __ jmp(&done); __ bind(&in_bounds); // Fast case: Do the load. @@ -262,9 +257,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key, __ bind(&unique); } - -void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) { // The return address is on the stack. Label slow, check_name, index_smi, index_name, property_array_property; Label probe_dictionary, check_number_dictionary; @@ -286,11 +279,10 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, // Check the receiver's map to see if it has fast elements. __ CheckFastElements(eax, &check_number_dictionary); - GenerateFastArrayLoad(masm, receiver, key, eax, ebx, eax, &slow, - language_mode); + GenerateFastArrayLoad(masm, receiver, key, eax, ebx, eax, &slow); Isolate* isolate = masm->isolate(); Counters* counters = isolate->counters(); - __ IncrementCounter(counters->keyed_load_generic_smi(), 1); + __ IncrementCounter(counters->ic_keyed_load_generic_smi(), 1); __ ret(0); __ bind(&check_number_dictionary); @@ -318,8 +310,8 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, __ bind(&slow); // Slow case: jump to runtime. - __ IncrementCounter(counters->keyed_load_generic_slow(), 1); - GenerateRuntimeGetProperty(masm, language_mode); + __ IncrementCounter(counters->ic_keyed_load_generic_slow(), 1); + GenerateRuntimeGetProperty(masm); __ bind(&check_name); GenerateKeyNameCheck(masm, key, eax, ebx, &index_name, &slow); @@ -363,7 +355,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, GenerateGlobalInstanceTypeCheck(masm, eax, &slow); GenerateDictionaryLoad(masm, &slow, ebx, key, eax, edi, eax); - __ IncrementCounter(counters->keyed_load_generic_symbol(), 1); + __ IncrementCounter(counters->ic_keyed_load_generic_symbol(), 1); __ ret(0); __ bind(&index_name); @@ -628,8 +620,7 @@ void KeyedStoreIC::GenerateMegamorphic(MacroAssembler* masm, GenerateMiss(masm); } - -void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { +void LoadIC::GenerateNormal(MacroAssembler* masm) { Register dictionary = eax; DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); @@ -644,7 +635,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { // Dictionary load failed, go slow (but don't miss). __ bind(&slow); - GenerateRuntimeGetProperty(masm, language_mode); + GenerateRuntimeGetProperty(masm); } @@ -668,16 +659,14 @@ static void LoadIC_PushArgs(MacroAssembler* masm) { void LoadIC::GenerateMiss(MacroAssembler* masm) { // Return address is on the stack. - __ IncrementCounter(masm->isolate()->counters()->load_miss(), 1); + __ IncrementCounter(masm->isolate()->counters()->ic_load_miss(), 1); LoadIC_PushArgs(masm); // Perform tail call to the entry. __ TailCallRuntime(Runtime::kLoadIC_Miss); } - -void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // Return address is on the stack. Register receiver = LoadDescriptor::ReceiverRegister(); Register name = LoadDescriptor::NameRegister(); @@ -689,14 +678,13 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, __ push(ebx); // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong - : Runtime::kGetProperty); + __ TailCallRuntime(Runtime::kGetProperty); } void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { // Return address is on the stack. - __ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1); + __ IncrementCounter(masm->isolate()->counters()->ic_keyed_load_miss(), 1); LoadIC_PushArgs(masm); @@ -704,9 +692,7 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); } - -void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // Return address is on the stack. Register receiver = LoadDescriptor::ReceiverRegister(); Register name = LoadDescriptor::NameRegister(); @@ -718,8 +704,7 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, __ push(ebx); // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong - : Runtime::kKeyedGetProperty); + __ TailCallRuntime(Runtime::kKeyedGetProperty); } @@ -777,14 +762,14 @@ void StoreIC::GenerateNormal(MacroAssembler* masm) { receiver, edi); __ Drop(3); Counters* counters = masm->isolate()->counters(); - __ IncrementCounter(counters->store_normal_hit(), 1); + __ IncrementCounter(counters->ic_store_normal_hit(), 1); __ ret(0); __ bind(&restore_miss); __ pop(slot); __ pop(vector); __ pop(receiver); - __ IncrementCounter(counters->store_normal_miss(), 1); + __ IncrementCounter(counters->ic_store_normal_miss(), 1); GenerateMiss(masm); } diff --git a/deps/v8/src/ic/ic-compiler.cc b/deps/v8/src/ic/ic-compiler.cc index ae4b2a5d58..f74c69e50d 100644 --- a/deps/v8/src/ic/ic-compiler.cc +++ b/deps/v8/src/ic/ic-compiler.cc @@ -43,13 +43,11 @@ Handle<Code> PropertyICCompiler::ComputeKeyedLoadMonomorphicHandler( // stub code needs to check that dynamically anyway. bool convert_hole_to_undefined = is_js_array && elements_kind == FAST_HOLEY_ELEMENTS && - *receiver_map == isolate->get_initial_js_array_map(elements_kind) && - !(is_strong(LoadICState::GetLanguageMode(extra_ic_state))); + *receiver_map == isolate->get_initial_js_array_map(elements_kind); Handle<Code> stub; if (receiver_map->has_indexed_interceptor()) { stub = LoadIndexedInterceptorStub(isolate).GetCode(); } else if (receiver_map->IsStringMap()) { - // We have a string. stub = LoadIndexedStringStub(isolate).GetCode(); } else if (receiver_map->has_sloppy_arguments_elements()) { stub = KeyedLoadSloppyArgumentsStub(isolate).GetCode(); @@ -58,6 +56,7 @@ Handle<Code> PropertyICCompiler::ComputeKeyedLoadMonomorphicHandler( stub = LoadFastElementStub(isolate, is_js_array, elements_kind, convert_hole_to_undefined).GetCode(); } else { + DCHECK(receiver_map->has_dictionary_elements()); stub = LoadDictionaryElementStub(isolate, LoadICState(extra_ic_state)) .GetCode(); } diff --git a/deps/v8/src/ic/ic-inl.h b/deps/v8/src/ic/ic-inl.h index 6dab006ad5..998bd8cf12 100644 --- a/deps/v8/src/ic/ic-inl.h +++ b/deps/v8/src/ic/ic-inl.h @@ -95,9 +95,6 @@ void LoadIC::set_target(Code* code) { // The contextual mode must be preserved across IC patching. DCHECK(LoadICState::GetTypeofMode(code->extra_ic_state()) == LoadICState::GetTypeofMode(target()->extra_ic_state())); - // Strongness must be preserved across IC patching. - DCHECK(LoadICState::GetLanguageMode(code->extra_ic_state()) == - LoadICState::GetLanguageMode(target()->extra_ic_state())); IC::set_target(code); } diff --git a/deps/v8/src/ic/ic-state.cc b/deps/v8/src/ic/ic-state.cc index 4bdaf3ff03..933803c653 100644 --- a/deps/v8/src/ic/ic-state.cc +++ b/deps/v8/src/ic/ic-state.cc @@ -37,7 +37,6 @@ BinaryOpICState::BinaryOpICState(Isolate* isolate, ExtraICState extra_ic_state) isolate_(isolate) { op_ = static_cast<Token::Value>(FIRST_TOKEN + OpField::decode(extra_ic_state)); - strong_ = StrengthField::decode(extra_ic_state); left_kind_ = LeftKindField::decode(extra_ic_state); right_kind_ = fixed_right_arg_.IsJust() ? (Smi::IsValid(fixed_right_arg_.FromJust()) ? SMI : INT32) @@ -51,7 +50,7 @@ BinaryOpICState::BinaryOpICState(Isolate* isolate, ExtraICState extra_ic_state) ExtraICState BinaryOpICState::GetExtraICState() const { ExtraICState extra_ic_state = OpField::encode(op_ - FIRST_TOKEN) | LeftKindField::encode(left_kind_) | - ResultKindField::encode(result_kind_) | StrengthField::encode(strong_) | + ResultKindField::encode(result_kind_) | HasFixedRightArgField::encode(fixed_right_arg_.IsJust()); if (fixed_right_arg_.IsJust()) { extra_ic_state = FixedRightArgValueField::update( @@ -72,7 +71,7 @@ void BinaryOpICState::GenerateAheadOfTime( // Generated list of commonly used stubs #define GENERATE(op, left_kind, right_kind, result_kind) \ do { \ - BinaryOpICState state(isolate, op, Strength::WEAK); \ + BinaryOpICState state(isolate, op); \ state.left_kind_ = left_kind; \ state.fixed_right_arg_ = Nothing<int>(); \ state.right_kind_ = right_kind; \ @@ -174,7 +173,7 @@ void BinaryOpICState::GenerateAheadOfTime( #undef GENERATE #define GENERATE(op, left_kind, fixed_right_arg_value, result_kind) \ do { \ - BinaryOpICState state(isolate, op, Strength::WEAK); \ + BinaryOpICState state(isolate, op); \ state.left_kind_ = left_kind; \ state.fixed_right_arg_ = Just(fixed_right_arg_value); \ state.right_kind_ = SMI; \ @@ -208,7 +207,6 @@ Type* BinaryOpICState::GetResultType() const { std::ostream& operator<<(std::ostream& os, const BinaryOpICState& s) { os << "(" << Token::Name(s.op_); if (s.CouldCreateAllocationMementos()) os << "_CreateAllocationMementos"; - if (is_strong(s.strength())) os << "_Strong"; os << ":" << BinaryOpICState::KindToString(s.left_kind_) << "*"; if (s.fixed_right_arg_.IsJust()) { os << s.fixed_right_arg_.FromJust(); @@ -371,25 +369,25 @@ const char* CompareICState::GetStateName(State state) { Type* CompareICState::StateToType(Zone* zone, State state, Handle<Map> map) { switch (state) { case UNINITIALIZED: - return Type::None(zone); + return Type::None(); case BOOLEAN: - return Type::Boolean(zone); + return Type::Boolean(); case SMI: - return Type::SignedSmall(zone); + return Type::SignedSmall(); case NUMBER: - return Type::Number(zone); + return Type::Number(); case STRING: - return Type::String(zone); + return Type::String(); case INTERNALIZED_STRING: - return Type::InternalizedString(zone); + return Type::InternalizedString(); case UNIQUE_NAME: - return Type::UniqueName(zone); + return Type::UniqueName(); case RECEIVER: - return Type::Receiver(zone); + return Type::Receiver(); case KNOWN_RECEIVER: - return map.is_null() ? Type::Receiver(zone) : Type::Class(map, zone); + return map.is_null() ? Type::Receiver() : Type::Class(map, zone); case GENERIC: - return Type::Any(zone); + return Type::Any(); } UNREACHABLE(); return NULL; diff --git a/deps/v8/src/ic/ic-state.h b/deps/v8/src/ic/ic-state.h index 1982fbe08b..e1d33f8678 100644 --- a/deps/v8/src/ic/ic-state.h +++ b/deps/v8/src/ic/ic-state.h @@ -25,9 +25,11 @@ class CallICState final BASE_EMBEDDED { public: explicit CallICState(ExtraICState extra_ic_state) : bit_field_(extra_ic_state) {} - CallICState(int argc, ConvertReceiverMode convert_mode) + CallICState(int argc, ConvertReceiverMode convert_mode, + TailCallMode tail_call_mode) : bit_field_(ArgcBits::encode(argc) | - ConvertModeBits::encode(convert_mode)) {} + ConvertModeBits::encode(convert_mode) | + TailCallModeBits::encode(tail_call_mode)) {} ExtraICState GetExtraICState() const { return bit_field_; } @@ -39,11 +41,14 @@ class CallICState final BASE_EMBEDDED { ConvertReceiverMode convert_mode() const { return ConvertModeBits::decode(bit_field_); } + TailCallMode tail_call_mode() const { + return TailCallModeBits::decode(bit_field_); + } private: typedef BitField<int, 0, Code::kArgumentsBits> ArgcBits; - typedef BitField<ConvertReceiverMode, Code::kArgumentsBits, 2> - ConvertModeBits; + typedef BitField<ConvertReceiverMode, ArgcBits::kNext, 2> ConvertModeBits; + typedef BitField<TailCallMode, ConvertModeBits::kNext, 1> TailCallModeBits; int const bit_field_; }; @@ -55,9 +60,8 @@ std::ostream& operator<<(std::ostream& os, const CallICState& s); class BinaryOpICState final BASE_EMBEDDED { public: BinaryOpICState(Isolate* isolate, ExtraICState extra_ic_state); - BinaryOpICState(Isolate* isolate, Token::Value op, Strength strength) + BinaryOpICState(Isolate* isolate, Token::Value op) : op_(op), - strong_(is_strong(strength)), left_kind_(NONE), right_kind_(NONE), result_kind_(NONE), @@ -104,10 +108,6 @@ class BinaryOpICState final BASE_EMBEDDED { return Max(left_kind_, right_kind_) == GENERIC; } - Strength strength() const { - return strong_ ? Strength::STRONG : Strength::WEAK; - } - // Returns true if the IC should enable the inline smi code (i.e. if either // parameter may be a smi). bool UseInlinedSmiCode() const { @@ -146,15 +146,13 @@ class BinaryOpICState final BASE_EMBEDDED { class OpField : public BitField<int, 0, 4> {}; class ResultKindField : public BitField<Kind, 4, 3> {}; class LeftKindField : public BitField<Kind, 7, 3> {}; - class StrengthField : public BitField<bool, 10, 1> {}; // When fixed right arg is set, we don't need to store the right kind. // Thus the two fields can overlap. - class HasFixedRightArgField : public BitField<bool, 11, 1> {}; - class FixedRightArgValueField : public BitField<int, 12, 4> {}; - class RightKindField : public BitField<Kind, 12, 3> {}; + class HasFixedRightArgField : public BitField<bool, 10, 1> {}; + class FixedRightArgValueField : public BitField<int, 11, 4> {}; + class RightKindField : public BitField<Kind, 11, 3> {}; Token::Value op_; - bool strong_; Kind left_kind_; Kind right_kind_; Kind result_kind_; @@ -204,38 +202,24 @@ class CompareICState { class LoadICState final BASE_EMBEDDED { private: class TypeofModeBits : public BitField<TypeofMode, 0, 1> {}; - class LanguageModeBits - : public BitField<LanguageMode, TypeofModeBits::kNext, 2> {}; STATIC_ASSERT(static_cast<int>(INSIDE_TYPEOF) == 0); const ExtraICState state_; public: - static const uint32_t kNextBitFieldOffset = LanguageModeBits::kNext; - - static const ExtraICState kStrongModeState = STRONG - << LanguageModeBits::kShift; + static const uint32_t kNextBitFieldOffset = TypeofModeBits::kNext; explicit LoadICState(ExtraICState extra_ic_state) : state_(extra_ic_state) {} - explicit LoadICState(TypeofMode typeof_mode, LanguageMode language_mode) - : state_(TypeofModeBits::encode(typeof_mode) | - LanguageModeBits::encode(language_mode)) {} + explicit LoadICState(TypeofMode typeof_mode) + : state_(TypeofModeBits::encode(typeof_mode)) {} ExtraICState GetExtraICState() const { return state_; } TypeofMode typeof_mode() const { return TypeofModeBits::decode(state_); } - LanguageMode language_mode() const { - return LanguageModeBits::decode(state_); - } - static TypeofMode GetTypeofMode(ExtraICState state) { return LoadICState(state).typeof_mode(); } - - static LanguageMode GetLanguageMode(ExtraICState state) { - return LoadICState(state).language_mode(); - } }; diff --git a/deps/v8/src/ic/ic.cc b/deps/v8/src/ic/ic.cc index 73ac666a41..4c2b20ca1b 100644 --- a/deps/v8/src/ic/ic.cc +++ b/deps/v8/src/ic/ic.cc @@ -11,6 +11,7 @@ #include "src/codegen.h" #include "src/conversions.h" #include "src/execution.h" +#include "src/field-type.h" #include "src/frames-inl.h" #include "src/ic/call-optimization.h" #include "src/ic/handler-compiler.h" @@ -21,6 +22,8 @@ #include "src/macro-assembler.h" #include "src/prototype.h" #include "src/runtime/runtime.h" +#include "src/runtime/runtime-utils.h" +#include "src/tracing/trace-event.h" namespace v8 { namespace internal { @@ -545,8 +548,7 @@ void CompareIC::Clear(Isolate* isolate, Address address, Code* target, CompareICStub stub(target->stub_key(), isolate); // Only clear CompareICs that can retain objects. if (stub.state() != CompareICState::KNOWN_RECEIVER) return; - SetTargetAtAddress(address, - GetRawUninitialized(isolate, stub.op(), stub.strength()), + SetTargetAtAddress(address, GetRawUninitialized(isolate, stub.op()), constant_pool); PatchInlinedSmiCode(isolate, address, DISABLE_INLINED_SMI_CHECK); } @@ -558,9 +560,7 @@ Handle<Code> KeyedLoadIC::ChooseMegamorphicStub(Isolate* isolate, if (FLAG_compiled_keyed_generic_loads) { return KeyedLoadGenericStub(isolate, LoadICState(extra_state)).GetCode(); } else { - return is_strong(LoadICState::GetLanguageMode(extra_state)) - ? isolate->builtins()->KeyedLoadIC_Megamorphic_Strong() - : isolate->builtins()->KeyedLoadIC_Megamorphic(); + return isolate->builtins()->KeyedLoadIC_Megamorphic(); } } @@ -667,9 +667,9 @@ MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<Name> name) { TRACE_GENERIC_IC(isolate(), "LoadIC", "name as array index"); } Handle<Object> result; - ASSIGN_RETURN_ON_EXCEPTION( - isolate(), result, - Object::GetElement(isolate(), object, index, language_mode()), Object); + ASSIGN_RETURN_ON_EXCEPTION(isolate(), result, + Object::GetElement(isolate(), object, index), + Object); return result; } @@ -685,9 +685,9 @@ MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<Name> name) { ScriptContextTable::LookupResult lookup_result; if (ScriptContextTable::Lookup(script_contexts, str_name, &lookup_result)) { Handle<Object> result = - FixedArray::get(ScriptContextTable::GetContext( + FixedArray::get(*ScriptContextTable::GetContext( script_contexts, lookup_result.context_index), - lookup_result.slot_index); + lookup_result.slot_index, isolate()); if (*result == *isolate()->factory()->the_hole_value()) { // Do not install stubs and stay pre-monomorphic for // uninitialized accesses. @@ -713,8 +713,8 @@ MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<Name> name) { // Get the property. Handle<Object> result; - ASSIGN_RETURN_ON_EXCEPTION( - isolate(), result, Object::GetProperty(&it, language_mode()), Object); + ASSIGN_RETURN_ON_EXCEPTION(isolate(), result, Object::GetProperty(&it), + Object); if (it.IsFound()) { return result; } else if (!ShouldThrowReferenceError(object)) { @@ -899,9 +899,7 @@ Handle<Code> KeyedLoadIC::initialize_stub_in_optimized_code( if (initialization_state != MEGAMORPHIC) { return KeyedLoadICStub(isolate, LoadICState(extra_state)).GetCode(); } - return is_strong(LoadICState::GetLanguageMode(extra_state)) - ? isolate->builtins()->KeyedLoadIC_Megamorphic_Strong() - : isolate->builtins()->KeyedLoadIC_Megamorphic(); + return isolate->builtins()->KeyedLoadIC_Megamorphic(); } @@ -976,29 +974,34 @@ bool IsCompatibleReceiver(LookupIterator* lookup, Handle<Map> receiver_map) { DCHECK(lookup->state() == LookupIterator::ACCESSOR); Isolate* isolate = lookup->isolate(); Handle<Object> accessors = lookup->GetAccessors(); - if (accessors->IsExecutableAccessorInfo()) { - Handle<ExecutableAccessorInfo> info = - Handle<ExecutableAccessorInfo>::cast(accessors); + if (accessors->IsAccessorInfo()) { + Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors); if (info->getter() != NULL && - !ExecutableAccessorInfo::IsCompatibleReceiverMap(isolate, info, - receiver_map)) { + !AccessorInfo::IsCompatibleReceiverMap(isolate, info, receiver_map)) { return false; } } else if (accessors->IsAccessorPair()) { Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), isolate); + if (!getter->IsJSFunction() && !getter->IsFunctionTemplateInfo()) + return false; Handle<JSObject> holder = lookup->GetHolder<JSObject>(); Handle<Object> receiver = lookup->GetReceiver(); - if (getter->IsJSFunction() && holder->HasFastProperties()) { - Handle<JSFunction> function = Handle<JSFunction>::cast(getter); - if (receiver->IsJSObject() || function->shared()->IsBuiltin() || - !is_sloppy(function->shared()->language_mode())) { - CallOptimization call_optimization(function); - if (call_optimization.is_simple_api_call() && - !call_optimization.IsCompatibleReceiverMap(receiver_map, holder)) { + if (holder->HasFastProperties()) { + if (getter->IsJSFunction()) { + Handle<JSFunction> function = Handle<JSFunction>::cast(getter); + if (!receiver->IsJSObject() && !function->shared()->IsBuiltin() && + is_sloppy(function->shared()->language_mode())) { + // Calling sloppy non-builtins with a value as the receiver + // requires boxing. return false; } } + CallOptimization call_optimization(getter); + if (call_optimization.is_simple_api_call() && + !call_optimization.IsCompatibleReceiverMap(receiver_map, holder)) { + return false; + } } } return true; @@ -1019,7 +1022,7 @@ void LoadIC::UpdateCaches(LookupIterator* lookup) { lookup->state() == LookupIterator::ACCESS_CHECK) { code = slow_stub(); } else if (!lookup->IsFound()) { - if (kind() == Code::LOAD_IC && !is_strong(language_mode())) { + if (kind() == Code::LOAD_IC) { code = NamedLoadHandlerCompiler::ComputeLoadNonexistent(lookup->name(), receiver_map()); // TODO(jkummerow/verwaest): Introduce a builtin that handles this case. @@ -1168,50 +1171,39 @@ Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup, return stub.GetCode(); } - Handle<Object> accessors = lookup->GetAccessors(); - if (accessors->IsExecutableAccessorInfo()) { - Handle<ExecutableAccessorInfo> info = - Handle<ExecutableAccessorInfo>::cast(accessors); - if (v8::ToCData<Address>(info->getter()) == 0) break; - if (!ExecutableAccessorInfo::IsCompatibleReceiverMap(isolate(), info, - map)) { - // This case should be already handled in LoadIC::UpdateCaches. - UNREACHABLE(); - break; - } - if (!holder->HasFastProperties()) break; - NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); - return compiler.CompileLoadCallback(lookup->name(), info); - } - if (accessors->IsAccessorPair()) { - Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), - isolate()); - if (!getter->IsJSFunction()) break; - if (!holder->HasFastProperties()) break; - // When debugging we need to go the slow path to flood the accessor. - if (GetSharedFunctionInfo()->HasDebugInfo()) break; - Handle<JSFunction> function = Handle<JSFunction>::cast(getter); - if (!receiver->IsJSObject() && !function->shared()->IsBuiltin() && - is_sloppy(function->shared()->language_mode())) { - // Calling sloppy non-builtins with a value as the receiver - // requires boxing. - break; - } - CallOptimization call_optimization(function); - NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); - if (call_optimization.is_simple_api_call()) { - if (call_optimization.IsCompatibleReceiver(receiver, holder)) { + if (IsCompatibleReceiver(lookup, map)) { + Handle<Object> accessors = lookup->GetAccessors(); + if (accessors->IsAccessorPair()) { + if (!holder->HasFastProperties()) break; + // When debugging we need to go the slow path to flood the accessor. + if (GetSharedFunctionInfo()->HasDebugInfo()) break; + Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), + isolate()); + CallOptimization call_optimization(getter); + NamedLoadHandlerCompiler compiler(isolate(), map, holder, + cache_holder); + if (call_optimization.is_simple_api_call()) { return compiler.CompileLoadCallback( lookup->name(), call_optimization, lookup->GetAccessorIndex()); - } else { + } + int expected_arguments = Handle<JSFunction>::cast(getter) + ->shared() + ->internal_formal_parameter_count(); + return compiler.CompileLoadViaGetter( + lookup->name(), lookup->GetAccessorIndex(), expected_arguments); + } else if (accessors->IsAccessorInfo()) { + Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors); + if (v8::ToCData<Address>(info->getter()) == 0) break; + if (!AccessorInfo::IsCompatibleReceiverMap(isolate(), info, map)) { // This case should be already handled in LoadIC::UpdateCaches. UNREACHABLE(); + break; } + if (!holder->HasFastProperties()) break; + NamedLoadHandlerCompiler compiler(isolate(), map, holder, + cache_holder); + return compiler.CompileLoadCallback(lookup->name(), info); } - int expected_arguments = - function->shared()->internal_formal_parameter_count(); - return compiler.CompileLoadViaGetter( - lookup->name(), lookup->GetAccessorIndex(), expected_arguments); } break; } @@ -1237,9 +1229,7 @@ Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup, // property must be found in the object for the stub to be // applicable. if (!receiver_is_holder) break; - return is_strong(language_mode()) - ? isolate()->builtins()->LoadIC_Normal_Strong() - : isolate()->builtins()->LoadIC_Normal(); + return isolate()->builtins()->LoadIC_Normal(); } // -------------- Fields -------------- @@ -1349,8 +1339,7 @@ Handle<Code> KeyedLoadIC::LoadElementStub(Handle<HeapObject> receiver) { CodeHandleList handlers(target_receiver_maps.length()); ElementHandlerCompiler compiler(isolate()); - compiler.CompileElementHandlers(&target_receiver_maps, &handlers, - language_mode()); + compiler.CompileElementHandlers(&target_receiver_maps, &handlers); ConfigureVectorState(Handle<Name>::null(), &target_receiver_maps, &handlers); return null_handle; } @@ -1361,8 +1350,7 @@ MaybeHandle<Object> KeyedLoadIC::Load(Handle<Object> object, if (MigrateDeprecated(object)) { Handle<Object> result; ASSIGN_RETURN_ON_EXCEPTION( - isolate(), result, - Runtime::GetObjectProperty(isolate(), object, key, language_mode()), + isolate(), result, Runtime::GetObjectProperty(isolate(), object, key), Object); return result; } @@ -1378,7 +1366,8 @@ MaybeHandle<Object> KeyedLoadIC::Load(Handle<Object> object, ASSIGN_RETURN_ON_EXCEPTION(isolate(), load_handle, LoadIC::Load(object, Handle<Name>::cast(key)), Object); - } else if (FLAG_use_ic && !object->IsAccessCheckNeeded()) { + } else if (FLAG_use_ic && !object->IsAccessCheckNeeded() && + !object->IsJSValue()) { if (object->IsJSObject() || (object->IsString() && key->IsNumber())) { Handle<HeapObject> receiver = Handle<HeapObject>::cast(object); if (object->IsString() || key->IsSmi()) stub = LoadElementStub(receiver); @@ -1399,10 +1388,9 @@ MaybeHandle<Object> KeyedLoadIC::Load(Handle<Object> object, if (!load_handle.is_null()) return load_handle; Handle<Object> result; - ASSIGN_RETURN_ON_EXCEPTION( - isolate(), result, - Runtime::GetObjectProperty(isolate(), object, key, language_mode()), - Object); + ASSIGN_RETURN_ON_EXCEPTION(isolate(), result, + Runtime::GetObjectProperty(isolate(), object, key), + Object); return result; } @@ -1410,9 +1398,10 @@ MaybeHandle<Object> KeyedLoadIC::Load(Handle<Object> object, bool StoreIC::LookupForWrite(LookupIterator* it, Handle<Object> value, JSReceiver::StoreFromKeyed store_mode) { // Disable ICs for non-JSObjects for now. - Handle<Object> receiver = it->GetReceiver(); - if (!receiver->IsJSObject()) return false; - DCHECK(!Handle<JSObject>::cast(receiver)->map()->is_deprecated()); + Handle<Object> object = it->GetReceiver(); + if (!object->IsJSObject()) return false; + Handle<JSObject> receiver = Handle<JSObject>::cast(object); + DCHECK(!receiver->map()->is_deprecated()); for (; it->IsFound(); it->Next()) { switch (it->state()) { @@ -1451,21 +1440,24 @@ bool StoreIC::LookupForWrite(LookupIterator* it, Handle<Object> value, } // Receiver != holder. - PrototypeIterator iter(it->isolate(), receiver); if (receiver->IsJSGlobalProxy()) { + PrototypeIterator iter(it->isolate(), receiver); return it->GetHolder<Object>().is_identical_to( PrototypeIterator::GetCurrent(iter)); } if (it->HolderIsReceiverOrHiddenPrototype()) return false; - it->PrepareTransitionToDataProperty(value, NONE, store_mode); + if (it->ExtendingNonExtensible(receiver)) return false; + it->PrepareTransitionToDataProperty(receiver, value, NONE, store_mode); return it->IsCacheableTransition(); } } } - it->PrepareTransitionToDataProperty(value, NONE, store_mode); + receiver = it->GetStoreTarget(); + if (it->ExtendingNonExtensible(receiver)) return false; + it->PrepareTransitionToDataProperty(receiver, value, NONE, store_mode); return it->IsCacheableTransition(); } @@ -1510,7 +1502,7 @@ MaybeHandle<Object> StoreIC::Store(Handle<Object> object, Handle<Name> name, } Handle<Object> previous_value = - FixedArray::get(script_context, lookup_result.slot_index); + FixedArray::get(*script_context, lookup_result.slot_index, isolate()); if (*previous_value == *isolate()->factory()->the_hole_value()) { // Do not install stubs and stay pre-monomorphic for @@ -1564,18 +1556,18 @@ MaybeHandle<Object> StoreIC::Store(Handle<Object> object, Handle<Name> name, return value; } - Handle<Code> CallIC::initialize_stub(Isolate* isolate, int argc, - ConvertReceiverMode mode) { - CallICTrampolineStub stub(isolate, CallICState(argc, mode)); + ConvertReceiverMode mode, + TailCallMode tail_call_mode) { + CallICTrampolineStub stub(isolate, CallICState(argc, mode, tail_call_mode)); Handle<Code> code = stub.GetCode(); return code; } - Handle<Code> CallIC::initialize_stub_in_optimized_code( - Isolate* isolate, int argc, ConvertReceiverMode mode) { - CallICStub stub(isolate, CallICState(argc, mode)); + Isolate* isolate, int argc, ConvertReceiverMode mode, + TailCallMode tail_call_mode) { + CallICStub stub(isolate, CallICState(argc, mode, tail_call_mode)); Handle<Code> code = stub.GetCode(); return code; } @@ -1693,8 +1685,7 @@ Handle<Code> StoreIC::CompileHandler(LookupIterator* lookup, // This is currently guaranteed by checks in StoreIC::Store. Handle<JSObject> receiver = Handle<JSObject>::cast(lookup->GetReceiver()); Handle<JSObject> holder = lookup->GetHolder<JSObject>(); - DCHECK(!receiver->IsAccessCheckNeeded() || - isolate()->IsInternallyUsedPropertyName(lookup->name())); + DCHECK(!receiver->IsAccessCheckNeeded() || lookup->name()->IsPrivate()); switch (lookup->state()) { case LookupIterator::TRANSITION: { @@ -1733,9 +1724,8 @@ Handle<Code> StoreIC::CompileHandler(LookupIterator* lookup, break; } Handle<Object> accessors = lookup->GetAccessors(); - if (accessors->IsExecutableAccessorInfo()) { - Handle<ExecutableAccessorInfo> info = - Handle<ExecutableAccessorInfo>::cast(accessors); + if (accessors->IsAccessorInfo()) { + Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors); if (v8::ToCData<Address>(info->setter()) == 0) { TRACE_GENERIC_IC(isolate(), "StoreIC", "setter == 0"); break; @@ -1746,13 +1736,14 @@ Handle<Code> StoreIC::CompileHandler(LookupIterator* lookup, "special data property in prototype chain"); break; } - if (!ExecutableAccessorInfo::IsCompatibleReceiverMap(isolate(), info, - receiver_map())) { + if (!AccessorInfo::IsCompatibleReceiverMap(isolate(), info, + receiver_map())) { TRACE_GENERIC_IC(isolate(), "StoreIC", "incompatible receiver type"); break; } NamedStoreHandlerCompiler compiler(isolate(), receiver_map(), holder); - return compiler.CompileStoreCallback(receiver, lookup->name(), info); + return compiler.CompileStoreCallback(receiver, lookup->name(), info, + language_mode()); } else if (accessors->IsAccessorPair()) { Handle<Object> setter(Handle<AccessorPair>::cast(accessors)->setter(), isolate()); @@ -1800,9 +1791,8 @@ Handle<Code> StoreIC::CompileHandler(LookupIterator* lookup, bool use_stub = true; if (lookup->representation().IsHeapObject()) { // Only use a generic stub if no types need to be tracked. - Handle<HeapType> field_type = lookup->GetFieldType(); - HeapType::Iterator<Map> it = field_type->Classes(); - use_stub = it.Done(); + Handle<FieldType> field_type = lookup->GetFieldType(); + use_stub = !field_type->IsClass(); } if (use_stub) { StoreFieldStub stub(isolate(), lookup->GetFieldIndex(), @@ -2220,6 +2210,7 @@ void CallIC::HandleMiss(Handle<Object> function) { // Used from ic-<arch>.cc. RUNTIME_FUNCTION(Runtime_CallIC_Miss) { TimerEventScope<TimerEventIcMiss> timer(isolate); + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); HandleScope scope(isolate); DCHECK(args.length() == 3); Handle<Object> function = args.at<Object>(0); @@ -2236,6 +2227,7 @@ RUNTIME_FUNCTION(Runtime_CallIC_Miss) { // Used from ic-<arch>.cc. RUNTIME_FUNCTION(Runtime_LoadIC_Miss) { TimerEventScope<TimerEventIcMiss> timer(isolate); + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); HandleScope scope(isolate); Handle<Object> receiver = args.at<Object>(0); Handle<Name> key = args.at<Name>(1); @@ -2268,6 +2260,7 @@ RUNTIME_FUNCTION(Runtime_LoadIC_Miss) { // Used from ic-<arch>.cc RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss) { TimerEventScope<TimerEventIcMiss> timer(isolate); + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); HandleScope scope(isolate); Handle<Object> receiver = args.at<Object>(0); Handle<Object> key = args.at<Object>(1); @@ -2287,6 +2280,7 @@ RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss) { RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) { TimerEventScope<TimerEventIcMiss> timer(isolate); + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); HandleScope scope(isolate); Handle<Object> receiver = args.at<Object>(0); Handle<Object> key = args.at<Object>(1); @@ -2308,6 +2302,7 @@ RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) { // Used from ic-<arch>.cc. RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { TimerEventScope<TimerEventIcMiss> timer(isolate); + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); HandleScope scope(isolate); Handle<Object> receiver = args.at<Object>(0); Handle<Name> key = args.at<Name>(1); @@ -2339,6 +2334,7 @@ RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { RUNTIME_FUNCTION(Runtime_StoreIC_MissFromStubFailure) { TimerEventScope<TimerEventIcMiss> timer(isolate); + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); HandleScope scope(isolate); Handle<Object> receiver = args.at<Object>(0); Handle<Name> key = args.at<Name>(1); @@ -2391,6 +2387,7 @@ RUNTIME_FUNCTION(Runtime_StoreIC_MissFromStubFailure) { // Used from ic-<arch>.cc. RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { TimerEventScope<TimerEventIcMiss> timer(isolate); + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); HandleScope scope(isolate); Handle<Object> receiver = args.at<Object>(0); Handle<Object> key = args.at<Object>(1); @@ -2412,6 +2409,7 @@ RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { RUNTIME_FUNCTION(Runtime_KeyedStoreIC_MissFromStubFailure) { TimerEventScope<TimerEventIcMiss> timer(isolate); + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); HandleScope scope(isolate); Handle<Object> receiver = args.at<Object>(0); Handle<Object> key = args.at<Object>(1); @@ -2469,6 +2467,7 @@ RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Slow) { RUNTIME_FUNCTION(Runtime_ElementsTransitionAndStoreIC_Miss) { TimerEventScope<TimerEventIcMiss> timer(isolate); + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); HandleScope scope(isolate); // Length == 5 or 6, depending on whether the vector slot // is passed in a virtual register or not. @@ -2504,60 +2503,52 @@ MaybeHandle<Object> BinaryOpIC::Transition( default: UNREACHABLE(); case Token::ADD: - ASSIGN_RETURN_ON_EXCEPTION( - isolate(), result, - Object::Add(isolate(), left, right, state.strength()), Object); + ASSIGN_RETURN_ON_EXCEPTION(isolate(), result, + Object::Add(isolate(), left, right), Object); break; case Token::SUB: ASSIGN_RETURN_ON_EXCEPTION( - isolate(), result, - Object::Subtract(isolate(), left, right, state.strength()), Object); + isolate(), result, Object::Subtract(isolate(), left, right), Object); break; case Token::MUL: ASSIGN_RETURN_ON_EXCEPTION( - isolate(), result, - Object::Multiply(isolate(), left, right, state.strength()), Object); + isolate(), result, Object::Multiply(isolate(), left, right), Object); break; case Token::DIV: ASSIGN_RETURN_ON_EXCEPTION( - isolate(), result, - Object::Divide(isolate(), left, right, state.strength()), Object); + isolate(), result, Object::Divide(isolate(), left, right), Object); break; case Token::MOD: ASSIGN_RETURN_ON_EXCEPTION( - isolate(), result, - Object::Modulus(isolate(), left, right, state.strength()), Object); + isolate(), result, Object::Modulus(isolate(), left, right), Object); break; case Token::BIT_OR: ASSIGN_RETURN_ON_EXCEPTION( - isolate(), result, - Object::BitwiseOr(isolate(), left, right, state.strength()), Object); + isolate(), result, Object::BitwiseOr(isolate(), left, right), Object); break; case Token::BIT_AND: - ASSIGN_RETURN_ON_EXCEPTION( - isolate(), result, - Object::BitwiseAnd(isolate(), left, right, state.strength()), Object); + ASSIGN_RETURN_ON_EXCEPTION(isolate(), result, + Object::BitwiseAnd(isolate(), left, right), + Object); break; case Token::BIT_XOR: - ASSIGN_RETURN_ON_EXCEPTION( - isolate(), result, - Object::BitwiseXor(isolate(), left, right, state.strength()), Object); + ASSIGN_RETURN_ON_EXCEPTION(isolate(), result, + Object::BitwiseXor(isolate(), left, right), + Object); break; case Token::SAR: - ASSIGN_RETURN_ON_EXCEPTION( - isolate(), result, - Object::ShiftRight(isolate(), left, right, state.strength()), Object); + ASSIGN_RETURN_ON_EXCEPTION(isolate(), result, + Object::ShiftRight(isolate(), left, right), + Object); break; case Token::SHR: ASSIGN_RETURN_ON_EXCEPTION( - isolate(), result, - Object::ShiftRightLogical(isolate(), left, right, state.strength()), + isolate(), result, Object::ShiftRightLogical(isolate(), left, right), Object); break; case Token::SHL: ASSIGN_RETURN_ON_EXCEPTION( - isolate(), result, - Object::ShiftLeft(isolate(), left, right, state.strength()), Object); + isolate(), result, Object::ShiftLeft(isolate(), left, right), Object); break; } @@ -2624,6 +2615,7 @@ MaybeHandle<Object> BinaryOpIC::Transition( RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { TimerEventScope<TimerEventIcMiss> timer(isolate); + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); HandleScope scope(isolate); DCHECK_EQ(2, args.length()); Handle<Object> left = args.at<Object>(BinaryOpICStub::kLeft); @@ -2639,6 +2631,7 @@ RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { RUNTIME_FUNCTION(Runtime_BinaryOpIC_MissWithAllocationSite) { TimerEventScope<TimerEventIcMiss> timer(isolate); + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); HandleScope scope(isolate); DCHECK_EQ(3, args.length()); Handle<AllocationSite> allocation_site = @@ -2653,10 +2646,8 @@ RUNTIME_FUNCTION(Runtime_BinaryOpIC_MissWithAllocationSite) { return *result; } - -Code* CompareIC::GetRawUninitialized(Isolate* isolate, Token::Value op, - Strength strength) { - CompareICStub stub(isolate, op, strength, CompareICState::UNINITIALIZED, +Code* CompareIC::GetRawUninitialized(Isolate* isolate, Token::Value op) { + CompareICStub stub(isolate, op, CompareICState::UNINITIALIZED, CompareICState::UNINITIALIZED, CompareICState::UNINITIALIZED); Code* code = NULL; @@ -2664,10 +2655,8 @@ Code* CompareIC::GetRawUninitialized(Isolate* isolate, Token::Value op, return code; } - -Handle<Code> CompareIC::GetUninitialized(Isolate* isolate, Token::Value op, - Strength strength) { - CompareICStub stub(isolate, op, strength, CompareICState::UNINITIALIZED, +Handle<Code> CompareIC::GetUninitialized(Isolate* isolate, Token::Value op) { + CompareICStub stub(isolate, op, CompareICState::UNINITIALIZED, CompareICState::UNINITIALIZED, CompareICState::UNINITIALIZED); return stub.GetCode(); @@ -2684,8 +2673,7 @@ Code* CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) { CompareICState::State state = CompareICState::TargetState( old_stub.state(), old_stub.left(), old_stub.right(), op_, HasInlinedSmiCode(address()), x, y); - CompareICStub stub(isolate(), op_, old_stub.strength(), new_left, new_right, - state); + CompareICStub stub(isolate(), op_, new_left, new_right, state); if (state == CompareICState::KNOWN_RECEIVER) { stub.set_known_map( Handle<Map>(Handle<JSReceiver>::cast(x)->map(), isolate())); @@ -2718,6 +2706,7 @@ Code* CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) { // Used from CompareICStub::GenerateMiss in code-stubs-<arch>.cc. RUNTIME_FUNCTION(Runtime_CompareIC_Miss) { TimerEventScope<TimerEventIcMiss> timer(isolate); + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); HandleScope scope(isolate); DCHECK(args.length() == 3); CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); @@ -2740,15 +2729,6 @@ void CompareNilIC::Clear(Address address, Code* target, Address constant_pool) { } -Handle<Object> CompareNilIC::DoCompareNilSlow(Isolate* isolate, NilValue nil, - Handle<Object> object) { - if (object->IsNull() || object->IsUndefined()) { - return isolate->factory()->true_value(); - } - return isolate->factory()->ToBoolean(object->IsUndetectableObject()); -} - - Handle<Object> CompareNilIC::CompareNil(Handle<Object> object) { ExtraICState extra_ic_state = target()->extra_ic_state(); @@ -2760,8 +2740,6 @@ Handle<Object> CompareNilIC::CompareNil(Handle<Object> object) { stub.UpdateStatus(object); - NilValue nil = stub.nil_value(); - // Find or create the specialized stub to support the new set of types. Handle<Code> code; if (stub.IsMonomorphic()) { @@ -2773,12 +2751,13 @@ Handle<Object> CompareNilIC::CompareNil(Handle<Object> object) { code = stub.GetCode(); } set_target(*code); - return DoCompareNilSlow(isolate(), nil, object); + return isolate()->factory()->ToBoolean(object->IsUndetectableObject()); } RUNTIME_FUNCTION(Runtime_CompareNilIC_Miss) { TimerEventScope<TimerEventIcMiss> timer(isolate); + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); HandleScope scope(isolate); Handle<Object> object = args.at<Object>(0); CompareNilIC ic(isolate); @@ -2804,6 +2783,7 @@ Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { RUNTIME_FUNCTION(Runtime_ToBooleanIC_Miss) { TimerEventScope<TimerEventIcMiss> timer(isolate); + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); DCHECK(args.length() == 1); HandleScope scope(isolate); Handle<Object> object = args.at<Object>(0); @@ -2818,13 +2798,13 @@ RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) { Handle<HeapObject> callback_or_cell = args.at<HeapObject>(2); Handle<Name> name = args.at<Name>(3); Handle<Object> value = args.at<Object>(4); + CONVERT_LANGUAGE_MODE_ARG_CHECKED(language_mode, 5); HandleScope scope(isolate); - Handle<ExecutableAccessorInfo> callback( + Handle<AccessorInfo> callback( callback_or_cell->IsWeakCell() - ? ExecutableAccessorInfo::cast( - WeakCell::cast(*callback_or_cell)->value()) - : ExecutableAccessorInfo::cast(*callback_or_cell)); + ? AccessorInfo::cast(WeakCell::cast(*callback_or_cell)->value()) + : AccessorInfo::cast(*callback_or_cell)); DCHECK(callback->IsCompatibleReceiver(*receiver)); @@ -2834,8 +2814,10 @@ RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) { DCHECK(fun != NULL); LOG(isolate, ApiNamedPropertyAccess("store", *receiver, *name)); + Object::ShouldThrow should_throw = + is_sloppy(language_mode) ? Object::DONT_THROW : Object::THROW_ON_ERROR; PropertyCallbackArguments custom_args(isolate, callback->data(), *receiver, - *holder); + *holder, should_throw); custom_args.Call(fun, v8::Utils::ToLocal(name), v8::Utils::ToLocal(value)); RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate); return *value; @@ -2914,9 +2896,10 @@ RUNTIME_FUNCTION(Runtime_StorePropertyWithInterceptor) { Handle<Object> value = args.at<Object>(2); #ifdef DEBUG PrototypeIterator iter(isolate, receiver, - PrototypeIterator::START_AT_RECEIVER); + PrototypeIterator::START_AT_RECEIVER, + PrototypeIterator::END_AT_NON_HIDDEN); bool found = false; - for (; !iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN); iter.Advance()) { + for (; !iter.IsAtEnd(); iter.Advance()) { Handle<Object> current = PrototypeIterator::GetCurrent(iter); if (current->IsJSObject() && Handle<JSObject>::cast(current)->HasNamedInterceptor()) { @@ -2941,17 +2924,15 @@ RUNTIME_FUNCTION(Runtime_LoadElementWithInterceptor) { DCHECK(args.smi_at(1) >= 0); uint32_t index = args.smi_at(1); Handle<Object> result; - // TODO(conradw): Investigate strong mode semantics for this. - LanguageMode language_mode = SLOPPY; ASSIGN_RETURN_FAILURE_ON_EXCEPTION( - isolate, result, - Object::GetElement(isolate, receiver, index, language_mode)); + isolate, result, Object::GetElement(isolate, receiver, index)); return *result; } RUNTIME_FUNCTION(Runtime_LoadIC_MissFromStubFailure) { TimerEventScope<TimerEventIcMiss> timer(isolate); + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); HandleScope scope(isolate); Handle<Object> receiver = args.at<Object>(0); Handle<Name> key = args.at<Name>(1); diff --git a/deps/v8/src/ic/ic.h b/deps/v8/src/ic/ic.h index a3265d70b9..2ce182b76e 100644 --- a/deps/v8/src/ic/ic.h +++ b/deps/v8/src/ic/ic.h @@ -284,9 +284,11 @@ class CallIC : public IC { // Code generator routines. static Handle<Code> initialize_stub(Isolate* isolate, int argc, - ConvertReceiverMode mode); + ConvertReceiverMode mode, + TailCallMode tail_call_mode); static Handle<Code> initialize_stub_in_optimized_code( - Isolate* isolate, int argc, ConvertReceiverMode mode); + Isolate* isolate, int argc, ConvertReceiverMode mode, + TailCallMode tail_call_mode); static void Clear(Isolate* isolate, Code* host, CallICNexus* nexus); }; @@ -294,19 +296,14 @@ class CallIC : public IC { class LoadIC : public IC { public: - static ExtraICState ComputeExtraICState(TypeofMode typeof_mode, - LanguageMode language_mode) { - return LoadICState(typeof_mode, language_mode).GetExtraICState(); + static ExtraICState ComputeExtraICState(TypeofMode typeof_mode) { + return LoadICState(typeof_mode).GetExtraICState(); } TypeofMode typeof_mode() const { return LoadICState::GetTypeofMode(extra_ic_state()); } - LanguageMode language_mode() const { - return LoadICState::GetLanguageMode(extra_ic_state()); - } - LoadIC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus = NULL) : IC(depth, isolate, nexus) { DCHECK(nexus != NULL); @@ -321,9 +318,8 @@ class LoadIC : public IC { static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } static void GenerateMiss(MacroAssembler* masm); - static void GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode); - static void GenerateNormal(MacroAssembler* masm, LanguageMode language_mode); + static void GenerateRuntimeGetProperty(MacroAssembler* masm); + static void GenerateNormal(MacroAssembler* masm); static Handle<Code> initialize_stub(Isolate* isolate, ExtraICState extra_state); @@ -340,14 +336,10 @@ class LoadIC : public IC { Handle<Code> slow_stub() const { if (kind() == Code::LOAD_IC) { - return is_strong(language_mode()) - ? isolate()->builtins()->LoadIC_Slow_Strong() - : isolate()->builtins()->LoadIC_Slow(); + return isolate()->builtins()->LoadIC_Slow(); } else { DCHECK_EQ(Code::KEYED_LOAD_IC, kind()); - return is_strong(language_mode()) - ? isolate()->builtins()->KeyedLoadIC_Slow_Strong() - : isolate()->builtins()->KeyedLoadIC_Slow(); + return isolate()->builtins()->KeyedLoadIC_Slow(); } } @@ -377,9 +369,8 @@ class KeyedLoadIC : public LoadIC { : public BitField<IcCheckType, LoadICState::kNextBitFieldOffset, 1> {}; static ExtraICState ComputeExtraICState(TypeofMode typeof_mode, - LanguageMode language_mode, IcCheckType key_type) { - return LoadICState(typeof_mode, language_mode).GetExtraICState() | + return LoadICState(typeof_mode).GetExtraICState() | IcCheckTypeField::encode(key_type); } @@ -399,11 +390,9 @@ class KeyedLoadIC : public LoadIC { // Code generator routines. static void GenerateMiss(MacroAssembler* masm); - static void GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode); + static void GenerateRuntimeGetProperty(MacroAssembler* masm); static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } - static void GenerateMegamorphic(MacroAssembler* masm, - LanguageMode language_mode); + static void GenerateMegamorphic(MacroAssembler* masm); // Bit mask to be tested against bit field for the cases when // generic stub should go into slow case. @@ -616,8 +605,7 @@ class CompareIC : public IC { static Condition ComputeCondition(Token::Value op); // Factory method for getting an uninitialized compare stub. - static Handle<Code> GetUninitialized(Isolate* isolate, Token::Value op, - Strength strength); + static Handle<Code> GetUninitialized(Isolate* isolate, Token::Value op); private: static bool HasInlinedSmiCode(Address address); @@ -625,8 +613,7 @@ class CompareIC : public IC { bool strict() const { return op_ == Token::EQ_STRICT; } Condition GetCondition() const { return ComputeCondition(op_); } - static Code* GetRawUninitialized(Isolate* isolate, Token::Value op, - Strength strength); + static Code* GetRawUninitialized(Isolate* isolate, Token::Value op); static void Clear(Isolate* isolate, Address address, Code* target, Address constant_pool); @@ -646,9 +633,6 @@ class CompareNilIC : public IC { static Handle<Code> GetUninitialized(); static void Clear(Address address, Code* target, Address constant_pool); - - static Handle<Object> DoCompareNilSlow(Isolate* isolate, NilValue nil, - Handle<Object> object); }; diff --git a/deps/v8/src/ic/mips/handler-compiler-mips.cc b/deps/v8/src/ic/mips/handler-compiler-mips.cc index 554d0c56ff..f3af1cf537 100644 --- a/deps/v8/src/ic/mips/handler-compiler-mips.cc +++ b/deps/v8/src/ic/mips/handler-compiler-mips.cc @@ -4,8 +4,10 @@ #if V8_TARGET_ARCH_MIPS -#include "src/ic/call-optimization.h" #include "src/ic/handler-compiler.h" + +#include "src/field-type.h" +#include "src/ic/call-optimization.h" #include "src/ic/ic.h" #include "src/isolate-inl.h" @@ -279,9 +281,16 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( call_data_undefined = true; __ LoadRoot(data, Heap::kUndefinedValueRootIndex); } else { - __ lw(data, FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); - __ lw(data, FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); - __ lw(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + if (optimization.is_constant_call()) { + __ lw(data, + FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); + __ lw(data, + FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); + __ lw(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + } else { + __ lw(data, + FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); + } __ lw(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); } @@ -299,7 +308,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( __ li(api_function_address, Operand(ref)); // Jump to stub. - CallApiAccessorStub stub(isolate, is_store, call_data_undefined); + CallApiAccessorStub stub(isolate, is_store, call_data_undefined, + !optimization.is_constant_call()); __ TailCallStub(&stub); } @@ -383,8 +393,7 @@ void NamedStoreHandlerCompiler::GenerateConstantCheck(Register map_reg, __ Branch(miss_label, ne, value_reg, Operand(scratch)); } - -void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, +void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, Register value_reg, Label* miss_label) { Register map_reg = scratch1(); @@ -392,21 +401,11 @@ void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, DCHECK(!value_reg.is(map_reg)); DCHECK(!value_reg.is(scratch)); __ JumpIfSmi(value_reg, miss_label); - HeapType::Iterator<Map> it = field_type->Classes(); - if (!it.Done()) { + if (field_type->IsClass()) { __ lw(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); - Label do_store; - while (true) { - // Compare map directly within the Branch() functions. - __ GetWeakValue(scratch, Map::WeakCellForMap(it.Current())); - it.Advance(); - if (it.Done()) { - __ Branch(miss_label, ne, map_reg, Operand(scratch)); - break; - } - __ Branch(&do_store, eq, map_reg, Operand(scratch)); - } - __ bind(&do_store); + // Compare map directly within the Branch() functions. + __ GetWeakValue(scratch, Map::WeakCellForMap(field_type->AsClass())); + __ Branch(miss_label, ne, map_reg, Operand(scratch)); } } @@ -584,42 +583,51 @@ void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { void NamedLoadHandlerCompiler::GenerateLoadCallback( - Register reg, Handle<ExecutableAccessorInfo> callback) { - // Build AccessorInfo::args_ list on the stack and push property name below - // the exit frame to make GC aware of them and store pointers to them. - STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0); - STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 1); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 2); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 3); - STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4); - STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5); - STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 6); - DCHECK(!scratch2().is(reg)); - DCHECK(!scratch3().is(reg)); - DCHECK(!scratch4().is(reg)); - __ push(receiver()); + Register reg, Handle<AccessorInfo> callback) { + DCHECK(!AreAliased(scratch2(), scratch3(), scratch4(), receiver())); + DCHECK(!AreAliased(scratch2(), scratch3(), scratch4(), reg)); + + // Build v8::PropertyCallbackInfo::args_ array on the stack and push property + // name below the exit frame to make GC aware of them. + STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0); + STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1); + STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4); + STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5); + STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6); + STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7); + + // Here and below +1 is for name() pushed after the args_ array. + typedef PropertyCallbackArguments PCA; + __ Subu(sp, sp, (PCA::kArgsLength + 1) * kPointerSize); + __ sw(receiver(), MemOperand(sp, (PCA::kThisIndex + 1) * kPointerSize)); Handle<Object> data(callback->data(), isolate()); if (data->IsUndefined() || data->IsSmi()) { - __ li(scratch3(), data); + __ li(scratch2(), data); } else { Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(Handle<HeapObject>::cast(data)); // The callback is alive if this instruction is executed, // so the weak cell is not cleared and points to data. - __ GetWeakValue(scratch3(), cell); + __ GetWeakValue(scratch2(), cell); } - __ Subu(sp, sp, 6 * kPointerSize); - __ sw(scratch3(), MemOperand(sp, 5 * kPointerSize)); - __ LoadRoot(scratch3(), Heap::kUndefinedValueRootIndex); - __ sw(scratch3(), MemOperand(sp, 4 * kPointerSize)); - __ sw(scratch3(), MemOperand(sp, 3 * kPointerSize)); - __ li(scratch4(), Operand(ExternalReference::isolate_address(isolate()))); - __ sw(scratch4(), MemOperand(sp, 2 * kPointerSize)); - __ sw(reg, MemOperand(sp, 1 * kPointerSize)); + __ sw(scratch2(), MemOperand(sp, (PCA::kDataIndex + 1) * kPointerSize)); + __ LoadRoot(scratch2(), Heap::kUndefinedValueRootIndex); + __ sw(scratch2(), + MemOperand(sp, (PCA::kReturnValueOffset + 1) * kPointerSize)); + __ sw(scratch2(), MemOperand(sp, (PCA::kReturnValueDefaultValueIndex + 1) * + kPointerSize)); + __ li(scratch2(), Operand(ExternalReference::isolate_address(isolate()))); + __ sw(scratch2(), MemOperand(sp, (PCA::kIsolateIndex + 1) * kPointerSize)); + __ sw(reg, MemOperand(sp, (PCA::kHolderIndex + 1) * kPointerSize)); + // should_throw_on_error -> false + DCHECK(Smi::FromInt(0) == nullptr); + __ sw(zero_reg, + MemOperand(sp, (PCA::kShouldThrowOnErrorIndex + 1) * kPointerSize)); + __ sw(name(), MemOperand(sp, 0 * kPointerSize)); - __ Addu(scratch2(), sp, 1 * kPointerSize); - __ mov(a2, scratch2()); // Saved in case scratch2 == a1. // Abi for CallApiGetter. Register getter_address_reg = ApiGetterDescriptor::function_address(); @@ -705,8 +713,8 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( - Handle<JSObject> object, Handle<Name> name, - Handle<ExecutableAccessorInfo> callback) { + Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, + LanguageMode language_mode) { Register holder_reg = Frontend(name); __ Push(receiver(), holder_reg); // Receiver. @@ -721,6 +729,7 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( __ push(at); __ li(at, Operand(name)); __ Push(at, value()); + __ Push(Smi::FromInt(language_mode)); // Do tail-call to the runtime system. __ TailCallRuntime(Runtime::kStoreCallbackProperty); @@ -769,7 +778,7 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( } Counters* counters = isolate()->counters(); - __ IncrementCounter(counters->named_load_global_stub(), 1, a1, a3); + __ IncrementCounter(counters->ic_named_load_global_stub(), 1, a1, a3); if (IC::ICUseVector(kind())) { DiscardVectorAndSlot(); } diff --git a/deps/v8/src/ic/mips/ic-mips.cc b/deps/v8/src/ic/mips/ic-mips.cc index a27d6b56f7..ae3615e3bb 100644 --- a/deps/v8/src/ic/mips/ic-mips.cc +++ b/deps/v8/src/ic/mips/ic-mips.cc @@ -159,8 +159,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm, static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, Register key, Register elements, Register scratch1, Register scratch2, - Register result, Label* slow, - LanguageMode language_mode) { + Register result, Label* slow) { // Register use: // // receiver - holds the receiver on entry. @@ -216,13 +215,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, __ Branch(&check_next_prototype); __ bind(&absent); - if (is_strong(language_mode)) { - // Strong mode accesses must throw in this case, so call the runtime. - __ Branch(slow); - } else { - __ LoadRoot(result, Heap::kUndefinedValueRootIndex); - __ Branch(&done); - } + __ LoadRoot(result, Heap::kUndefinedValueRootIndex); + __ Branch(&done); __ bind(&in_bounds); // Fast case: Do the load. @@ -230,8 +224,7 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); // The key is a smi. STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); - __ sll(at, key, kPointerSizeLog2 - kSmiTagSize); - __ addu(at, at, scratch1); + __ Lsa(at, scratch1, key, kPointerSizeLog2 - kSmiTagSize); __ lw(scratch2, MemOperand(at)); __ LoadRoot(at, Heap::kTheHoleValueRootIndex); @@ -271,8 +264,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key, __ bind(&unique); } - -void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { +void LoadIC::GenerateNormal(MacroAssembler* masm) { Register dictionary = a0; DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); @@ -287,7 +279,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { // Dictionary load failed, go slow (but don't miss). __ bind(&slow); - GenerateRuntimeGetProperty(masm, language_mode); + GenerateRuntimeGetProperty(masm); } @@ -311,7 +303,7 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { DCHECK(!AreAliased(t0, t1, LoadWithVectorDescriptor::SlotRegister(), LoadWithVectorDescriptor::VectorRegister())); - __ IncrementCounter(isolate->counters()->load_miss(), 1, t0, t1); + __ IncrementCounter(isolate->counters()->ic_load_miss(), 1, t0, t1); LoadIC_PushArgs(masm); @@ -319,17 +311,14 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kLoadIC_Miss); } - -void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is in ra. __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong - : Runtime::kGetProperty); + __ TailCallRuntime(Runtime::kGetProperty); } @@ -339,7 +328,7 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { DCHECK(!AreAliased(t0, t1, LoadWithVectorDescriptor::SlotRegister(), LoadWithVectorDescriptor::VectorRegister())); - __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, t0, t1); + __ IncrementCounter(isolate->counters()->ic_keyed_load_miss(), 1, t0, t1); LoadIC_PushArgs(masm); @@ -347,21 +336,16 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); } - -void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is in ra. __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong - : Runtime::kKeyedGetProperty); + __ TailCallRuntime(Runtime::kKeyedGetProperty); } - -void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) { // The return address is in ra. Label slow, check_name, index_smi, index_name, property_array_property; Label probe_dictionary, check_number_dictionary; @@ -385,9 +369,9 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, // Check the receiver's map to see if it has fast elements. __ CheckFastElements(a0, a3, &check_number_dictionary); - GenerateFastArrayLoad(masm, receiver, key, a0, a3, t0, v0, &slow, - language_mode); - __ IncrementCounter(isolate->counters()->keyed_load_generic_smi(), 1, t0, a3); + GenerateFastArrayLoad(masm, receiver, key, a0, a3, t0, v0, &slow); + __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_smi(), 1, t0, + a3); __ Ret(); __ bind(&check_number_dictionary); @@ -405,9 +389,9 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, // Slow case, key and receiver still in a2 and a1. __ bind(&slow); - __ IncrementCounter(isolate->counters()->keyed_load_generic_slow(), 1, t0, + __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_slow(), 1, t0, a3); - GenerateRuntimeGetProperty(masm, language_mode); + GenerateRuntimeGetProperty(masm); __ bind(&check_name); GenerateKeyNameCheck(masm, key, a0, a3, &index_name, &slow); @@ -451,8 +435,8 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, GenerateGlobalInstanceTypeCheck(masm, a0, &slow); // Load the property to v0. GenerateDictionaryLoad(masm, &slow, a3, key, v0, t1, t0); - __ IncrementCounter(isolate->counters()->keyed_load_generic_symbol(), 1, t0, - a3); + __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_symbol(), 1, + t0, a3); __ Ret(); __ bind(&index_name); @@ -491,8 +475,7 @@ static void KeyedStoreGenerateMegamorphicHelper( // there may be a callback on the element. Label holecheck_passed1; __ Addu(address, elements, FixedArray::kHeaderSize - kHeapObjectTag); - __ sll(at, key, kPointerSizeLog2 - kSmiTagSize); - __ addu(address, address, at); + __ Lsa(address, address, key, kPointerSizeLog2 - kSmiTagSize); __ lw(scratch, MemOperand(address)); __ Branch(&holecheck_passed1, ne, scratch, Operand(masm->isolate()->factory()->the_hole_value())); @@ -511,8 +494,7 @@ static void KeyedStoreGenerateMegamorphicHelper( } // It's irrelevant whether array is smi-only or not when writing a smi. __ Addu(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); - __ sll(scratch, key, kPointerSizeLog2 - kSmiTagSize); - __ Addu(address, address, scratch); + __ Lsa(address, address, key, kPointerSizeLog2 - kSmiTagSize); __ sw(value, MemOperand(address)); __ Ret(); @@ -528,8 +510,7 @@ static void KeyedStoreGenerateMegamorphicHelper( __ sw(scratch, FieldMemOperand(receiver, JSArray::kLengthOffset)); } __ Addu(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); - __ sll(scratch, key, kPointerSizeLog2 - kSmiTagSize); - __ Addu(address, address, scratch); + __ Lsa(address, address, key, kPointerSizeLog2 - kSmiTagSize); __ sw(value, MemOperand(address)); // Update write barrier for the elements array address. __ mov(scratch, value); // Preserve the value which is returned. @@ -550,8 +531,7 @@ static void KeyedStoreGenerateMegamorphicHelper( // go to the runtime. __ Addu(address, elements, Operand(FixedDoubleArray::kHeaderSize + kHoleNanUpper32Offset - kHeapObjectTag)); - __ sll(at, key, kPointerSizeLog2); - __ addu(address, address, at); + __ Lsa(address, address, key, kPointerSizeLog2); __ lw(scratch, MemOperand(address)); __ Branch(&fast_double_without_map_check, ne, scratch, Operand(kHoleNanUpper32)); @@ -791,11 +771,11 @@ void StoreIC::GenerateNormal(MacroAssembler* masm) { GenerateDictionaryStore(masm, &miss, dictionary, name, value, t2, t5); Counters* counters = masm->isolate()->counters(); - __ IncrementCounter(counters->store_normal_hit(), 1, t2, t5); + __ IncrementCounter(counters->ic_store_normal_hit(), 1, t2, t5); __ Ret(); __ bind(&miss); - __ IncrementCounter(counters->store_normal_miss(), 1, t2, t5); + __ IncrementCounter(counters->ic_store_normal_miss(), 1, t2, t5); GenerateMiss(masm); } diff --git a/deps/v8/src/ic/mips/stub-cache-mips.cc b/deps/v8/src/ic/mips/stub-cache-mips.cc index 1a9897e8f3..039763c4cf 100644 --- a/deps/v8/src/ic/mips/stub-cache-mips.cc +++ b/deps/v8/src/ic/mips/stub-cache-mips.cc @@ -42,13 +42,11 @@ static void ProbeTable(Isolate* isolate, MacroAssembler* masm, scratch = no_reg; // Multiply by 3 because there are 3 fields per entry (name, code, map). - __ sll(offset_scratch, offset, 1); - __ Addu(offset_scratch, offset_scratch, offset); + __ Lsa(offset_scratch, offset, offset, 1); // Calculate the base address of the entry. __ li(base_addr, Operand(key_offset)); - __ sll(at, offset_scratch, kPointerSizeLog2); - __ Addu(base_addr, base_addr, at); + __ Lsa(base_addr, base_addr, offset_scratch, kPointerSizeLog2); // Check that the key in the entry matches the name. __ lw(at, MemOperand(base_addr, 0)); diff --git a/deps/v8/src/ic/mips64/handler-compiler-mips64.cc b/deps/v8/src/ic/mips64/handler-compiler-mips64.cc index d94a292228..968effdd7f 100644 --- a/deps/v8/src/ic/mips64/handler-compiler-mips64.cc +++ b/deps/v8/src/ic/mips64/handler-compiler-mips64.cc @@ -4,8 +4,10 @@ #if V8_TARGET_ARCH_MIPS64 -#include "src/ic/call-optimization.h" #include "src/ic/handler-compiler.h" + +#include "src/field-type.h" +#include "src/ic/call-optimization.h" #include "src/ic/ic.h" #include "src/isolate-inl.h" @@ -279,9 +281,16 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( call_data_undefined = true; __ LoadRoot(data, Heap::kUndefinedValueRootIndex); } else { - __ ld(data, FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); - __ ld(data, FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); - __ ld(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + if (optimization.is_constant_call()) { + __ ld(data, + FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); + __ ld(data, + FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); + __ ld(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + } else { + __ ld(data, + FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); + } __ ld(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); } @@ -299,7 +308,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( __ li(api_function_address, Operand(ref)); // Jump to stub. - CallApiAccessorStub stub(isolate, is_store, call_data_undefined); + CallApiAccessorStub stub(isolate, is_store, call_data_undefined, + !optimization.is_constant_call()); __ TailCallStub(&stub); } @@ -383,8 +393,7 @@ void NamedStoreHandlerCompiler::GenerateConstantCheck(Register map_reg, __ Branch(miss_label, ne, value_reg, Operand(scratch)); } - -void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, +void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, Register value_reg, Label* miss_label) { Register map_reg = scratch1(); @@ -392,21 +401,11 @@ void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, DCHECK(!value_reg.is(map_reg)); DCHECK(!value_reg.is(scratch)); __ JumpIfSmi(value_reg, miss_label); - HeapType::Iterator<Map> it = field_type->Classes(); - if (!it.Done()) { + if (field_type->IsClass()) { __ ld(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); - Label do_store; - while (true) { - // Compare map directly within the Branch() functions. - __ GetWeakValue(scratch, Map::WeakCellForMap(it.Current())); - it.Advance(); - if (it.Done()) { - __ Branch(miss_label, ne, map_reg, Operand(scratch)); - break; - } - __ Branch(&do_store, eq, map_reg, Operand(scratch)); - } - __ bind(&do_store); + // Compare map directly within the Branch() functions. + __ GetWeakValue(scratch, Map::WeakCellForMap(field_type->AsClass())); + __ Branch(miss_label, ne, map_reg, Operand(scratch)); } } @@ -584,42 +583,51 @@ void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { void NamedLoadHandlerCompiler::GenerateLoadCallback( - Register reg, Handle<ExecutableAccessorInfo> callback) { - // Build AccessorInfo::args_ list on the stack and push property name below - // the exit frame to make GC aware of them and store pointers to them. - STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0); - STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 1); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 2); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 3); - STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4); - STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5); - STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 6); - DCHECK(!scratch2().is(reg)); - DCHECK(!scratch3().is(reg)); - DCHECK(!scratch4().is(reg)); - __ push(receiver()); + Register reg, Handle<AccessorInfo> callback) { + DCHECK(!AreAliased(scratch2(), scratch3(), scratch4(), receiver())); + DCHECK(!AreAliased(scratch2(), scratch3(), scratch4(), reg)); + + // Build v8::PropertyCallbackInfo::args_ array on the stack and push property + // name below the exit frame to make GC aware of them. + STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0); + STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1); + STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4); + STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5); + STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6); + STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7); + + // Here and below +1 is for name() pushed after the args_ array. + typedef PropertyCallbackArguments PCA; + __ Dsubu(sp, sp, (PCA::kArgsLength + 1) * kPointerSize); + __ sd(receiver(), MemOperand(sp, (PCA::kThisIndex + 1) * kPointerSize)); Handle<Object> data(callback->data(), isolate()); if (data->IsUndefined() || data->IsSmi()) { - __ li(scratch3(), data); + __ li(scratch2(), data); } else { Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(Handle<HeapObject>::cast(data)); // The callback is alive if this instruction is executed, // so the weak cell is not cleared and points to data. - __ GetWeakValue(scratch3(), cell); + __ GetWeakValue(scratch2(), cell); } - __ Dsubu(sp, sp, 6 * kPointerSize); - __ sd(scratch3(), MemOperand(sp, 5 * kPointerSize)); - __ LoadRoot(scratch3(), Heap::kUndefinedValueRootIndex); - __ sd(scratch3(), MemOperand(sp, 4 * kPointerSize)); - __ sd(scratch3(), MemOperand(sp, 3 * kPointerSize)); - __ li(scratch4(), Operand(ExternalReference::isolate_address(isolate()))); - __ sd(scratch4(), MemOperand(sp, 2 * kPointerSize)); - __ sd(reg, MemOperand(sp, 1 * kPointerSize)); + __ sd(scratch2(), MemOperand(sp, (PCA::kDataIndex + 1) * kPointerSize)); + __ LoadRoot(scratch2(), Heap::kUndefinedValueRootIndex); + __ sd(scratch2(), + MemOperand(sp, (PCA::kReturnValueOffset + 1) * kPointerSize)); + __ sd(scratch2(), MemOperand(sp, (PCA::kReturnValueDefaultValueIndex + 1) * + kPointerSize)); + __ li(scratch2(), Operand(ExternalReference::isolate_address(isolate()))); + __ sd(scratch2(), MemOperand(sp, (PCA::kIsolateIndex + 1) * kPointerSize)); + __ sd(reg, MemOperand(sp, (PCA::kHolderIndex + 1) * kPointerSize)); + // should_throw_on_error -> false + DCHECK(Smi::FromInt(0) == nullptr); + __ sd(zero_reg, + MemOperand(sp, (PCA::kShouldThrowOnErrorIndex + 1) * kPointerSize)); + __ sd(name(), MemOperand(sp, 0 * kPointerSize)); - __ Daddu(scratch2(), sp, 1 * kPointerSize); - __ mov(a2, scratch2()); // Saved in case scratch2 == a1. // Abi for CallApiGetter. Register getter_address_reg = ApiGetterDescriptor::function_address(); @@ -705,8 +713,8 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( - Handle<JSObject> object, Handle<Name> name, - Handle<ExecutableAccessorInfo> callback) { + Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, + LanguageMode language_mode) { Register holder_reg = Frontend(name); __ Push(receiver(), holder_reg); // Receiver. @@ -721,6 +729,7 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( __ push(at); __ li(at, Operand(name)); __ Push(at, value()); + __ Push(Smi::FromInt(language_mode)); // Do tail-call to the runtime system. __ TailCallRuntime(Runtime::kStoreCallbackProperty); @@ -769,7 +778,7 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( } Counters* counters = isolate()->counters(); - __ IncrementCounter(counters->named_load_global_stub(), 1, a1, a3); + __ IncrementCounter(counters->ic_named_load_global_stub(), 1, a1, a3); if (IC::ICUseVector(kind())) { DiscardVectorAndSlot(); } diff --git a/deps/v8/src/ic/mips64/ic-mips64.cc b/deps/v8/src/ic/mips64/ic-mips64.cc index c5da5fbb42..f46c9dcb26 100644 --- a/deps/v8/src/ic/mips64/ic-mips64.cc +++ b/deps/v8/src/ic/mips64/ic-mips64.cc @@ -158,8 +158,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm, static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, Register key, Register elements, Register scratch1, Register scratch2, - Register result, Label* slow, - LanguageMode language_mode) { + Register result, Label* slow) { // Register use: // // receiver - holds the receiver on entry. @@ -215,12 +214,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, __ Branch(&check_next_prototype); __ bind(&absent); - if (is_strong(language_mode)) { - __ Branch(slow); - } else { - __ LoadRoot(result, Heap::kUndefinedValueRootIndex); - __ Branch(&done); - } + __ LoadRoot(result, Heap::kUndefinedValueRootIndex); + __ Branch(&done); __ bind(&in_bounds); // Fast case: Do the load. @@ -269,8 +264,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key, __ bind(&unique); } - -void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { +void LoadIC::GenerateNormal(MacroAssembler* masm) { Register dictionary = a0; DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); @@ -284,7 +278,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { // Dictionary load failed, go slow (but don't miss). __ bind(&slow); - GenerateRuntimeGetProperty(masm, language_mode); + GenerateRuntimeGetProperty(masm); } @@ -308,7 +302,7 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { DCHECK(!AreAliased(a4, a5, LoadWithVectorDescriptor::SlotRegister(), LoadWithVectorDescriptor::VectorRegister())); - __ IncrementCounter(isolate->counters()->load_miss(), 1, a4, a5); + __ IncrementCounter(isolate->counters()->ic_load_miss(), 1, a4, a5); LoadIC_PushArgs(masm); @@ -316,17 +310,14 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kLoadIC_Miss); } - -void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is in ra. __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong - : Runtime::kGetProperty); + __ TailCallRuntime(Runtime::kGetProperty); } @@ -336,7 +327,7 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { DCHECK(!AreAliased(a4, a5, LoadWithVectorDescriptor::SlotRegister(), LoadWithVectorDescriptor::VectorRegister())); - __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, a4, a5); + __ IncrementCounter(isolate->counters()->ic_keyed_load_miss(), 1, a4, a5); LoadIC_PushArgs(masm); @@ -344,21 +335,16 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); } - -void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is in ra. __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong - : Runtime::kKeyedGetProperty); + __ TailCallRuntime(Runtime::kKeyedGetProperty); } - -void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) { // The return address is in ra. Label slow, check_name, index_smi, index_name, property_array_property; Label probe_dictionary, check_number_dictionary; @@ -382,9 +368,9 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, // Check the receiver's map to see if it has fast elements. __ CheckFastElements(a0, a3, &check_number_dictionary); - GenerateFastArrayLoad(masm, receiver, key, a0, a3, a4, v0, &slow, - language_mode); - __ IncrementCounter(isolate->counters()->keyed_load_generic_smi(), 1, a4, a3); + GenerateFastArrayLoad(masm, receiver, key, a0, a3, a4, v0, &slow); + __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_smi(), 1, a4, + a3); __ Ret(); __ bind(&check_number_dictionary); @@ -402,9 +388,9 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, // Slow case, key and receiver still in a2 and a1. __ bind(&slow); - __ IncrementCounter(isolate->counters()->keyed_load_generic_slow(), 1, a4, + __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_slow(), 1, a4, a3); - GenerateRuntimeGetProperty(masm, language_mode); + GenerateRuntimeGetProperty(masm); __ bind(&check_name); GenerateKeyNameCheck(masm, key, a0, a3, &index_name, &slow); @@ -448,8 +434,8 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, GenerateGlobalInstanceTypeCheck(masm, a0, &slow); // Load the property to v0. GenerateDictionaryLoad(masm, &slow, a3, key, v0, a5, a4); - __ IncrementCounter(isolate->counters()->keyed_load_generic_symbol(), 1, a4, - a3); + __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_symbol(), 1, + a4, a3); __ Ret(); __ bind(&index_name); @@ -787,11 +773,11 @@ void StoreIC::GenerateNormal(MacroAssembler* masm) { GenerateDictionaryStore(masm, &miss, dictionary, name, value, a6, a7); Counters* counters = masm->isolate()->counters(); - __ IncrementCounter(counters->store_normal_hit(), 1, a6, a7); + __ IncrementCounter(counters->ic_store_normal_hit(), 1, a6, a7); __ Ret(); __ bind(&miss); - __ IncrementCounter(counters->store_normal_miss(), 1, a6, a7); + __ IncrementCounter(counters->ic_store_normal_miss(), 1, a6, a7); GenerateMiss(masm); } diff --git a/deps/v8/src/ic/mips64/stub-cache-mips64.cc b/deps/v8/src/ic/mips64/stub-cache-mips64.cc index 4ab9f8e5b2..0bd7dd0f2d 100644 --- a/deps/v8/src/ic/mips64/stub-cache-mips64.cc +++ b/deps/v8/src/ic/mips64/stub-cache-mips64.cc @@ -42,13 +42,11 @@ static void ProbeTable(Isolate* isolate, MacroAssembler* masm, scratch = no_reg; // Multiply by 3 because there are 3 fields per entry (name, code, map). - __ dsll(offset_scratch, offset, 1); - __ Daddu(offset_scratch, offset_scratch, offset); + __ Dlsa(offset_scratch, offset, offset, 1); // Calculate the base address of the entry. __ li(base_addr, Operand(key_offset)); - __ dsll(at, offset_scratch, kPointerSizeLog2); - __ Daddu(base_addr, base_addr, at); + __ Dlsa(base_addr, base_addr, offset_scratch, kPointerSizeLog2); // Check that the key in the entry matches the name. __ ld(at, MemOperand(base_addr, 0)); diff --git a/deps/v8/src/ic/ppc/handler-compiler-ppc.cc b/deps/v8/src/ic/ppc/handler-compiler-ppc.cc index 8b48755bbf..6e7d78afd3 100644 --- a/deps/v8/src/ic/ppc/handler-compiler-ppc.cc +++ b/deps/v8/src/ic/ppc/handler-compiler-ppc.cc @@ -4,8 +4,10 @@ #if V8_TARGET_ARCH_PPC -#include "src/ic/call-optimization.h" #include "src/ic/handler-compiler.h" + +#include "src/field-type.h" +#include "src/ic/call-optimization.h" #include "src/ic/ic.h" #include "src/isolate-inl.h" @@ -284,12 +286,17 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( call_data_undefined = true; __ LoadRoot(data, Heap::kUndefinedValueRootIndex); } else { - __ LoadP(data, - FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); - __ LoadP(data, - FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); - __ LoadP(data, - FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + if (optimization.is_constant_call()) { + __ LoadP(data, + FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); + __ LoadP(data, + FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); + __ LoadP(data, + FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + } else { + __ LoadP(data, + FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); + } __ LoadP(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); } @@ -308,7 +315,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( __ mov(api_function_address, Operand(ref)); // Jump to stub. - CallApiAccessorStub stub(isolate, is_store, call_data_undefined); + CallApiAccessorStub stub(isolate, is_store, call_data_undefined, + !optimization.is_constant_call()); __ TailCallStub(&stub); } @@ -393,8 +401,7 @@ void NamedStoreHandlerCompiler::GenerateConstantCheck(Register map_reg, __ bne(miss_label); } - -void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, +void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, Register value_reg, Label* miss_label) { Register map_reg = scratch1(); @@ -402,20 +409,11 @@ void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, DCHECK(!value_reg.is(map_reg)); DCHECK(!value_reg.is(scratch)); __ JumpIfSmi(value_reg, miss_label); - HeapType::Iterator<Map> it = field_type->Classes(); - if (!it.Done()) { + if (field_type->IsClass()) { __ LoadP(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); - Label do_store; - while (true) { - __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); - it.Advance(); - if (it.Done()) { - __ bne(miss_label); - break; - } - __ beq(&do_store); - } - __ bind(&do_store); + __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), + scratch); + __ bne(miss_label); } } @@ -592,38 +590,40 @@ void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { void NamedLoadHandlerCompiler::GenerateLoadCallback( - Register reg, Handle<ExecutableAccessorInfo> callback) { - // Build AccessorInfo::args_ list on the stack and push property name below - // the exit frame to make GC aware of them and store pointers to them. - STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0); - STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 1); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 2); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 3); - STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4); - STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5); - STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 6); - DCHECK(!scratch2().is(reg)); - DCHECK(!scratch3().is(reg)); - DCHECK(!scratch4().is(reg)); + Register reg, Handle<AccessorInfo> callback) { + DCHECK(!AreAliased(scratch2(), scratch3(), scratch4(), receiver())); + DCHECK(!AreAliased(scratch2(), scratch3(), scratch4(), reg)); + + // Build v8::PropertyCallbackInfo::args_ array on the stack and push property + // name below the exit frame to make GC aware of them. + STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0); + STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1); + STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4); + STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5); + STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6); + STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7); + __ push(receiver()); - // Push data from ExecutableAccessorInfo. + // Push data from AccessorInfo. Handle<Object> data(callback->data(), isolate()); if (data->IsUndefined() || data->IsSmi()) { - __ Move(scratch3(), data); + __ Move(scratch2(), data); } else { Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(Handle<HeapObject>::cast(data)); // The callback is alive if this instruction is executed, // so the weak cell is not cleared and points to data. - __ GetWeakValue(scratch3(), cell); + __ GetWeakValue(scratch2(), cell); } - __ push(scratch3()); - __ LoadRoot(scratch3(), Heap::kUndefinedValueRootIndex); - __ mr(scratch4(), scratch3()); - __ Push(scratch3(), scratch4()); - __ mov(scratch4(), Operand(ExternalReference::isolate_address(isolate()))); - __ Push(scratch4(), reg); - __ push(name()); + __ push(scratch2()); + __ LoadRoot(scratch2(), Heap::kUndefinedValueRootIndex); + __ Push(scratch2(), scratch2()); + __ mov(scratch2(), Operand(ExternalReference::isolate_address(isolate()))); + // should_throw_on_error -> false + __ mov(scratch3(), Operand(Smi::FromInt(0))); + __ Push(scratch2(), reg, scratch3(), name()); // Abi for CallApiGetter Register getter_address_reg = ApiGetterDescriptor::function_address(); @@ -711,8 +711,8 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( - Handle<JSObject> object, Handle<Name> name, - Handle<ExecutableAccessorInfo> callback) { + Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, + LanguageMode language_mode) { Register holder_reg = Frontend(name); __ Push(receiver(), holder_reg); // receiver @@ -728,6 +728,7 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( __ push(ip); __ mov(ip, Operand(name)); __ Push(ip, value()); + __ Push(Smi::FromInt(language_mode)); // Do tail-call to the runtime system. __ TailCallRuntime(Runtime::kStoreCallbackProperty); @@ -776,7 +777,7 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( } Counters* counters = isolate()->counters(); - __ IncrementCounter(counters->named_load_global_stub(), 1, r4, r6); + __ IncrementCounter(counters->ic_named_load_global_stub(), 1, r4, r6); if (IC::ICUseVector(kind())) { DiscardVectorAndSlot(); } diff --git a/deps/v8/src/ic/ppc/ic-ppc.cc b/deps/v8/src/ic/ppc/ic-ppc.cc index 78daac2657..567296c4c5 100644 --- a/deps/v8/src/ic/ppc/ic-ppc.cc +++ b/deps/v8/src/ic/ppc/ic-ppc.cc @@ -163,8 +163,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm, static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, Register key, Register elements, Register scratch1, Register scratch2, - Register result, Label* slow, - LanguageMode language_mode) { + Register result, Label* slow) { // Register use: // // receiver - holds the receiver on entry. @@ -221,13 +220,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, __ jmp(&check_next_prototype); __ bind(&absent); - if (is_strong(language_mode)) { - // Strong mode accesses must throw in this case, so call the runtime. - __ jmp(slow); - } else { - __ LoadRoot(result, Heap::kUndefinedValueRootIndex); - __ jmp(&done); - } + __ LoadRoot(result, Heap::kUndefinedValueRootIndex); + __ jmp(&done); __ bind(&in_bounds); // Fast case: Do the load. @@ -274,8 +268,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key, __ bind(&unique); } - -void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { +void LoadIC::GenerateNormal(MacroAssembler* masm) { Register dictionary = r3; DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); @@ -290,7 +283,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { // Dictionary load failed, go slow (but don't miss). __ bind(&slow); - GenerateRuntimeGetProperty(masm, language_mode); + GenerateRuntimeGetProperty(masm); } @@ -314,7 +307,7 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { DCHECK(!AreAliased(r7, r8, LoadWithVectorDescriptor::SlotRegister(), LoadWithVectorDescriptor::VectorRegister())); - __ IncrementCounter(isolate->counters()->load_miss(), 1, r7, r8); + __ IncrementCounter(isolate->counters()->ic_load_miss(), 1, r7, r8); LoadIC_PushArgs(masm); @@ -322,17 +315,14 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kLoadIC_Miss); } - -void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is in lr. __ mr(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong - : Runtime::kGetProperty); + __ TailCallRuntime(Runtime::kGetProperty); } @@ -342,7 +332,7 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { DCHECK(!AreAliased(r7, r8, LoadWithVectorDescriptor::SlotRegister(), LoadWithVectorDescriptor::VectorRegister())); - __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r7, r8); + __ IncrementCounter(isolate->counters()->ic_keyed_load_miss(), 1, r7, r8); LoadIC_PushArgs(masm); @@ -350,21 +340,16 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); } - -void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is in lr. __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong - : Runtime::kKeyedGetProperty); + __ TailCallRuntime(Runtime::kKeyedGetProperty); } - -void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) { // The return address is in lr. Label slow, check_name, index_smi, index_name, property_array_property; Label probe_dictionary, check_number_dictionary; @@ -388,9 +373,9 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, // Check the receiver's map to see if it has fast elements. __ CheckFastElements(r3, r6, &check_number_dictionary); - GenerateFastArrayLoad(masm, receiver, key, r3, r6, r7, r3, &slow, - language_mode); - __ IncrementCounter(isolate->counters()->keyed_load_generic_smi(), 1, r7, r6); + GenerateFastArrayLoad(masm, receiver, key, r3, r6, r7, r3, &slow); + __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_smi(), 1, r7, + r6); __ Ret(); __ bind(&check_number_dictionary); @@ -409,9 +394,9 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, // Slow case, key and receiver still in r3 and r4. __ bind(&slow); - __ IncrementCounter(isolate->counters()->keyed_load_generic_slow(), 1, r7, + __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_slow(), 1, r7, r6); - GenerateRuntimeGetProperty(masm, language_mode); + GenerateRuntimeGetProperty(masm); __ bind(&check_name); GenerateKeyNameCheck(masm, key, r3, r6, &index_name, &slow); @@ -456,8 +441,8 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, GenerateGlobalInstanceTypeCheck(masm, r3, &slow); // Load the property to r3. GenerateDictionaryLoad(masm, &slow, r6, key, r3, r8, r7); - __ IncrementCounter(isolate->counters()->keyed_load_generic_symbol(), 1, r7, - r6); + __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_symbol(), 1, + r7, r6); __ Ret(); __ bind(&index_name); @@ -797,11 +782,11 @@ void StoreIC::GenerateNormal(MacroAssembler* masm) { GenerateDictionaryStore(masm, &miss, dictionary, name, value, r9, r10); Counters* counters = masm->isolate()->counters(); - __ IncrementCounter(counters->store_normal_hit(), 1, r9, r10); + __ IncrementCounter(counters->ic_store_normal_hit(), 1, r9, r10); __ Ret(); __ bind(&miss); - __ IncrementCounter(counters->store_normal_miss(), 1, r9, r10); + __ IncrementCounter(counters->ic_store_normal_miss(), 1, r9, r10); GenerateMiss(masm); } diff --git a/deps/v8/src/ic/x64/handler-compiler-x64.cc b/deps/v8/src/ic/x64/handler-compiler-x64.cc index c09eca68dd..ac3dd9a367 100644 --- a/deps/v8/src/ic/x64/handler-compiler-x64.cc +++ b/deps/v8/src/ic/x64/handler-compiler-x64.cc @@ -4,8 +4,10 @@ #if V8_TARGET_ARCH_X64 -#include "src/ic/call-optimization.h" #include "src/ic/handler-compiler.h" + +#include "src/field-type.h" +#include "src/ic/call-optimization.h" #include "src/ic/ic.h" #include "src/isolate-inl.h" @@ -181,9 +183,16 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( call_data_undefined = true; __ LoadRoot(data, Heap::kUndefinedValueRootIndex); } else { - __ movp(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); - __ movp(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); - __ movp(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + if (optimization.is_constant_call()) { + __ movp(data, + FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); + __ movp(data, + FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); + __ movp(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + } else { + __ movp(data, + FieldOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); + } __ movp(data, FieldOperand(data, CallHandlerInfo::kDataOffset)); } @@ -200,7 +209,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( RelocInfo::EXTERNAL_REFERENCE); // Jump to stub. - CallApiAccessorStub stub(isolate, is_store, call_data_undefined); + CallApiAccessorStub stub(isolate, is_store, call_data_undefined, + !optimization.is_constant_call()); __ TailCallStub(&stub); } @@ -395,8 +405,7 @@ void NamedStoreHandlerCompiler::GenerateConstantCheck(Register map_reg, __ j(not_equal, miss_label); } - -void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, +void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, Register value_reg, Label* miss_label) { Register map_reg = scratch1(); @@ -404,20 +413,12 @@ void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, DCHECK(!value_reg.is(map_reg)); DCHECK(!value_reg.is(scratch)); __ JumpIfSmi(value_reg, miss_label); - HeapType::Iterator<Map> it = field_type->Classes(); - if (!it.Done()) { + if (field_type->IsClass()) { Label do_store; __ movp(map_reg, FieldOperand(value_reg, HeapObject::kMapOffset)); - while (true) { - __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); - it.Advance(); - if (it.Done()) { - __ j(not_equal, miss_label); - break; - } - __ j(equal, &do_store, Label::kNear); - } - __ bind(&do_store); + __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), + scratch); + __ j(not_equal, miss_label); } } @@ -592,24 +593,29 @@ void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { void NamedLoadHandlerCompiler::GenerateLoadCallback( - Register reg, Handle<ExecutableAccessorInfo> callback) { + Register reg, Handle<AccessorInfo> callback) { + DCHECK(!AreAliased(kScratchRegister, scratch2(), scratch3(), receiver())); + DCHECK(!AreAliased(kScratchRegister, scratch2(), scratch3(), reg)); + // Insert additional parameters into the stack frame above return address. - DCHECK(!scratch4().is(reg)); - __ PopReturnAddressTo(scratch4()); - - STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0); - STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 1); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 2); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 3); - STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4); - STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5); - STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 6); + __ PopReturnAddressTo(scratch3()); + + // Build v8::PropertyCallbackInfo::args_ array on the stack and push property + // name below the exit frame to make GC aware of them. + STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0); + STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1); + STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4); + STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5); + STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6); + STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7); + __ Push(receiver()); // receiver Handle<Object> data(callback->data(), isolate()); if (data->IsUndefined() || data->IsSmi()) { __ Push(data); } else { - DCHECK(!scratch2().is(reg)); Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(Handle<HeapObject>::cast(data)); // The callback is alive if this instruction is executed, @@ -617,17 +623,15 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback( __ GetWeakValue(scratch2(), cell); __ Push(scratch2()); } - DCHECK(!kScratchRegister.is(reg)); __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex); __ Push(kScratchRegister); // return value __ Push(kScratchRegister); // return value default __ PushAddress(ExternalReference::isolate_address(isolate())); __ Push(reg); // holder - __ Push(name()); // name - // Save a pointer to where we pushed the arguments pointer. This will be - // passed as the const PropertyAccessorInfo& to the C++ callback. + __ Push(Smi::FromInt(0)); // should_throw_on_error -> false - __ PushReturnAddressFrom(scratch4()); + __ Push(name()); // name + __ PushReturnAddressFrom(scratch3()); // Abi for CallApiGetter Register api_function_address = ApiGetterDescriptor::function_address(); @@ -722,8 +726,8 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( - Handle<JSObject> object, Handle<Name> name, - Handle<ExecutableAccessorInfo> callback) { + Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, + LanguageMode language_mode) { Register holder_reg = Frontend(name); __ PopReturnAddressTo(scratch1()); @@ -739,6 +743,7 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( } __ Push(name); __ Push(value()); + __ Push(Smi::FromInt(language_mode)); __ PushReturnAddressFrom(scratch1()); // Do tail-call to the runtime system. @@ -794,7 +799,7 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( } Counters* counters = isolate()->counters(); - __ IncrementCounter(counters->named_load_global_stub(), 1); + __ IncrementCounter(counters->ic_named_load_global_stub(), 1); if (IC::ICUseVector(kind())) { DiscardVectorAndSlot(); } diff --git a/deps/v8/src/ic/x64/ic-x64.cc b/deps/v8/src/ic/x64/ic-x64.cc index bf4ad96f69..247116d7fe 100644 --- a/deps/v8/src/ic/x64/ic-x64.cc +++ b/deps/v8/src/ic/x64/ic-x64.cc @@ -167,7 +167,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm, static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, Register key, Register elements, Register scratch, Register result, - Label* slow, LanguageMode language_mode) { + Label* slow) { // Register use: // // receiver - holds the receiver on entry. @@ -222,13 +222,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, __ jmp(&check_next_prototype); __ bind(&absent); - if (is_strong(language_mode)) { - // Strong mode accesses must throw in this case, so call the runtime. - __ jmp(slow); - } else { - __ LoadRoot(result, Heap::kUndefinedValueRootIndex); - __ jmp(&done); - } + __ LoadRoot(result, Heap::kUndefinedValueRootIndex); + __ jmp(&done); __ bind(&in_bounds); // Fast case: Do the load. @@ -274,9 +269,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key, __ bind(&unique); } - -void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) { // The return address is on the stack. Label slow, check_name, index_smi, index_name, property_array_property; Label probe_dictionary, check_number_dictionary; @@ -298,10 +291,9 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, // Check the receiver's map to see if it has fast elements. __ CheckFastElements(rax, &check_number_dictionary); - GenerateFastArrayLoad(masm, receiver, key, rax, rbx, rax, &slow, - language_mode); + GenerateFastArrayLoad(masm, receiver, key, rax, rbx, rax, &slow); Counters* counters = masm->isolate()->counters(); - __ IncrementCounter(counters->keyed_load_generic_smi(), 1); + __ IncrementCounter(counters->ic_keyed_load_generic_smi(), 1); __ ret(0); __ bind(&check_number_dictionary); @@ -319,8 +311,8 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, __ bind(&slow); // Slow case: Jump to runtime. - __ IncrementCounter(counters->keyed_load_generic_slow(), 1); - KeyedLoadIC::GenerateRuntimeGetProperty(masm, language_mode); + __ IncrementCounter(counters->ic_keyed_load_generic_slow(), 1); + KeyedLoadIC::GenerateRuntimeGetProperty(masm); __ bind(&check_name); GenerateKeyNameCheck(masm, key, rax, rbx, &index_name, &slow); @@ -366,7 +358,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, GenerateGlobalInstanceTypeCheck(masm, rax, &slow); GenerateDictionaryLoad(masm, &slow, rbx, key, rax, rdi, rax); - __ IncrementCounter(counters->keyed_load_generic_symbol(), 1); + __ IncrementCounter(counters->ic_keyed_load_generic_symbol(), 1); __ ret(0); __ bind(&index_name); @@ -626,8 +618,7 @@ void KeyedStoreIC::GenerateMegamorphic(MacroAssembler* masm, GenerateMiss(masm); } - -void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { +void LoadIC::GenerateNormal(MacroAssembler* masm) { Register dictionary = rax; DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); @@ -642,7 +633,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { // Dictionary load failed, go slow (but don't miss). __ bind(&slow); - LoadIC::GenerateRuntimeGetProperty(masm, language_mode); + LoadIC::GenerateRuntimeGetProperty(masm); } @@ -667,7 +658,7 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { // The return address is on the stack. Counters* counters = masm->isolate()->counters(); - __ IncrementCounter(counters->load_miss(), 1); + __ IncrementCounter(counters->ic_load_miss(), 1); LoadIC_PushArgs(masm); @@ -675,9 +666,7 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kLoadIC_Miss); } - -void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is on the stack. Register receiver = LoadDescriptor::ReceiverRegister(); Register name = LoadDescriptor::NameRegister(); @@ -690,15 +679,14 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, __ PushReturnAddressFrom(rbx); // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong - : Runtime::kGetProperty); + __ TailCallRuntime(Runtime::kGetProperty); } void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { // The return address is on the stack. Counters* counters = masm->isolate()->counters(); - __ IncrementCounter(counters->keyed_load_miss(), 1); + __ IncrementCounter(counters->ic_keyed_load_miss(), 1); LoadIC_PushArgs(masm); @@ -706,9 +694,7 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); } - -void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is on the stack. Register receiver = LoadDescriptor::ReceiverRegister(); Register name = LoadDescriptor::NameRegister(); @@ -721,8 +707,7 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, __ PushReturnAddressFrom(rbx); // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong - : Runtime::kKeyedGetProperty); + __ TailCallRuntime(Runtime::kKeyedGetProperty); } @@ -774,11 +759,11 @@ void StoreIC::GenerateNormal(MacroAssembler* masm) { __ movp(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset)); GenerateDictionaryStore(masm, &miss, dictionary, name, value, r8, r9); Counters* counters = masm->isolate()->counters(); - __ IncrementCounter(counters->store_normal_hit(), 1); + __ IncrementCounter(counters->ic_store_normal_hit(), 1); __ ret(0); __ bind(&miss); - __ IncrementCounter(counters->store_normal_miss(), 1); + __ IncrementCounter(counters->ic_store_normal_miss(), 1); GenerateMiss(masm); } diff --git a/deps/v8/src/ic/x87/handler-compiler-x87.cc b/deps/v8/src/ic/x87/handler-compiler-x87.cc index cc43ed298d..1b25f06347 100644 --- a/deps/v8/src/ic/x87/handler-compiler-x87.cc +++ b/deps/v8/src/ic/x87/handler-compiler-x87.cc @@ -4,8 +4,10 @@ #if V8_TARGET_ARCH_X87 -#include "src/ic/call-optimization.h" #include "src/ic/handler-compiler.h" + +#include "src/field-type.h" +#include "src/ic/call-optimization.h" #include "src/ic/ic.h" #include "src/isolate-inl.h" @@ -197,9 +199,13 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( call_data_undefined = true; __ mov(data, Immediate(isolate->factory()->undefined_value())); } else { - __ mov(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); - __ mov(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); - __ mov(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + if (optimization.is_constant_call()) { + __ mov(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); + __ mov(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); + __ mov(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); + } else { + __ mov(data, FieldOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); + } __ mov(data, FieldOperand(data, CallHandlerInfo::kDataOffset)); } @@ -214,7 +220,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( __ mov(api_function_address, Immediate(function_address)); // Jump to stub. - CallApiAccessorStub stub(isolate, is_store, call_data_undefined); + CallApiAccessorStub stub(isolate, is_store, call_data_undefined, + !optimization.is_constant_call()); __ TailCallStub(&stub); } @@ -399,8 +406,7 @@ void NamedStoreHandlerCompiler::GenerateConstantCheck(Register map_reg, __ j(not_equal, miss_label); } - -void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, +void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, Register value_reg, Label* miss_label) { Register map_reg = scratch1(); @@ -408,20 +414,11 @@ void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, DCHECK(!value_reg.is(map_reg)); DCHECK(!value_reg.is(scratch)); __ JumpIfSmi(value_reg, miss_label); - HeapType::Iterator<Map> it = field_type->Classes(); - if (!it.Done()) { - Label do_store; + if (field_type->IsClass()) { __ mov(map_reg, FieldOperand(value_reg, HeapObject::kMapOffset)); - while (true) { - __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); - it.Advance(); - if (it.Done()) { - __ j(not_equal, miss_label); - break; - } - __ j(equal, &do_store, Label::kNear); - } - __ bind(&do_store); + __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), + scratch); + __ j(not_equal, miss_label); } } @@ -593,24 +590,30 @@ void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { void NamedLoadHandlerCompiler::GenerateLoadCallback( - Register reg, Handle<ExecutableAccessorInfo> callback) { + Register reg, Handle<AccessorInfo> callback) { + DCHECK(!AreAliased(scratch2(), scratch3(), receiver())); + DCHECK(!AreAliased(scratch2(), scratch3(), reg)); + // Insert additional parameters into the stack frame above return address. - DCHECK(!scratch3().is(reg)); __ pop(scratch3()); // Get return address to place it below. - STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0); - STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 1); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 2); - STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 3); - STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4); - STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5); + // Build v8::PropertyCallbackInfo::args_ array on the stack and push property + // name below the exit frame to make GC aware of them. + STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0); + STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1); + STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3); + STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4); + STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5); + STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6); + STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7); + __ push(receiver()); // receiver - // Push data from ExecutableAccessorInfo. + // Push data from AccessorInfo. Handle<Object> data(callback->data(), isolate()); if (data->IsUndefined() || data->IsSmi()) { __ push(Immediate(data)); } else { - DCHECK(!scratch2().is(reg)); Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(Handle<HeapObject>::cast(data)); // The callback is alive if this instruction is executed, @@ -623,13 +626,9 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback( __ push(Immediate(isolate()->factory()->undefined_value())); __ push(Immediate(reinterpret_cast<int>(isolate()))); __ push(reg); // holder - - // Save a pointer to where we pushed the arguments. This will be - // passed as the const PropertyAccessorInfo& to the C++ callback. - __ push(esp); + __ push(Immediate(Smi::FromInt(0))); // should_throw_on_error -> false __ push(name()); // name - __ push(scratch3()); // Restore return address. // Abi for CallApiGetter @@ -731,8 +730,8 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( - Handle<JSObject> object, Handle<Name> name, - Handle<ExecutableAccessorInfo> callback) { + Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, + LanguageMode language_mode) { Register holder_reg = Frontend(name); __ pop(scratch1()); // remove the return address @@ -748,6 +747,7 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( } __ Push(name); __ push(value()); + __ push(Immediate(Smi::FromInt(language_mode))); __ push(scratch1()); // restore return address // Do tail-call to the runtime system. @@ -802,7 +802,7 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( } Counters* counters = isolate()->counters(); - __ IncrementCounter(counters->named_load_global_stub(), 1); + __ IncrementCounter(counters->ic_named_load_global_stub(), 1); // The code above already loads the result into the return register. if (IC::ICUseVector(kind())) { DiscardVectorAndSlot(); diff --git a/deps/v8/src/ic/x87/ic-x87.cc b/deps/v8/src/ic/x87/ic-x87.cc index d4cc3ce80a..5bbd9c5814 100644 --- a/deps/v8/src/ic/x87/ic-x87.cc +++ b/deps/v8/src/ic/x87/ic-x87.cc @@ -167,7 +167,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm, static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, Register key, Register scratch, Register scratch2, Register result, - Label* slow, LanguageMode language_mode) { + Label* slow) { // Register use: // receiver - holds the receiver and is unchanged. // key - holds the key and is unchanged (must be a smi). @@ -211,13 +211,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, __ jmp(&check_next_prototype); __ bind(&absent); - if (is_strong(language_mode)) { - // Strong mode accesses must throw in this case, so call the runtime. - __ jmp(slow); - } else { - __ mov(result, masm->isolate()->factory()->undefined_value()); - __ jmp(&done); - } + __ mov(result, masm->isolate()->factory()->undefined_value()); + __ jmp(&done); __ bind(&in_bounds); // Fast case: Do the load. @@ -262,9 +257,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key, __ bind(&unique); } - -void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) { // The return address is on the stack. Label slow, check_name, index_smi, index_name, property_array_property; Label probe_dictionary, check_number_dictionary; @@ -286,11 +279,10 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, // Check the receiver's map to see if it has fast elements. __ CheckFastElements(eax, &check_number_dictionary); - GenerateFastArrayLoad(masm, receiver, key, eax, ebx, eax, &slow, - language_mode); + GenerateFastArrayLoad(masm, receiver, key, eax, ebx, eax, &slow); Isolate* isolate = masm->isolate(); Counters* counters = isolate->counters(); - __ IncrementCounter(counters->keyed_load_generic_smi(), 1); + __ IncrementCounter(counters->ic_keyed_load_generic_smi(), 1); __ ret(0); __ bind(&check_number_dictionary); @@ -318,8 +310,8 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, __ bind(&slow); // Slow case: jump to runtime. - __ IncrementCounter(counters->keyed_load_generic_slow(), 1); - GenerateRuntimeGetProperty(masm, language_mode); + __ IncrementCounter(counters->ic_keyed_load_generic_slow(), 1); + GenerateRuntimeGetProperty(masm); __ bind(&check_name); GenerateKeyNameCheck(masm, key, eax, ebx, &index_name, &slow); @@ -363,7 +355,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, GenerateGlobalInstanceTypeCheck(masm, eax, &slow); GenerateDictionaryLoad(masm, &slow, ebx, key, eax, edi, eax); - __ IncrementCounter(counters->keyed_load_generic_symbol(), 1); + __ IncrementCounter(counters->ic_keyed_load_generic_symbol(), 1); __ ret(0); __ bind(&index_name); @@ -628,8 +620,7 @@ void KeyedStoreIC::GenerateMegamorphic(MacroAssembler* masm, GenerateMiss(masm); } - -void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { +void LoadIC::GenerateNormal(MacroAssembler* masm) { Register dictionary = eax; DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); @@ -644,7 +635,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { // Dictionary load failed, go slow (but don't miss). __ bind(&slow); - GenerateRuntimeGetProperty(masm, language_mode); + GenerateRuntimeGetProperty(masm); } @@ -668,16 +659,14 @@ static void LoadIC_PushArgs(MacroAssembler* masm) { void LoadIC::GenerateMiss(MacroAssembler* masm) { // Return address is on the stack. - __ IncrementCounter(masm->isolate()->counters()->load_miss(), 1); + __ IncrementCounter(masm->isolate()->counters()->ic_load_miss(), 1); LoadIC_PushArgs(masm); // Perform tail call to the entry. __ TailCallRuntime(Runtime::kLoadIC_Miss); } - -void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // Return address is on the stack. Register receiver = LoadDescriptor::ReceiverRegister(); Register name = LoadDescriptor::NameRegister(); @@ -689,14 +678,13 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, __ push(ebx); // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong - : Runtime::kGetProperty); + __ TailCallRuntime(Runtime::kGetProperty); } void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { // Return address is on the stack. - __ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1); + __ IncrementCounter(masm->isolate()->counters()->ic_keyed_load_miss(), 1); LoadIC_PushArgs(masm); @@ -704,9 +692,7 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); } - -void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, - LanguageMode language_mode) { +void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // Return address is on the stack. Register receiver = LoadDescriptor::ReceiverRegister(); Register name = LoadDescriptor::NameRegister(); @@ -718,8 +704,7 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, __ push(ebx); // Do tail-call to runtime routine. - __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong - : Runtime::kKeyedGetProperty); + __ TailCallRuntime(Runtime::kKeyedGetProperty); } @@ -777,14 +762,14 @@ void StoreIC::GenerateNormal(MacroAssembler* masm) { receiver, edi); __ Drop(3); Counters* counters = masm->isolate()->counters(); - __ IncrementCounter(counters->store_normal_hit(), 1); + __ IncrementCounter(counters->ic_store_normal_hit(), 1); __ ret(0); __ bind(&restore_miss); __ pop(slot); __ pop(vector); __ pop(receiver); - __ IncrementCounter(counters->store_normal_miss(), 1); + __ IncrementCounter(counters->ic_store_normal_miss(), 1); GenerateMiss(masm); } |