Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Unified Diff: src/ia32/stub-cache-ia32.cc

Issue 6685088: Merge isolates to bleeding_edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/simulator-ia32.h ('k') | src/ia32/virtual-frame-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/stub-cache-ia32.cc
===================================================================
--- src/ia32/stub-cache-ia32.cc (revision 7267)
+++ src/ia32/stub-cache-ia32.cc (working copy)
@@ -39,14 +39,15 @@
#define __ ACCESS_MASM(masm)
-static void ProbeTable(MacroAssembler* masm,
+static void ProbeTable(Isolate* isolate,
+ MacroAssembler* masm,
Code::Flags flags,
StubCache::Table table,
Register name,
Register offset,
Register extra) {
- ExternalReference key_offset(SCTableReference::keyReference(table));
- ExternalReference value_offset(SCTableReference::valueReference(table));
+ ExternalReference key_offset(isolate->stub_cache()->key_reference(table));
+ ExternalReference value_offset(isolate->stub_cache()->value_reference(table));
Label miss;
@@ -113,8 +114,8 @@
Register r0,
Register r1) {
ASSERT(name->IsSymbol());
- __ IncrementCounter(&Counters::negative_lookups, 1);
- __ IncrementCounter(&Counters::negative_lookups_miss, 1);
+ __ IncrementCounter(COUNTERS->negative_lookups(), 1);
+ __ IncrementCounter(COUNTERS->negative_lookups_miss(), 1);
Label done;
__ mov(r0, FieldOperand(receiver, HeapObject::kMapOffset));
@@ -137,7 +138,7 @@
// Check that the properties array is a dictionary.
__ cmp(FieldOperand(properties, HeapObject::kMapOffset),
- Immediate(Factory::hash_table_map()));
+ Immediate(FACTORY->hash_table_map()));
__ j(not_equal, miss_label);
// Compute the capacity mask.
@@ -177,7 +178,7 @@
ASSERT_EQ(kSmiTagSize, 1);
__ mov(entity_name, Operand(properties, index, times_half_pointer_size,
kElementsStartOffset - kHeapObjectTag));
- __ cmp(entity_name, Factory::undefined_value());
+ __ cmp(entity_name, FACTORY->undefined_value());
if (i != kProbes - 1) {
__ j(equal, &done, taken);
@@ -197,7 +198,7 @@
}
__ bind(&done);
- __ DecrementCounter(&Counters::negative_lookups_miss, 1);
+ __ DecrementCounter(COUNTERS->negative_lookups_miss(), 1);
}
@@ -208,6 +209,7 @@
Register scratch,
Register extra,
Register extra2) {
+ Isolate* isolate = Isolate::Current();
Label miss;
USE(extra2); // The register extra2 is not used on the ia32 platform.
@@ -240,7 +242,7 @@
__ and_(scratch, (kPrimaryTableSize - 1) << kHeapObjectTagSize);
// Probe the primary table.
- ProbeTable(masm, flags, kPrimary, name, scratch, extra);
+ ProbeTable(isolate, masm, flags, kPrimary, name, scratch, extra);
// Primary miss: Compute hash for secondary probe.
__ mov(scratch, FieldOperand(name, String::kHashFieldOffset));
@@ -252,7 +254,7 @@
__ and_(scratch, (kSecondaryTableSize - 1) << kHeapObjectTagSize);
// Probe the secondary table.
- ProbeTable(masm, flags, kSecondary, name, scratch, extra);
+ ProbeTable(isolate, masm, flags, kSecondary, name, scratch, extra);
// Cache miss: Fall-through and let caller handle the miss by
// entering the runtime system.
@@ -274,10 +276,11 @@
MacroAssembler* masm, int index, Register prototype, Label* miss) {
// Check we're still in the same context.
__ cmp(Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX)),
- Top::global());
+ Isolate::Current()->global());
__ j(not_equal, miss);
// Get the global function with the given index.
- JSFunction* function = JSFunction::cast(Top::global_context()->get(index));
+ JSFunction* function = JSFunction::cast(
+ Isolate::Current()->global_context()->get(index));
// Load its initial map. The global functions all have initial maps.
__ Set(prototype, Immediate(Handle<Map>(function->initial_map())));
// Load the prototype from the initial map.
@@ -395,7 +398,7 @@
JSObject* holder_obj) {
__ push(name);
InterceptorInfo* interceptor = holder_obj->GetNamedInterceptor();
- ASSERT(!Heap::InNewSpace(interceptor));
+ ASSERT(!HEAP->InNewSpace(interceptor));
Register scratch = name;
__ mov(scratch, Immediate(Handle<Object>(interceptor)));
__ push(scratch);
@@ -480,7 +483,7 @@
__ mov(Operand(esp, 2 * kPointerSize), edi);
Object* call_data = optimization.api_call_info()->data();
Handle<CallHandlerInfo> api_call_info_handle(optimization.api_call_info());
- if (Heap::InNewSpace(call_data)) {
+ if (HEAP->InNewSpace(call_data)) {
__ mov(ecx, api_call_info_handle);
__ mov(ebx, FieldOperand(ecx, CallHandlerInfo::kDataOffset));
__ mov(Operand(esp, 3 * kPointerSize), ebx);
@@ -574,7 +577,7 @@
name,
holder,
miss);
- return Heap::undefined_value(); // Success.
+ return HEAP->undefined_value(); // Success.
}
}
@@ -610,10 +613,10 @@
(depth2 != kInvalidProtoDepth);
}
- __ IncrementCounter(&Counters::call_const_interceptor, 1);
+ __ IncrementCounter(COUNTERS->call_const_interceptor(), 1);
if (can_do_fast_api_call) {
- __ IncrementCounter(&Counters::call_const_interceptor_fast_api, 1);
+ __ IncrementCounter(COUNTERS->call_const_interceptor_fast_api(), 1);
ReserveSpaceForFastApiCall(masm, scratch1);
}
@@ -672,7 +675,7 @@
FreeSpaceForFastApiCall(masm, scratch1);
}
- return Heap::undefined_value(); // Success.
+ return HEAP->undefined_value(); // Success.
}
void CompileRegular(MacroAssembler* masm,
@@ -728,7 +731,7 @@
__ pop(receiver); // Restore the holder.
__ LeaveInternalFrame();
- __ cmp(eax, Factory::no_interceptor_result_sentinel());
+ __ cmp(eax, FACTORY->no_interceptor_result_sentinel());
__ j(not_equal, interceptor_succeeded);
}
@@ -742,9 +745,9 @@
ASSERT(kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC);
Code* code = NULL;
if (kind == Code::LOAD_IC) {
- code = Builtins::builtin(Builtins::LoadIC_Miss);
+ code = Isolate::Current()->builtins()->builtin(Builtins::LoadIC_Miss);
} else {
- code = Builtins::builtin(Builtins::KeyedLoadIC_Miss);
+ code = Isolate::Current()->builtins()->builtin(Builtins::KeyedLoadIC_Miss);
}
Handle<Code> ic(code);
@@ -851,10 +854,10 @@
if (Serializer::enabled()) {
__ mov(scratch, Immediate(Handle<Object>(cell)));
__ cmp(FieldOperand(scratch, JSGlobalPropertyCell::kValueOffset),
- Immediate(Factory::the_hole_value()));
+ Immediate(FACTORY->the_hole_value()));
} else {
__ cmp(Operand::Cell(Handle<JSGlobalPropertyCell>(cell)),
- Immediate(Factory::the_hole_value()));
+ Immediate(FACTORY->the_hole_value()));
}
__ j(not_equal, miss, not_taken);
return cell;
@@ -930,7 +933,7 @@
!current->IsJSGlobalObject() &&
!current->IsJSGlobalProxy()) {
if (!name->IsSymbol()) {
- MaybeObject* maybe_lookup_result = Heap::LookupSymbol(name);
+ MaybeObject* maybe_lookup_result = HEAP->LookupSymbol(name);
Object* lookup_result = NULL; // Initialization to please compiler.
if (!maybe_lookup_result->ToObject(&lookup_result)) {
set_failure(Failure::cast(maybe_lookup_result));
@@ -950,7 +953,7 @@
__ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
reg = holder_reg; // from now the object is in holder_reg
__ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
- } else if (Heap::InNewSpace(prototype)) {
+ } else if (HEAP->InNewSpace(prototype)) {
// Get the map of the current object.
__ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
__ cmp(Operand(scratch1), Immediate(Handle<Map>(current->map())));
@@ -997,7 +1000,7 @@
ASSERT(current == holder);
// Log the check depth.
- LOG(IntEvent("check-maps-depth", depth + 1));
+ LOG(isolate(), IntEvent("check-maps-depth", depth + 1));
// Check the holder map.
__ cmp(FieldOperand(reg, HeapObject::kMapOffset),
@@ -1080,7 +1083,7 @@
ASSERT(!scratch2.is(reg));
__ push(reg); // holder
// Push data from AccessorInfo.
- if (Heap::InNewSpace(callback_handle->data())) {
+ if (HEAP->InNewSpace(callback_handle->data())) {
__ mov(scratch1, Immediate(callback_handle));
__ push(FieldOperand(scratch1, AccessorInfo::kDataOffset));
} else {
@@ -1204,7 +1207,7 @@
// Check if interceptor provided a value for property. If it's
// the case, return immediately.
Label interceptor_failed;
- __ cmp(eax, Factory::no_interceptor_result_sentinel());
+ __ cmp(eax, FACTORY->no_interceptor_result_sentinel());
__ j(equal, &interceptor_failed);
__ LeaveInternalFrame();
__ ret(0);
@@ -1325,7 +1328,7 @@
}
// Check that the cell contains the same function.
- if (Heap::InNewSpace(function)) {
+ if (HEAP->InNewSpace(function)) {
// We can't embed a pointer to a function in new space so we have
// to verify that the shared function info is unchanged. This has
// the nice side effect that multiple closures based on the same
@@ -1348,8 +1351,9 @@
MaybeObject* CallStubCompiler::GenerateMissBranch() {
- MaybeObject* maybe_obj = StubCache::ComputeCallMiss(arguments().immediate(),
- kind_);
+ MaybeObject* maybe_obj =
+ Isolate::Current()->stub_cache()->ComputeCallMiss(
+ arguments().immediate(), kind_);
Object* obj;
if (!maybe_obj->ToObject(&obj)) return maybe_obj;
__ jmp(Handle<Code>(Code::cast(obj)), RelocInfo::CODE_TARGET);
@@ -1429,7 +1433,7 @@
// -----------------------------------
// If object is not an array, bail out to regular call.
- if (!object->IsJSArray() || cell != NULL) return Heap::undefined_value();
+ if (!object->IsJSArray() || cell != NULL) return HEAP->undefined_value();
Label miss;
@@ -1459,7 +1463,7 @@
// Check that the elements are in fast mode and writable.
__ cmp(FieldOperand(ebx, HeapObject::kMapOffset),
- Immediate(Factory::fixed_array_map()));
+ Immediate(FACTORY->fixed_array_map()));
__ j(not_equal, &call_builtin);
if (argc == 1) { // Otherwise fall through to call builtin.
@@ -1535,7 +1539,7 @@
// ... and fill the rest with holes.
for (int i = 1; i < kAllocationDelta; i++) {
__ mov(Operand(edx, i * kPointerSize),
- Immediate(Factory::the_hole_value()));
+ Immediate(FACTORY->the_hole_value()));
}
// Restore receiver to edx as finish sequence assumes it's here.
@@ -1581,7 +1585,7 @@
// -----------------------------------
// If object is not an array, bail out to regular call.
- if (!object->IsJSArray() || cell != NULL) return Heap::undefined_value();
+ if (!object->IsJSArray() || cell != NULL) return HEAP->undefined_value();
Label miss, return_undefined, call_builtin;
@@ -1603,7 +1607,7 @@
// Check that the elements are in fast mode and writable.
__ cmp(FieldOperand(ebx, HeapObject::kMapOffset),
- Immediate(Factory::fixed_array_map()));
+ Immediate(FACTORY->fixed_array_map()));
__ j(not_equal, &call_builtin);
// Get the array's length into ecx and calculate new length.
@@ -1617,7 +1621,7 @@
__ mov(eax, FieldOperand(ebx,
ecx, times_half_pointer_size,
FixedArray::kHeaderSize));
- __ cmp(Operand(eax), Immediate(Factory::the_hole_value()));
+ __ cmp(Operand(eax), Immediate(FACTORY->the_hole_value()));
__ j(equal, &call_builtin);
// Set the array's length.
@@ -1627,11 +1631,11 @@
__ mov(FieldOperand(ebx,
ecx, times_half_pointer_size,
FixedArray::kHeaderSize),
- Immediate(Factory::the_hole_value()));
+ Immediate(FACTORY->the_hole_value()));
__ ret((argc + 1) * kPointerSize);
__ bind(&return_undefined);
- __ mov(eax, Immediate(Factory::undefined_value()));
+ __ mov(eax, Immediate(FACTORY->undefined_value()));
__ ret((argc + 1) * kPointerSize);
__ bind(&call_builtin);
@@ -1665,7 +1669,7 @@
// -----------------------------------
// If object is not a string, bail out to regular call.
- if (!object->IsString() || cell != NULL) return Heap::undefined_value();
+ if (!object->IsString() || cell != NULL) return HEAP->undefined_value();
const int argc = arguments().immediate();
@@ -1697,7 +1701,7 @@
if (argc > 0) {
__ mov(index, Operand(esp, (argc - 0) * kPointerSize));
} else {
- __ Set(index, Immediate(Factory::undefined_value()));
+ __ Set(index, Immediate(FACTORY->undefined_value()));
}
StringCharCodeAtGenerator char_code_at_generator(receiver,
@@ -1716,7 +1720,7 @@
if (index_out_of_range.is_linked()) {
__ bind(&index_out_of_range);
- __ Set(eax, Immediate(Factory::nan_value()));
+ __ Set(eax, Immediate(FACTORY->nan_value()));
__ ret((argc + 1) * kPointerSize);
}
@@ -1749,7 +1753,7 @@
// -----------------------------------
// If object is not a string, bail out to regular call.
- if (!object->IsString() || cell != NULL) return Heap::undefined_value();
+ if (!object->IsString() || cell != NULL) return HEAP->undefined_value();
const int argc = arguments().immediate();
@@ -1782,7 +1786,7 @@
if (argc > 0) {
__ mov(index, Operand(esp, (argc - 0) * kPointerSize));
} else {
- __ Set(index, Immediate(Factory::undefined_value()));
+ __ Set(index, Immediate(FACTORY->undefined_value()));
}
StringCharAtGenerator char_at_generator(receiver,
@@ -1802,7 +1806,7 @@
if (index_out_of_range.is_linked()) {
__ bind(&index_out_of_range);
- __ Set(eax, Immediate(Factory::empty_string()));
+ __ Set(eax, Immediate(FACTORY->empty_string()));
__ ret((argc + 1) * kPointerSize);
}
@@ -1838,7 +1842,7 @@
// If the object is not a JSObject or we got an unexpected number of
// arguments, bail out to the regular call.
- if (!object->IsJSObject() || argc != 1) return Heap::undefined_value();
+ if (!object->IsJSObject() || argc != 1) return HEAP->undefined_value();
Label miss;
GenerateNameCheck(name, &miss);
@@ -1908,14 +1912,15 @@
// -- esp[(argc + 1) * 4] : receiver
// -----------------------------------
- if (!CpuFeatures::IsSupported(SSE2)) return Heap::undefined_value();
+ if (!Isolate::Current()->cpu_features()->IsSupported(SSE2))
+ return HEAP->undefined_value();
CpuFeatures::Scope use_sse2(SSE2);
const int argc = arguments().immediate();
// If the object is not a JSObject or we got an unexpected number of
// arguments, bail out to the regular call.
- if (!object->IsJSObject() || argc != 1) return Heap::undefined_value();
+ if (!object->IsJSObject() || argc != 1) return HEAP->undefined_value();
Label miss;
GenerateNameCheck(name, &miss);
@@ -1946,7 +1951,7 @@
// Check if the argument is a heap number and load its value into xmm0.
Label slow;
- __ CheckMap(eax, Factory::heap_number_map(), &slow, true);
+ __ CheckMap(eax, FACTORY->heap_number_map(), &slow, true);
__ movdbl(xmm0, FieldOperand(eax, HeapNumber::kValueOffset));
// Check if the argument is strictly positive. Note this also
@@ -2039,7 +2044,7 @@
// If the object is not a JSObject or we got an unexpected number of
// arguments, bail out to the regular call.
- if (!object->IsJSObject() || argc != 1) return Heap::undefined_value();
+ if (!object->IsJSObject() || argc != 1) return HEAP->undefined_value();
Label miss;
GenerateNameCheck(name, &miss);
@@ -2090,7 +2095,7 @@
// Check if the argument is a heap number and load its exponent and
// sign into ebx.
__ bind(&not_smi);
- __ CheckMap(eax, Factory::heap_number_map(), &slow, true);
+ __ CheckMap(eax, FACTORY->heap_number_map(), &slow, true);
__ mov(ebx, FieldOperand(eax, HeapNumber::kExponentOffset));
// Check the sign of the argument. If the argument is positive,
@@ -2137,11 +2142,11 @@
ASSERT(optimization.is_simple_api_call());
// Bail out if object is a global object as we don't want to
// repatch it to global receiver.
- if (object->IsGlobalObject()) return Heap::undefined_value();
- if (cell != NULL) return Heap::undefined_value();
+ if (object->IsGlobalObject()) return HEAP->undefined_value();
+ if (cell != NULL) return HEAP->undefined_value();
int depth = optimization.GetPrototypeDepthOfExpectedType(
JSObject::cast(object), holder);
- if (depth == kInvalidProtoDepth) return Heap::undefined_value();
+ if (depth == kInvalidProtoDepth) return HEAP->undefined_value();
Label miss, miss_before_stack_reserved;
@@ -2155,8 +2160,8 @@
__ test(edx, Immediate(kSmiTagMask));
__ j(zero, &miss_before_stack_reserved, not_taken);
- __ IncrementCounter(&Counters::call_const, 1);
- __ IncrementCounter(&Counters::call_const_fast_api, 1);
+ __ IncrementCounter(COUNTERS->call_const(), 1);
+ __ IncrementCounter(COUNTERS->call_const_fast_api(), 1);
// Allocate space for v8::Arguments implicit values. Must be initialized
// before calling any runtime function.
@@ -2232,7 +2237,7 @@
SharedFunctionInfo* function_info = function->shared();
switch (check) {
case RECEIVER_MAP_CHECK:
- __ IncrementCounter(&Counters::call_const, 1);
+ __ IncrementCounter(COUNTERS->call_const(), 1);
// Check that the maps haven't changed.
CheckPrototypes(JSObject::cast(object), edx, holder,
@@ -2293,9 +2298,9 @@
} else {
Label fast;
// Check that the object is a boolean.
- __ cmp(edx, Factory::true_value());
+ __ cmp(edx, FACTORY->true_value());
__ j(equal, &fast, taken);
- __ cmp(edx, Factory::false_value());
+ __ cmp(edx, FACTORY->false_value());
__ j(not_equal, &miss, not_taken);
__ bind(&fast);
// Check that the maps starting from the prototype haven't changed.
@@ -2436,7 +2441,7 @@
__ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
// Jump to the cached code (tail call).
- __ IncrementCounter(&Counters::call_global_inline, 1);
+ __ IncrementCounter(COUNTERS->call_global_inline(), 1);
ASSERT(function->is_compiled());
ParameterCount expected(function->shared()->formal_parameter_count());
if (V8::UseCrankshaft()) {
@@ -2453,7 +2458,7 @@
// Handle call cache miss.
__ bind(&miss);
- __ IncrementCounter(&Counters::call_global_inline_miss, 1);
+ __ IncrementCounter(COUNTERS->call_global_inline_miss(), 1);
Object* obj;
{ MaybeObject* maybe_obj = GenerateMissBranch();
if (!maybe_obj->ToObject(&obj)) return maybe_obj;
@@ -2487,7 +2492,8 @@
// Handle store cache miss.
__ bind(&miss);
__ mov(ecx, Immediate(Handle<String>(name))); // restore name
- Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
+ Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Builtins::StoreIC_Miss));
__ jmp(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@@ -2538,7 +2544,8 @@
// Handle store cache miss.
__ bind(&miss);
- Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
+ Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Builtins::StoreIC_Miss));
__ jmp(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@@ -2588,7 +2595,8 @@
// Handle store cache miss.
__ bind(&miss);
- Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
+ Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Builtins::StoreIC_Miss));
__ jmp(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@@ -2624,20 +2632,21 @@
// cell could have been deleted and reintroducing the global needs
// to update the property details in the property dictionary of the
// global object. We bail out to the runtime system to do that.
- __ cmp(cell_operand, Factory::the_hole_value());
+ __ cmp(cell_operand, FACTORY->the_hole_value());
__ j(equal, &miss);
// Store the value in the cell.
__ mov(cell_operand, eax);
// Return the value (register eax).
- __ IncrementCounter(&Counters::named_store_global_inline, 1);
+ __ IncrementCounter(COUNTERS->named_store_global_inline(), 1);
__ ret(0);
// Handle store cache miss.
__ bind(&miss);
- __ IncrementCounter(&Counters::named_store_global_inline_miss, 1);
- Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
+ __ IncrementCounter(COUNTERS->named_store_global_inline_miss(), 1);
+ Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Builtins::StoreIC_Miss));
__ jmp(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@@ -2657,7 +2666,7 @@
// -----------------------------------
Label miss;
- __ IncrementCounter(&Counters::keyed_store_field, 1);
+ __ IncrementCounter(COUNTERS->keyed_store_field(), 1);
// Check that the name has not changed.
__ cmp(Operand(ecx), Immediate(Handle<String>(name)));
@@ -2673,8 +2682,9 @@
// Handle store cache miss.
__ bind(&miss);
- __ DecrementCounter(&Counters::keyed_store_field, 1);
- Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss));
+ __ DecrementCounter(COUNTERS->keyed_store_field(), 1);
+ Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Builtins::KeyedStoreIC_Miss));
__ jmp(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@@ -2708,7 +2718,7 @@
// Get the elements array and make sure it is a fast element array, not 'cow'.
__ mov(edi, FieldOperand(edx, JSObject::kElementsOffset));
__ cmp(FieldOperand(edi, HeapObject::kMapOffset),
- Immediate(Factory::fixed_array_map()));
+ Immediate(FACTORY->fixed_array_map()));
__ j(not_equal, &miss, not_taken);
// Check that the key is within bounds.
@@ -2731,7 +2741,8 @@
// Handle store cache miss.
__ bind(&miss);
- Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss));
+ Handle<Code> ic(
+ Isolate::Current()->builtins()->builtin(Builtins::KeyedStoreIC_Miss));
__ jmp(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@@ -2776,14 +2787,14 @@
// Return undefined if maps of the full prototype chain are still the
// same and no global property with this name contains a value.
- __ mov(eax, Factory::undefined_value());
+ __ mov(eax, FACTORY->undefined_value());
__ ret(0);
__ bind(&miss);
GenerateLoadMiss(masm(), Code::LOAD_IC);
// Return the generated code.
- return GetCode(NONEXISTENT, Heap::empty_string());
+ return GetCode(NONEXISTENT, HEAP->empty_string());
}
@@ -2920,19 +2931,19 @@
// Check for deleted property if property can actually be deleted.
if (!is_dont_delete) {
- __ cmp(ebx, Factory::the_hole_value());
+ __ cmp(ebx, FACTORY->the_hole_value());
__ j(equal, &miss, not_taken);
} else if (FLAG_debug_code) {
- __ cmp(ebx, Factory::the_hole_value());
+ __ cmp(ebx, FACTORY->the_hole_value());
__ Check(not_equal, "DontDelete cells can't contain the hole");
}
- __ IncrementCounter(&Counters::named_load_global_stub, 1);
+ __ IncrementCounter(COUNTERS->named_load_global_stub(), 1);
__ mov(eax, ebx);
__ ret(0);
__ bind(&miss);
- __ IncrementCounter(&Counters::named_load_global_stub_miss, 1);
+ __ IncrementCounter(COUNTERS->named_load_global_stub_miss(), 1);
GenerateLoadMiss(masm(), Code::LOAD_IC);
// Return the generated code.
@@ -2951,7 +2962,7 @@
// -----------------------------------
Label miss;
- __ IncrementCounter(&Counters::keyed_load_field, 1);
+ __ IncrementCounter(COUNTERS->keyed_load_field(), 1);
// Check that the name has not changed.
__ cmp(Operand(eax), Immediate(Handle<String>(name)));
@@ -2960,7 +2971,7 @@
GenerateLoadField(receiver, holder, edx, ebx, ecx, edi, index, name, &miss);
__ bind(&miss);
- __ DecrementCounter(&Counters::keyed_load_field, 1);
+ __ DecrementCounter(COUNTERS->keyed_load_field(), 1);
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
// Return the generated code.
@@ -2980,7 +2991,7 @@
// -----------------------------------
Label miss;
- __ IncrementCounter(&Counters::keyed_load_callback, 1);
+ __ IncrementCounter(COUNTERS->keyed_load_callback(), 1);
// Check that the name has not changed.
__ cmp(Operand(eax), Immediate(Handle<String>(name)));
@@ -2995,7 +3006,7 @@
__ bind(&miss);
- __ DecrementCounter(&Counters::keyed_load_callback, 1);
+ __ DecrementCounter(COUNTERS->keyed_load_callback(), 1);
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
// Return the generated code.
@@ -3014,7 +3025,7 @@
// -----------------------------------
Label miss;
- __ IncrementCounter(&Counters::keyed_load_constant_function, 1);
+ __ IncrementCounter(COUNTERS->keyed_load_constant_function(), 1);
// Check that the name has not changed.
__ cmp(Operand(eax), Immediate(Handle<String>(name)));
@@ -3023,7 +3034,7 @@
GenerateLoadConstant(receiver, holder, edx, ebx, ecx, edi,
value, name, &miss);
__ bind(&miss);
- __ DecrementCounter(&Counters::keyed_load_constant_function, 1);
+ __ DecrementCounter(COUNTERS->keyed_load_constant_function(), 1);
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
// Return the generated code.
@@ -3041,7 +3052,7 @@
// -----------------------------------
Label miss;
- __ IncrementCounter(&Counters::keyed_load_interceptor, 1);
+ __ IncrementCounter(COUNTERS->keyed_load_interceptor(), 1);
// Check that the name has not changed.
__ cmp(Operand(eax), Immediate(Handle<String>(name)));
@@ -3060,7 +3071,7 @@
name,
&miss);
__ bind(&miss);
- __ DecrementCounter(&Counters::keyed_load_interceptor, 1);
+ __ DecrementCounter(COUNTERS->keyed_load_interceptor(), 1);
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
// Return the generated code.
@@ -3076,7 +3087,7 @@
// -----------------------------------
Label miss;
- __ IncrementCounter(&Counters::keyed_load_array_length, 1);
+ __ IncrementCounter(COUNTERS->keyed_load_array_length(), 1);
// Check that the name has not changed.
__ cmp(Operand(eax), Immediate(Handle<String>(name)));
@@ -3084,7 +3095,7 @@
GenerateLoadArrayLength(masm(), edx, ecx, &miss);
__ bind(&miss);
- __ DecrementCounter(&Counters::keyed_load_array_length, 1);
+ __ DecrementCounter(COUNTERS->keyed_load_array_length(), 1);
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
// Return the generated code.
@@ -3100,7 +3111,7 @@
// -----------------------------------
Label miss;
- __ IncrementCounter(&Counters::keyed_load_string_length, 1);
+ __ IncrementCounter(COUNTERS->keyed_load_string_length(), 1);
// Check that the name has not changed.
__ cmp(Operand(eax), Immediate(Handle<String>(name)));
@@ -3108,7 +3119,7 @@
GenerateLoadStringLength(masm(), edx, ecx, ebx, &miss, true);
__ bind(&miss);
- __ DecrementCounter(&Counters::keyed_load_string_length, 1);
+ __ DecrementCounter(COUNTERS->keyed_load_string_length(), 1);
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
// Return the generated code.
@@ -3124,7 +3135,7 @@
// -----------------------------------
Label miss;
- __ IncrementCounter(&Counters::keyed_load_function_prototype, 1);
+ __ IncrementCounter(COUNTERS->keyed_load_function_prototype(), 1);
// Check that the name has not changed.
__ cmp(Operand(eax), Immediate(Handle<String>(name)));
@@ -3132,7 +3143,7 @@
GenerateLoadFunctionPrototype(masm(), edx, ecx, ebx, &miss);
__ bind(&miss);
- __ DecrementCounter(&Counters::keyed_load_function_prototype, 1);
+ __ DecrementCounter(COUNTERS->keyed_load_function_prototype(), 1);
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
// Return the generated code.
@@ -3172,7 +3183,7 @@
// Load the result and make sure it's not the hole.
__ mov(ebx, Operand(ecx, eax, times_2,
FixedArray::kHeaderSize - kHeapObjectTag));
- __ cmp(ebx, Factory::the_hole_value());
+ __ cmp(ebx, FACTORY->the_hole_value());
__ j(equal, &miss, not_taken);
__ mov(eax, ebx);
__ ret(0);
@@ -3201,7 +3212,7 @@
// code for the function thereby hitting the break points.
__ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
__ mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kDebugInfoOffset));
- __ cmp(ebx, Factory::undefined_value());
+ __ cmp(ebx, FACTORY->undefined_value());
__ j(not_equal, &generic_stub_call, not_taken);
#endif
@@ -3238,7 +3249,7 @@
// ebx: initial map
// edx: JSObject (untagged)
__ mov(Operand(edx, JSObject::kMapOffset), ebx);
- __ mov(ebx, Factory::empty_fixed_array());
+ __ mov(ebx, FACTORY->empty_fixed_array());
__ mov(Operand(edx, JSObject::kPropertiesOffset), ebx);
__ mov(Operand(edx, JSObject::kElementsOffset), ebx);
@@ -3255,7 +3266,7 @@
__ lea(ecx, Operand(esp, eax, times_4, 1 * kPointerSize));
// Use edi for holding undefined which is used in several places below.
- __ mov(edi, Factory::undefined_value());
+ __ mov(edi, FACTORY->undefined_value());
// eax: argc
// ecx: first argument
@@ -3272,7 +3283,7 @@
int arg_number = shared->GetThisPropertyAssignmentArgument(i);
__ mov(ebx, edi);
__ cmp(eax, arg_number);
- if (CpuFeatures::IsSupported(CMOV)) {
+ if (Isolate::Current()->cpu_features()->IsSupported(CMOV)) {
CpuFeatures::Scope use_cmov(CMOV);
__ cmov(above, ebx, Operand(ecx, arg_number * -kPointerSize));
} else {
@@ -3307,14 +3318,15 @@
__ pop(ecx);
__ lea(esp, Operand(esp, ebx, times_pointer_size, 1 * kPointerSize));
__ push(ecx);
- __ IncrementCounter(&Counters::constructed_objects, 1);
- __ IncrementCounter(&Counters::constructed_objects_stub, 1);
+ __ IncrementCounter(COUNTERS->constructed_objects(), 1);
+ __ IncrementCounter(COUNTERS->constructed_objects_stub(), 1);
__ ret(0);
// Jump to the generic stub in case the specialized code cannot handle the
// construction.
__ bind(&generic_stub_call);
- Code* code = Builtins::builtin(Builtins::JSConstructStubGeneric);
+ Code* code = Isolate::Current()->builtins()->builtin(
+ Builtins::JSConstructStubGeneric);
Handle<Code> generic_construct_stub(code);
__ jmp(generic_construct_stub, RelocInfo::CODE_TARGET);
@@ -3455,7 +3467,7 @@
// Slow case: Jump to runtime.
__ bind(&slow);
- __ IncrementCounter(&Counters::keyed_load_external_array_slow, 1);
+ __ IncrementCounter(COUNTERS->keyed_load_external_array_slow(), 1);
// ----------- S t a t e -------------
// -- eax : key
// -- edx : receiver
@@ -3568,7 +3580,7 @@
// edi: elements array
// ebx: untagged index
__ cmp(FieldOperand(eax, HeapObject::kMapOffset),
- Immediate(Factory::heap_number_map()));
+ Immediate(FACTORY->heap_number_map()));
__ j(not_equal, &slow);
// The WebGL specification leaves the behavior of storing NaN and
@@ -3589,10 +3601,10 @@
// processors that don't support SSE2. The code in IntegerConvert
// (code-stubs-ia32.cc) is roughly what is needed here though the
// conversion failure case does not need to be handled.
- if (CpuFeatures::IsSupported(SSE2)) {
+ if (Isolate::Current()->cpu_features()->IsSupported(SSE2)) {
if (array_type != kExternalIntArray &&
array_type != kExternalUnsignedIntArray) {
- ASSERT(CpuFeatures::IsSupported(SSE2));
+ ASSERT(Isolate::Current()->cpu_features()->IsSupported(SSE2));
CpuFeatures::Scope scope(SSE2);
__ cvttsd2si(ecx, FieldOperand(eax, HeapNumber::kValueOffset));
// ecx: untagged integer value
@@ -3620,7 +3632,7 @@
break;
}
} else {
- if (CpuFeatures::IsSupported(SSE3)) {
+ if (Isolate::Current()->cpu_features()->IsSupported(SSE3)) {
CpuFeatures::Scope scope(SSE3);
// fisttp stores values as signed integers. To represent the
// entire range of int and unsigned int arrays, store as a
@@ -3633,7 +3645,7 @@
__ pop(ecx);
__ add(Operand(esp), Immediate(kPointerSize));
} else {
- ASSERT(CpuFeatures::IsSupported(SSE2));
+ ASSERT(Isolate::Current()->cpu_features()->IsSupported(SSE2));
CpuFeatures::Scope scope(SSE2);
// We can easily implement the correct rounding behavior for the
// range [0, 2^31-1]. For the time being, to keep this code simple,
« no previous file with comments | « src/ia32/simulator-ia32.h ('k') | src/ia32/virtual-frame-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698