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

Side by Side Diff: src/hydrogen.h

Issue 149403003: A64: Synchronize with r19234. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap-snapshot-generator.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 HValue* BuildCheckString(HValue* string); 1287 HValue* BuildCheckString(HValue* string);
1288 HValue* BuildWrapReceiver(HValue* object, HValue* function); 1288 HValue* BuildWrapReceiver(HValue* object, HValue* function);
1289 1289
1290 // Building common constructs 1290 // Building common constructs
1291 HValue* BuildCheckForCapacityGrow(HValue* object, 1291 HValue* BuildCheckForCapacityGrow(HValue* object,
1292 HValue* elements, 1292 HValue* elements,
1293 ElementsKind kind, 1293 ElementsKind kind,
1294 HValue* length, 1294 HValue* length,
1295 HValue* key, 1295 HValue* key,
1296 bool is_js_array, 1296 bool is_js_array,
1297 bool is_store); 1297 PropertyAccessType access_type);
1298 1298
1299 HValue* BuildCopyElementsOnWrite(HValue* object, 1299 HValue* BuildCopyElementsOnWrite(HValue* object,
1300 HValue* elements, 1300 HValue* elements,
1301 ElementsKind kind, 1301 ElementsKind kind,
1302 HValue* length); 1302 HValue* length);
1303 1303
1304 void BuildTransitionElementsKind(HValue* object, 1304 void BuildTransitionElementsKind(HValue* object,
1305 HValue* map, 1305 HValue* map,
1306 ElementsKind from_kind, 1306 ElementsKind from_kind,
1307 ElementsKind to_kind, 1307 ElementsKind to_kind,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 HValue* BuildStringAdd(HValue* left, 1344 HValue* BuildStringAdd(HValue* left,
1345 HValue* right, 1345 HValue* right,
1346 HAllocationMode allocation_mode); 1346 HAllocationMode allocation_mode);
1347 1347
1348 HInstruction* BuildUncheckedMonomorphicElementAccess( 1348 HInstruction* BuildUncheckedMonomorphicElementAccess(
1349 HValue* checked_object, 1349 HValue* checked_object,
1350 HValue* key, 1350 HValue* key,
1351 HValue* val, 1351 HValue* val,
1352 bool is_js_array, 1352 bool is_js_array,
1353 ElementsKind elements_kind, 1353 ElementsKind elements_kind,
1354 bool is_store, 1354 PropertyAccessType access_type,
1355 LoadKeyedHoleMode load_mode, 1355 LoadKeyedHoleMode load_mode,
1356 KeyedAccessStoreMode store_mode); 1356 KeyedAccessStoreMode store_mode);
1357 1357
1358 HInstruction* AddElementAccess( 1358 HInstruction* AddElementAccess(
1359 HValue* elements, 1359 HValue* elements,
1360 HValue* checked_key, 1360 HValue* checked_key,
1361 HValue* val, 1361 HValue* val,
1362 HValue* dependency, 1362 HValue* dependency,
1363 ElementsKind elements_kind, 1363 ElementsKind elements_kind,
1364 bool is_store, 1364 PropertyAccessType access_type,
1365 LoadKeyedHoleMode load_mode = NEVER_RETURN_HOLE); 1365 LoadKeyedHoleMode load_mode = NEVER_RETURN_HOLE);
1366 1366
1367 HLoadNamedField* BuildLoadNamedField(HValue* object, HObjectAccess access); 1367 HLoadNamedField* BuildLoadNamedField(HValue* object, HObjectAccess access);
1368 HInstruction* AddLoadNamedField(HValue* object, HObjectAccess access); 1368 HInstruction* AddLoadNamedField(HValue* object, HObjectAccess access);
1369 HInstruction* AddLoadStringInstanceType(HValue* string); 1369 HInstruction* AddLoadStringInstanceType(HValue* string);
1370 HInstruction* AddLoadStringLength(HValue* string); 1370 HInstruction* AddLoadStringLength(HValue* string);
1371 HStoreNamedField* AddStoreMapNoWriteBarrier(HValue* object, HValue* map) { 1371 HStoreNamedField* AddStoreMapNoWriteBarrier(HValue* object, HValue* map) {
1372 HStoreNamedField* store_map = Add<HStoreNamedField>( 1372 HStoreNamedField* store_map = Add<HStoreNamedField>(
1373 object, HObjectAccess::ForMap(), map, INITIALIZING_STORE); 1373 object, HObjectAccess::ForMap(), map);
1374 store_map->SkipWriteBarrier(); 1374 store_map->SkipWriteBarrier();
1375 return store_map; 1375 return store_map;
1376 } 1376 }
1377 HStoreNamedField* AddStoreMapConstant(HValue* object, Handle<Map> map); 1377 HStoreNamedField* AddStoreMapConstant(HValue* object, Handle<Map> map);
1378 HStoreNamedField* AddStoreMapConstantNoWriteBarrier(HValue* object, 1378 HStoreNamedField* AddStoreMapConstantNoWriteBarrier(HValue* object,
1379 Handle<Map> map) { 1379 Handle<Map> map) {
1380 HStoreNamedField* store_map = AddStoreMapConstant(object, map); 1380 HStoreNamedField* store_map = AddStoreMapConstant(object, map);
1381 store_map->SkipWriteBarrier(); 1381 store_map->SkipWriteBarrier();
1382 return store_map; 1382 return store_map;
1383 } 1383 }
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
2177 template <class Instruction> HInstruction* PreProcessCall(Instruction* call); 2177 template <class Instruction> HInstruction* PreProcessCall(Instruction* call);
2178 void PushArgumentsFromEnvironment(int count); 2178 void PushArgumentsFromEnvironment(int count);
2179 2179
2180 void SetUpScope(Scope* scope); 2180 void SetUpScope(Scope* scope);
2181 virtual void VisitStatements(ZoneList<Statement*>* statements) V8_OVERRIDE; 2181 virtual void VisitStatements(ZoneList<Statement*>* statements) V8_OVERRIDE;
2182 2182
2183 #define DECLARE_VISIT(type) virtual void Visit##type(type* node) V8_OVERRIDE; 2183 #define DECLARE_VISIT(type) virtual void Visit##type(type* node) V8_OVERRIDE;
2184 AST_NODE_LIST(DECLARE_VISIT) 2184 AST_NODE_LIST(DECLARE_VISIT)
2185 #undef DECLARE_VISIT 2185 #undef DECLARE_VISIT
2186 2186
2187 Type* ToType(Handle<Map> map) { return IC::MapToType<Type>(map, zone()); }
2188
2187 private: 2189 private:
2188 // Helpers for flow graph construction. 2190 // Helpers for flow graph construction.
2189 enum GlobalPropertyAccess { 2191 enum GlobalPropertyAccess {
2190 kUseCell, 2192 kUseCell,
2191 kUseGeneric 2193 kUseGeneric
2192 }; 2194 };
2193 GlobalPropertyAccess LookupGlobalProperty(Variable* var, 2195 GlobalPropertyAccess LookupGlobalProperty(Variable* var,
2194 LookupResult* lookup, 2196 LookupResult* lookup,
2195 bool is_store); 2197 PropertyAccessType access_type);
2196 2198
2197 void EnsureArgumentsArePushedForAccess(); 2199 void EnsureArgumentsArePushedForAccess();
2198 bool TryArgumentsAccess(Property* expr); 2200 bool TryArgumentsAccess(Property* expr);
2199 2201
2200 // Try to optimize fun.apply(receiver, arguments) pattern. 2202 // Try to optimize fun.apply(receiver, arguments) pattern.
2201 bool TryCallApply(Call* expr); 2203 bool TryCallApply(Call* expr);
2202 2204
2203 HValue* ImplicitReceiverFor(HValue* function, 2205 HValue* ImplicitReceiverFor(HValue* function,
2204 Handle<JSFunction> target); 2206 Handle<JSFunction> target);
2205 2207
2206 int InliningAstSize(Handle<JSFunction> target); 2208 int InliningAstSize(Handle<JSFunction> target);
2207 bool TryInline(Handle<JSFunction> target, 2209 bool TryInline(Handle<JSFunction> target,
2208 int arguments_count, 2210 int arguments_count,
2209 HValue* implicit_return_value, 2211 HValue* implicit_return_value,
2210 BailoutId ast_id, 2212 BailoutId ast_id,
2211 BailoutId return_id, 2213 BailoutId return_id,
2212 InliningKind inlining_kind); 2214 InliningKind inlining_kind);
2213 2215
2214 bool TryInlineCall(Call* expr); 2216 bool TryInlineCall(Call* expr);
2215 bool TryInlineConstruct(CallNew* expr, HValue* implicit_return_value); 2217 bool TryInlineConstruct(CallNew* expr, HValue* implicit_return_value);
2216 bool TryInlineGetter(Handle<JSFunction> getter, 2218 bool TryInlineGetter(Handle<JSFunction> getter,
2219 Handle<Map> receiver_map,
2217 BailoutId ast_id, 2220 BailoutId ast_id,
2218 BailoutId return_id); 2221 BailoutId return_id);
2219 bool TryInlineSetter(Handle<JSFunction> setter, 2222 bool TryInlineSetter(Handle<JSFunction> setter,
2223 Handle<Map> receiver_map,
2220 BailoutId id, 2224 BailoutId id,
2221 BailoutId assignment_id, 2225 BailoutId assignment_id,
2222 HValue* implicit_return_value); 2226 HValue* implicit_return_value);
2223 bool TryInlineApply(Handle<JSFunction> function, 2227 bool TryInlineApply(Handle<JSFunction> function,
2224 Call* expr, 2228 Call* expr,
2225 int arguments_count); 2229 int arguments_count);
2226 bool TryInlineBuiltinMethodCall(Call* expr, 2230 bool TryInlineBuiltinMethodCall(Call* expr,
2227 HValue* receiver, 2231 HValue* receiver,
2228 Handle<Map> receiver_map); 2232 Handle<Map> receiver_map);
2229 bool TryInlineBuiltinFunctionCall(Call* expr); 2233 bool TryInlineBuiltinFunctionCall(Call* expr);
2234 enum ApiCallType {
2235 kCallApiFunction,
2236 kCallApiMethod,
2237 kCallApiGetter,
2238 kCallApiSetter
2239 };
2230 bool TryInlineApiMethodCall(Call* expr, 2240 bool TryInlineApiMethodCall(Call* expr,
2231 HValue* receiver, 2241 HValue* receiver,
2232 Handle<Map> receiver_map); 2242 SmallMapList* receiver_types);
2233 bool TryInlineApiFunctionCall(Call* expr, HValue* receiver); 2243 bool TryInlineApiFunctionCall(Call* expr, HValue* receiver);
2234 bool TryInlineApiCall(Call* expr, 2244 bool TryInlineApiGetter(Handle<JSFunction> function,
2235 HValue* receiver, 2245 Handle<Map> receiver_map,
2236 Handle<Map> receiver_map, 2246 BailoutId ast_id);
2237 bool is_function_call); 2247 bool TryInlineApiSetter(Handle<JSFunction> function,
2248 Handle<Map> receiver_map,
2249 BailoutId ast_id);
2250 bool TryInlineApiCall(Handle<JSFunction> function,
2251 HValue* receiver,
2252 SmallMapList* receiver_maps,
2253 int argc,
2254 BailoutId ast_id,
2255 ApiCallType call_type);
2238 2256
2239 // If --trace-inlining, print a line of the inlining trace. Inlining 2257 // If --trace-inlining, print a line of the inlining trace. Inlining
2240 // succeeded if the reason string is NULL and failed if there is a 2258 // succeeded if the reason string is NULL and failed if there is a
2241 // non-NULL reason string. 2259 // non-NULL reason string.
2242 void TraceInline(Handle<JSFunction> target, 2260 void TraceInline(Handle<JSFunction> target,
2243 Handle<JSFunction> caller, 2261 Handle<JSFunction> caller,
2244 const char* failure_reason); 2262 const char* failure_reason);
2245 2263
2246 void HandleGlobalVariableAssignment(Variable* var, 2264 void HandleGlobalVariableAssignment(Variable* var,
2247 HValue* value, 2265 HValue* value,
2248 BailoutId ast_id); 2266 BailoutId ast_id);
2249 2267
2250 void HandlePropertyAssignment(Assignment* expr); 2268 void HandlePropertyAssignment(Assignment* expr);
2251 void HandleCompoundAssignment(Assignment* expr); 2269 void HandleCompoundAssignment(Assignment* expr);
2252 void HandlePolymorphicLoadNamedField(BailoutId ast_id, 2270 void HandlePolymorphicNamedFieldAccess(PropertyAccessType access_type,
2253 BailoutId return_id, 2271 BailoutId ast_id,
2254 HValue* object, 2272 BailoutId return_id,
2255 SmallMapList* types, 2273 HValue* object,
2256 Handle<String> name); 2274 HValue* value,
2275 SmallMapList* types,
2276 Handle<String> name);
2257 2277
2258 void VisitTypedArrayInitialize(CallRuntime* expr); 2278 void VisitTypedArrayInitialize(CallRuntime* expr);
2259 2279
2260 bool IsCallNewArrayInlineable(CallNew* expr); 2280 bool IsCallNewArrayInlineable(CallNew* expr);
2261 void BuildInlinedCallNewArray(CallNew* expr); 2281 void BuildInlinedCallNewArray(CallNew* expr);
2262 2282
2263 void VisitDataViewInitialize(CallRuntime* expr); 2283 void VisitDataViewInitialize(CallRuntime* expr);
2264 2284
2265 class PropertyAccessInfo { 2285 class PropertyAccessInfo {
2266 public: 2286 public:
2267 PropertyAccessInfo(HOptimizedGraphBuilder* builder, 2287 PropertyAccessInfo(HOptimizedGraphBuilder* builder,
2268 Handle<HeapType> type, 2288 PropertyAccessType access_type,
2289 Type* type,
2269 Handle<String> name) 2290 Handle<String> name)
2270 : lookup_(builder->isolate()), 2291 : lookup_(builder->isolate()),
2271 builder_(builder), 2292 builder_(builder),
2293 access_type_(access_type),
2272 type_(type), 2294 type_(type),
2273 name_(name), 2295 name_(name),
2274 access_(HObjectAccess::ForMap()) { } 2296 access_(HObjectAccess::ForMap()) { }
2275 2297
2276 // Checkes whether this PropertyAccessInfo can be handled as a monomorphic 2298 // Checkes whether this PropertyAccessInfo can be handled as a monomorphic
2277 // load named. It additionally fills in the fields necessary to generate the 2299 // load named. It additionally fills in the fields necessary to generate the
2278 // lookup code. 2300 // lookup code.
2279 bool CanLoadMonomorphic(); 2301 bool CanAccessMonomorphic();
2280 2302
2281 // Checks whether all types behave uniform when loading name. If all maps 2303 // Checks whether all types behave uniform when loading name. If all maps
2282 // behave the same, a single monomorphic load instruction can be emitted, 2304 // behave the same, a single monomorphic load instruction can be emitted,
2283 // guarded by a single map-checks instruction that whether the receiver is 2305 // guarded by a single map-checks instruction that whether the receiver is
2284 // an instance of any of the types. 2306 // an instance of any of the types.
2285 // This method skips the first type in types, assuming that this 2307 // This method skips the first type in types, assuming that this
2286 // PropertyAccessInfo is built for types->first(). 2308 // PropertyAccessInfo is built for types->first().
2287 bool CanLoadAsMonomorphic(SmallMapList* types); 2309 bool CanAccessAsMonomorphic(SmallMapList* types);
2288 2310
2289 Handle<Map> map() { 2311 Handle<Map> map() {
2290 if (type_->Is(HeapType::Number())) { 2312 if (type_->Is(Type::Number())) {
2291 Context* context = current_info()->closure()->context(); 2313 Context* context = current_info()->closure()->context();
2292 context = context->native_context(); 2314 context = context->native_context();
2293 return handle(context->number_function()->initial_map()); 2315 return handle(context->number_function()->initial_map());
2294 } else if (type_->Is(HeapType::String())) { 2316 } else if (type_->Is(Type::Boolean())) {
2317 Context* context = current_info()->closure()->context();
2318 context = context->native_context();
2319 return handle(context->boolean_function()->initial_map());
2320 } else if (type_->Is(Type::String())) {
2295 Context* context = current_info()->closure()->context(); 2321 Context* context = current_info()->closure()->context();
2296 context = context->native_context(); 2322 context = context->native_context();
2297 return handle(context->string_function()->initial_map()); 2323 return handle(context->string_function()->initial_map());
2298 } else { 2324 } else {
2299 return type_->AsClass(); 2325 return type_->AsClass();
2300 } 2326 }
2301 } 2327 }
2302 Handle<HeapType> type() const { return type_; } 2328 Type* type() const { return type_; }
2303 Handle<String> name() const { return name_; } 2329 Handle<String> name() const { return name_; }
2304 2330
2305 bool IsJSObjectFieldAccessor() { 2331 bool IsJSObjectFieldAccessor() {
2306 int offset; // unused 2332 int offset; // unused
2307 return Accessors::IsJSObjectFieldAccessor(type_, name_, &offset); 2333 return Accessors::IsJSObjectFieldAccessor<Type>(type_, name_, &offset);
2308 } 2334 }
2309 2335
2310 bool GetJSObjectFieldAccess(HObjectAccess* access) { 2336 bool GetJSObjectFieldAccess(HObjectAccess* access) {
2311 if (IsArrayLength()) {
2312 *access = HObjectAccess::ForArrayLength(map()->elements_kind());
2313 return true;
2314 }
2315 int offset; 2337 int offset;
2316 if (Accessors::IsJSObjectFieldAccessor(type_, name_, &offset)) { 2338 if (Accessors::IsJSObjectFieldAccessor<Type>(type_, name_, &offset)) {
2317 if (type_->Is(HeapType::String())) { 2339 if (type_->Is(Type::String())) {
2318 ASSERT(name_->Equals(isolate()->heap()->length_string())); 2340 ASSERT(name_->Equals(isolate()->heap()->length_string()));
2319 *access = HObjectAccess::ForStringLength(); 2341 *access = HObjectAccess::ForStringLength();
2342 } else if (type_->Is(Type::Array())) {
2343 ASSERT(name_->Equals(isolate()->heap()->length_string()));
2344 *access = HObjectAccess::ForArrayLength(map()->elements_kind());
2320 } else { 2345 } else {
2321 *access = HObjectAccess::ForJSObjectOffset(offset); 2346 *access = HObjectAccess::ForMapAndOffset(map(), offset);
2322 } 2347 }
2323 return true; 2348 return true;
2324 } 2349 }
2325 return false; 2350 return false;
2326 } 2351 }
2327 2352
2328 bool has_holder() { return !holder_.is_null(); } 2353 bool has_holder() { return !holder_.is_null(); }
2354 bool IsLoad() const { return access_type_ == LOAD; }
2329 2355
2330 LookupResult* lookup() { return &lookup_; } 2356 LookupResult* lookup() { return &lookup_; }
2331 Handle<JSObject> holder() { return holder_; } 2357 Handle<JSObject> holder() { return holder_; }
2332 Handle<JSFunction> accessor() { return accessor_; } 2358 Handle<JSFunction> accessor() { return accessor_; }
2333 Handle<Object> constant() { return constant_; } 2359 Handle<Object> constant() { return constant_; }
2360 Handle<Object> transition() { return transition_; }
2334 HObjectAccess access() { return access_; } 2361 HObjectAccess access() { return access_; }
2335 2362
2336 private: 2363 private:
2364 Type* ToType(Handle<Map> map) { return builder_->ToType(map); }
2337 Isolate* isolate() { return lookup_.isolate(); } 2365 Isolate* isolate() { return lookup_.isolate(); }
2338 CompilationInfo* current_info() { return builder_->current_info(); } 2366 CompilationInfo* current_info() { return builder_->current_info(); }
2339 2367
2340 bool IsArrayLength() {
2341 return map()->instance_type() == JS_ARRAY_TYPE &&
2342 name_->Equals(isolate()->heap()->length_string());
2343 }
2344
2345 bool LoadResult(Handle<Map> map); 2368 bool LoadResult(Handle<Map> map);
2346 bool LookupDescriptor(); 2369 bool LookupDescriptor();
2347 bool LookupInPrototypes(); 2370 bool LookupInPrototypes();
2348 bool IsCompatibleForLoad(PropertyAccessInfo* other); 2371 bool IsCompatible(PropertyAccessInfo* other);
2349 2372
2350 void GeneralizeRepresentation(Representation r) { 2373 void GeneralizeRepresentation(Representation r) {
2351 access_ = access_.WithRepresentation( 2374 access_ = access_.WithRepresentation(
2352 access_.representation().generalize(r)); 2375 access_.representation().generalize(r));
2353 } 2376 }
2354 2377
2355 LookupResult lookup_; 2378 LookupResult lookup_;
2356 HOptimizedGraphBuilder* builder_; 2379 HOptimizedGraphBuilder* builder_;
2357 Handle<HeapType> type_; 2380 PropertyAccessType access_type_;
2381 Type* type_;
2358 Handle<String> name_; 2382 Handle<String> name_;
2359 Handle<JSObject> holder_; 2383 Handle<JSObject> holder_;
2360 Handle<JSFunction> accessor_; 2384 Handle<JSFunction> accessor_;
2385 Handle<JSObject> api_holder_;
2361 Handle<Object> constant_; 2386 Handle<Object> constant_;
2387 Handle<Map> transition_;
2362 HObjectAccess access_; 2388 HObjectAccess access_;
2363 }; 2389 };
2364 2390
2365 HInstruction* BuildLoadMonomorphic(PropertyAccessInfo* info, 2391 HInstruction* BuildMonomorphicAccess(PropertyAccessInfo* info,
2366 HValue* object, 2392 HValue* object,
2367 HValue* checked_object, 2393 HValue* checked_object,
2368 BailoutId ast_id, 2394 HValue* value,
2369 BailoutId return_id, 2395 BailoutId ast_id,
2370 bool can_inline_accessor = true); 2396 BailoutId return_id,
2397 bool can_inline_accessor = true);
2371 2398
2372 void HandlePolymorphicStoreNamedField(BailoutId assignment_id, 2399 HInstruction* BuildNamedAccess(PropertyAccessType access,
2373 HValue* object, 2400 BailoutId ast_id,
2374 HValue* value, 2401 BailoutId reutrn_id,
2375 SmallMapList* types, 2402 Expression* expr,
2376 Handle<String> name); 2403 HValue* object,
2377 bool TryStorePolymorphicAsMonomorphic(BailoutId assignment_id, 2404 Handle<String> name,
2378 HValue* object, 2405 HValue* value,
2379 HValue* value, 2406 bool is_uninitialized = false);
2380 SmallMapList* types, 2407
2381 Handle<String> name);
2382 void HandlePolymorphicCallNamed(Call* expr, 2408 void HandlePolymorphicCallNamed(Call* expr,
2383 HValue* receiver, 2409 HValue* receiver,
2384 SmallMapList* types, 2410 SmallMapList* types,
2385 Handle<String> name); 2411 Handle<String> name);
2386 void HandleLiteralCompareTypeof(CompareOperation* expr, 2412 void HandleLiteralCompareTypeof(CompareOperation* expr,
2387 Expression* sub_expr, 2413 Expression* sub_expr,
2388 Handle<String> check); 2414 Handle<String> check);
2389 void HandleLiteralCompareNil(CompareOperation* expr, 2415 void HandleLiteralCompareNil(CompareOperation* expr,
2390 Expression* sub_expr, 2416 Expression* sub_expr,
2391 NilValue nil); 2417 NilValue nil);
2392 HControlInstruction* BuildCompareInstruction(Token::Value op, 2418 HControlInstruction* BuildCompareInstruction(Token::Value op,
2393 HValue* left, 2419 HValue* left,
2394 HValue* right, 2420 HValue* right,
2395 Type* left_type, 2421 Type* left_type,
2396 Type* right_type, 2422 Type* right_type,
2397 Type* combined_type, 2423 Type* combined_type,
2398 int left_position, 2424 int left_position,
2399 int right_position, 2425 int right_position,
2400 BailoutId bailout_id); 2426 BailoutId bailout_id);
2401 2427
2402 HInstruction* BuildStringCharCodeAt(HValue* string, 2428 HInstruction* BuildStringCharCodeAt(HValue* string,
2403 HValue* index); 2429 HValue* index);
2404 HValue* BuildBinaryOperation(BinaryOperation* expr, 2430
2405 HValue* left, 2431 enum PushBeforeSimulateBehavior {
2406 HValue* right); 2432 PUSH_BEFORE_SIMULATE,
2433 NO_PUSH_BEFORE_SIMULATE
2434 };
2435 HValue* BuildBinaryOperation(
2436 BinaryOperation* expr,
2437 HValue* left,
2438 HValue* right,
2439 PushBeforeSimulateBehavior push_sim_result);
2407 HInstruction* BuildIncrement(bool returns_original_input, 2440 HInstruction* BuildIncrement(bool returns_original_input,
2408 CountOperation* expr); 2441 CountOperation* expr);
2409 HInstruction* BuildLoadKeyedGeneric(HValue* object, 2442 HInstruction* BuildKeyedGeneric(PropertyAccessType access_type,
2410 HValue* key); 2443 HValue* object,
2444 HValue* key,
2445 HValue* value);
2411 2446
2412 HInstruction* TryBuildConsolidatedElementLoad(HValue* object, 2447 HInstruction* TryBuildConsolidatedElementLoad(HValue* object,
2413 HValue* key, 2448 HValue* key,
2414 HValue* val, 2449 HValue* val,
2415 SmallMapList* maps); 2450 SmallMapList* maps);
2416 2451
2417 LoadKeyedHoleMode BuildKeyedHoleMode(Handle<Map> map); 2452 LoadKeyedHoleMode BuildKeyedHoleMode(Handle<Map> map);
2418 2453
2419 HInstruction* BuildMonomorphicElementAccess(HValue* object, 2454 HInstruction* BuildMonomorphicElementAccess(HValue* object,
2420 HValue* key, 2455 HValue* key,
2421 HValue* val, 2456 HValue* val,
2422 HValue* dependency, 2457 HValue* dependency,
2423 Handle<Map> map, 2458 Handle<Map> map,
2424 bool is_store, 2459 PropertyAccessType access_type,
2425 KeyedAccessStoreMode store_mode); 2460 KeyedAccessStoreMode store_mode);
2426 2461
2427 HValue* HandlePolymorphicElementAccess(HValue* object, 2462 HValue* HandlePolymorphicElementAccess(HValue* object,
2428 HValue* key, 2463 HValue* key,
2429 HValue* val, 2464 HValue* val,
2430 SmallMapList* maps, 2465 SmallMapList* maps,
2431 bool is_store, 2466 PropertyAccessType access_type,
2432 KeyedAccessStoreMode store_mode, 2467 KeyedAccessStoreMode store_mode,
2433 bool* has_side_effects); 2468 bool* has_side_effects);
2434 2469
2435 HValue* HandleKeyedElementAccess(HValue* obj, 2470 HValue* HandleKeyedElementAccess(HValue* obj,
2436 HValue* key, 2471 HValue* key,
2437 HValue* val, 2472 HValue* val,
2438 Expression* expr, 2473 Expression* expr,
2439 bool is_store, 2474 PropertyAccessType access_type,
2440 bool* has_side_effects); 2475 bool* has_side_effects);
2441 2476
2442 HInstruction* BuildLoadNamedGeneric(HValue* object, 2477 HInstruction* BuildNamedGeneric(PropertyAccessType access,
2443 Handle<String> name, 2478 HValue* object,
2444 Property* expr); 2479 Handle<String> name,
2480 HValue* value,
2481 bool is_uninitialized = false);
2445 2482
2446 HCheckMaps* AddCheckMap(HValue* object, Handle<Map> map); 2483 HCheckMaps* AddCheckMap(HValue* object, Handle<Map> map);
2447 2484
2448 void BuildLoad(Property* property, 2485 void BuildLoad(Property* property,
2449 BailoutId ast_id); 2486 BailoutId ast_id);
2450 void PushLoad(Property* property, 2487 void PushLoad(Property* property,
2451 HValue* object, 2488 HValue* object,
2452 HValue* key); 2489 HValue* key);
2453 2490
2454 void BuildStoreForEffect(Expression* expression, 2491 void BuildStoreForEffect(Expression* expression,
2455 Property* prop, 2492 Property* prop,
2456 BailoutId ast_id, 2493 BailoutId ast_id,
2457 BailoutId return_id, 2494 BailoutId return_id,
2458 HValue* object, 2495 HValue* object,
2459 HValue* key, 2496 HValue* key,
2460 HValue* value); 2497 HValue* value);
2461 2498
2462 void BuildStore(Expression* expression, 2499 void BuildStore(Expression* expression,
2463 Property* prop, 2500 Property* prop,
2464 BailoutId ast_id, 2501 BailoutId ast_id,
2465 BailoutId return_id, 2502 BailoutId return_id,
2466 bool is_uninitialized = false); 2503 bool is_uninitialized = false);
2467 2504
2468 HInstruction* BuildStoreNamedField(HValue* object, 2505 HInstruction* BuildStoreNamedField(PropertyAccessInfo* info,
2469 Handle<String> name, 2506 HValue* checked_object,
2470 HValue* value, 2507 HValue* value);
2471 Handle<Map> map,
2472 LookupResult* lookup);
2473 HInstruction* BuildStoreNamedGeneric(HValue* object,
2474 Handle<String> name,
2475 HValue* value);
2476 HInstruction* BuildStoreNamedMonomorphic(HValue* object,
2477 Handle<String> name,
2478 HValue* value,
2479 Handle<Map> map);
2480 HInstruction* BuildStoreKeyedGeneric(HValue* object,
2481 HValue* key,
2482 HValue* value);
2483 2508
2484 HValue* BuildContextChainWalk(Variable* var); 2509 HValue* BuildContextChainWalk(Variable* var);
2485 2510
2486 HInstruction* BuildThisFunction(); 2511 HInstruction* BuildThisFunction();
2487 2512
2488 HInstruction* BuildFastLiteral(Handle<JSObject> boilerplate_object, 2513 HInstruction* BuildFastLiteral(Handle<JSObject> boilerplate_object,
2489 AllocationSiteUsageContext* site_context); 2514 AllocationSiteUsageContext* site_context);
2490 2515
2491 void BuildEmitObjectHeader(Handle<JSObject> boilerplate_object, 2516 void BuildEmitObjectHeader(Handle<JSObject> boilerplate_object,
2492 HInstruction* object); 2517 HInstruction* object);
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
2712 } 2737 }
2713 2738
2714 private: 2739 private:
2715 HGraphBuilder* builder_; 2740 HGraphBuilder* builder_;
2716 }; 2741 };
2717 2742
2718 2743
2719 } } // namespace v8::internal 2744 } } // namespace v8::internal
2720 2745
2721 #endif // V8_HYDROGEN_H_ 2746 #endif // V8_HYDROGEN_H_
OLDNEW
« no previous file with comments | « src/heap-snapshot-generator.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698