summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/bytecode/StructureStubInfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/bytecode/StructureStubInfo.h')
-rw-r--r--Source/JavaScriptCore/bytecode/StructureStubInfo.h106
1 files changed, 74 insertions, 32 deletions
diff --git a/Source/JavaScriptCore/bytecode/StructureStubInfo.h b/Source/JavaScriptCore/bytecode/StructureStubInfo.h
index e6c1ceed9..5463f3e95 100644
--- a/Source/JavaScriptCore/bytecode/StructureStubInfo.h
+++ b/Source/JavaScriptCore/bytecode/StructureStubInfo.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008, 2012-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2012, 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,33 +26,40 @@
#ifndef StructureStubInfo_h
#define StructureStubInfo_h
+#include <wtf/Platform.h>
+
#include "CodeOrigin.h"
#include "Instruction.h"
#include "JITStubRoutine.h"
#include "MacroAssembler.h"
-#include "ObjectPropertyConditionSet.h"
#include "Opcode.h"
#include "PolymorphicAccessStructureList.h"
#include "RegisterSet.h"
-#include "SpillRegistersMode.h"
#include "Structure.h"
#include "StructureStubClearingWatchpoint.h"
+#include <wtf/OwnPtr.h>
namespace JSC {
#if ENABLE(JIT)
-class PolymorphicGetByIdList;
class PolymorphicPutByIdList;
enum AccessType {
access_get_by_id_self,
- access_get_by_id_list,
+ access_get_by_id_proto,
+ access_get_by_id_chain,
+ access_get_by_id_self_list,
+ access_get_by_id_proto_list,
access_put_by_id_transition_normal,
access_put_by_id_transition_direct,
access_put_by_id_replace,
access_put_by_id_list,
access_unset,
+ access_get_by_id_generic,
+ access_put_by_id_generic,
+ access_get_array_length,
+ access_get_string_length,
access_in_list
};
@@ -60,7 +67,13 @@ inline bool isGetByIdAccess(AccessType accessType)
{
switch (accessType) {
case access_get_by_id_self:
- case access_get_by_id_list:
+ case access_get_by_id_proto:
+ case access_get_by_id_chain:
+ case access_get_by_id_self_list:
+ case access_get_by_id_proto_list:
+ case access_get_by_id_generic:
+ case access_get_array_length:
+ case access_get_string_length:
return true;
default:
return false;
@@ -74,6 +87,7 @@ inline bool isPutByIdAccess(AccessType accessType)
case access_put_by_id_transition_direct:
case access_put_by_id_replace:
case access_put_by_id_list:
+ case access_put_by_id_generic:
return true;
default:
return false;
@@ -95,7 +109,6 @@ struct StructureStubInfo {
: accessType(access_unset)
, seen(false)
, resetByGC(false)
- , tookSlowPath(false)
{
}
@@ -106,15 +119,36 @@ struct StructureStubInfo {
u.getByIdSelf.baseObjectStructure.set(vm, owner, baseObjectStructure);
}
- void initGetByIdList(PolymorphicGetByIdList* list)
+ void initGetByIdChain(VM& vm, JSCell* owner, Structure* baseObjectStructure, StructureChain* chain, unsigned count, bool isDirect)
+ {
+ accessType = access_get_by_id_chain;
+
+ u.getByIdChain.baseObjectStructure.set(vm, owner, baseObjectStructure);
+ u.getByIdChain.chain.set(vm, owner, chain);
+ u.getByIdChain.count = count;
+ u.getByIdChain.isDirect = isDirect;
+ }
+
+ void initGetByIdSelfList(PolymorphicAccessStructureList* structureList, int listSize, bool didSelfPatching = false)
+ {
+ accessType = access_get_by_id_self_list;
+
+ u.getByIdSelfList.structureList = structureList;
+ u.getByIdSelfList.listSize = listSize;
+ u.getByIdSelfList.didSelfPatching = didSelfPatching;
+ }
+
+ void initGetByIdProtoList(PolymorphicAccessStructureList* structureList, int listSize)
{
- accessType = access_get_by_id_list;
- u.getByIdList.list = list;
+ accessType = access_get_by_id_proto_list;
+
+ u.getByIdProtoList.structureList = structureList;
+ u.getByIdProtoList.listSize = listSize;
}
// PutById*
- void initPutByIdTransition(VM& vm, JSCell* owner, Structure* previousStructure, Structure* structure, ObjectPropertyConditionSet conditionSet, bool isDirect)
+ void initPutByIdTransition(VM& vm, JSCell* owner, Structure* previousStructure, Structure* structure, StructureChain* chain, bool isDirect)
{
if (isDirect)
accessType = access_put_by_id_transition_direct;
@@ -123,7 +157,7 @@ struct StructureStubInfo {
u.putByIdTransition.previousStructure.set(vm, owner, previousStructure);
u.putByIdTransition.structure.set(vm, owner, structure);
- u.putByIdTransition.rawConditionSet = conditionSet.releaseRawPointer();
+ u.putByIdTransition.chain.set(vm, owner, chain);
}
void initPutByIdReplace(VM& vm, JSCell* owner, Structure* baseObjectStructure)
@@ -150,21 +184,13 @@ struct StructureStubInfo {
{
deref();
accessType = access_unset;
- stubRoutine = nullptr;
- watchpoints = nullptr;
+ stubRoutine.clear();
+ watchpoints.clear();
}
void deref();
- // Check if the stub has weak references that are dead. If there are dead ones that imply
- // that the stub should be entirely reset, this should return false. If there are dead ones
- // that can be handled internally by the stub and don't require a full reset, then this
- // should reset them and return true. If there are no dead weak references, return true.
- // If this method returns true it means that it has left the stub in a state where all
- // outgoing GC pointers are known to point to currently marked objects; this method is
- // allowed to accomplish this by either clearing those pointers somehow or by proving that
- // they have already been marked. It is not allowed to mark new objects.
- bool visitWeakReferences(RepatchBuffer&);
+ bool visitWeakReferences();
bool seenOnce()
{
@@ -176,22 +202,21 @@ struct StructureStubInfo {
seen = true;
}
- StructureStubClearingWatchpoint* addWatchpoint(
- CodeBlock* codeBlock, const ObjectPropertyCondition& condition = ObjectPropertyCondition())
+ StructureStubClearingWatchpoint* addWatchpoint(CodeBlock* codeBlock)
{
return WatchpointsOnStructureStubInfo::ensureReferenceAndAddWatchpoint(
- watchpoints, codeBlock, this, condition);
+ watchpoints, codeBlock, this);
}
int8_t accessType;
bool seen : 1;
bool resetByGC : 1;
- bool tookSlowPath : 1;
CodeOrigin codeOrigin;
struct {
- unsigned spillMode : 8;
+ int8_t registersFlushed;
+ int8_t callFrameRegister;
int8_t baseGPR;
#if USE(JSVALUE32_64)
int8_t valueTagGPR;
@@ -219,12 +244,29 @@ struct StructureStubInfo {
WriteBarrierBase<Structure> baseObjectStructure;
} getByIdSelf;
struct {
- PolymorphicGetByIdList* list;
- } getByIdList;
+ WriteBarrierBase<Structure> baseObjectStructure;
+ WriteBarrierBase<Structure> prototypeStructure;
+ bool isDirect;
+ } getByIdProto;
+ struct {
+ WriteBarrierBase<Structure> baseObjectStructure;
+ WriteBarrierBase<StructureChain> chain;
+ unsigned count : 31;
+ bool isDirect : 1;
+ } getByIdChain;
+ struct {
+ PolymorphicAccessStructureList* structureList;
+ int listSize : 31;
+ bool didSelfPatching : 1;
+ } getByIdSelfList;
+ struct {
+ PolymorphicAccessStructureList* structureList;
+ int listSize;
+ } getByIdProtoList;
struct {
WriteBarrierBase<Structure> previousStructure;
WriteBarrierBase<Structure> structure;
- void* rawConditionSet;
+ WriteBarrierBase<StructureChain> chain;
} putByIdTransition;
struct {
WriteBarrierBase<Structure> baseObjectStructure;
@@ -248,7 +290,7 @@ inline CodeOrigin getStructureStubInfoCodeOrigin(StructureStubInfo& structureStu
return structureStubInfo.codeOrigin;
}
-typedef HashMap<CodeOrigin, StructureStubInfo*, CodeOriginApproximateHash> StubInfoMap;
+typedef HashMap<CodeOrigin, StructureStubInfo*> StubInfoMap;
#else