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

Side by Side Diff: src/interpreter/bytecode-generator.cc

Issue 2745413006: Revert of Collect type profile for DevTools. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/interpreter/bytecode-generator.h" 5 #include "src/interpreter/bytecode-generator.h"
6 6
7 #include "src/ast/compile-time-value.h" 7 #include "src/ast/compile-time-value.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/builtins/builtins-constructor.h" 9 #include "src/builtins/builtins-constructor.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after
2204 DCHECK(expr->target()->IsValidReferenceExpressionOrThis()); 2204 DCHECK(expr->target()->IsValidReferenceExpressionOrThis());
2205 Register object, key; 2205 Register object, key;
2206 RegisterList super_property_args; 2206 RegisterList super_property_args;
2207 const AstRawString* name; 2207 const AstRawString* name;
2208 2208
2209 // Left-hand side can only be a property, a global or a variable slot. 2209 // Left-hand side can only be a property, a global or a variable slot.
2210 Property* property = expr->target()->AsProperty(); 2210 Property* property = expr->target()->AsProperty();
2211 LhsKind assign_type = Property::GetAssignType(property); 2211 LhsKind assign_type = Property::GetAssignType(property);
2212 2212
2213 // Evaluate LHS expression. 2213 // Evaluate LHS expression.
2214 Register lhs_name;
2215 if (expr->HasTypeProfileSlot()) {
2216 lhs_name = register_allocator()->NewRegister();
2217 }
2218
2219 switch (assign_type) { 2214 switch (assign_type) {
2220 case VARIABLE: 2215 case VARIABLE:
2221 if (expr->HasTypeProfileSlot()) {
2222 builder()
2223 ->LoadLiteral(expr->target()->AsVariableProxy()->var()->raw_name())
2224 .StoreAccumulatorInRegister(lhs_name);
2225 }
2226 // Nothing to do to evaluate variable assignment LHS. 2216 // Nothing to do to evaluate variable assignment LHS.
2227 break; 2217 break;
2228 case NAMED_PROPERTY: { 2218 case NAMED_PROPERTY: {
2229 object = VisitForRegisterValue(property->obj()); 2219 object = VisitForRegisterValue(property->obj());
2230 name = property->key()->AsLiteral()->AsRawPropertyName(); 2220 name = property->key()->AsLiteral()->AsRawPropertyName();
2231 if (expr->HasTypeProfileSlot()) {
2232 builder()->LoadLiteral(name).StoreAccumulatorInRegister(lhs_name);
2233 }
2234 break; 2221 break;
2235 } 2222 }
2236 case KEYED_PROPERTY: { 2223 case KEYED_PROPERTY: {
2237 object = VisitForRegisterValue(property->obj()); 2224 object = VisitForRegisterValue(property->obj());
2238 key = VisitForRegisterValue(property->key()); 2225 key = VisitForRegisterValue(property->key());
2239 if (expr->HasTypeProfileSlot()) {
2240 builder()->StoreAccumulatorInRegister(lhs_name);
2241 }
2242 break; 2226 break;
2243 } 2227 }
2244 case NAMED_SUPER_PROPERTY: { 2228 case NAMED_SUPER_PROPERTY: {
2245 super_property_args = register_allocator()->NewRegisterList(4); 2229 super_property_args = register_allocator()->NewRegisterList(4);
2246 SuperPropertyReference* super_property = 2230 SuperPropertyReference* super_property =
2247 property->obj()->AsSuperPropertyReference(); 2231 property->obj()->AsSuperPropertyReference();
2248 VisitForRegisterValue(super_property->this_var(), super_property_args[0]); 2232 VisitForRegisterValue(super_property->this_var(), super_property_args[0]);
2249 VisitForRegisterValue(super_property->home_object(), 2233 VisitForRegisterValue(super_property->home_object(),
2250 super_property_args[1]); 2234 super_property_args[1]);
2251 builder() 2235 builder()
2252 ->LoadLiteral(property->key()->AsLiteral()->AsRawPropertyName()) 2236 ->LoadLiteral(property->key()->AsLiteral()->AsRawPropertyName())
2253 .StoreAccumulatorInRegister(super_property_args[2]); 2237 .StoreAccumulatorInRegister(super_property_args[2]);
2254 if (expr->HasTypeProfileSlot()) {
2255 builder()->StoreAccumulatorInRegister(lhs_name);
2256 }
2257 break; 2238 break;
2258 } 2239 }
2259 case KEYED_SUPER_PROPERTY: { 2240 case KEYED_SUPER_PROPERTY: {
2260 super_property_args = register_allocator()->NewRegisterList(4); 2241 super_property_args = register_allocator()->NewRegisterList(4);
2261 SuperPropertyReference* super_property = 2242 SuperPropertyReference* super_property =
2262 property->obj()->AsSuperPropertyReference(); 2243 property->obj()->AsSuperPropertyReference();
2263 VisitForRegisterValue(super_property->this_var(), super_property_args[0]); 2244 VisitForRegisterValue(super_property->this_var(), super_property_args[0]);
2264 VisitForRegisterValue(super_property->home_object(), 2245 VisitForRegisterValue(super_property->home_object(),
2265 super_property_args[1]); 2246 super_property_args[1]);
2266 VisitForRegisterValue(property->key(), super_property_args[2]); 2247 VisitForRegisterValue(property->key(), super_property_args[2]);
2267 if (expr->HasTypeProfileSlot()) {
2268 builder()->StoreAccumulatorInRegister(lhs_name);
2269 }
2270
2271 break; 2248 break;
2272 } 2249 }
2273 } 2250 }
2274 2251
2275 // Evaluate the value and potentially handle compound assignments by loading 2252 // Evaluate the value and potentially handle compound assignments by loading
2276 // the left-hand side value and performing a binary operation. 2253 // the left-hand side value and performing a binary operation.
2277 if (expr->is_compound()) { 2254 if (expr->is_compound()) {
2278 Register old_value = register_allocator()->NewRegister(); 2255 Register old_value = register_allocator()->NewRegister();
2279 switch (assign_type) { 2256 switch (assign_type) {
2280 case VARIABLE: { 2257 case VARIABLE: {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
2349 .CallRuntime(StoreToSuperRuntimeId(), super_property_args); 2326 .CallRuntime(StoreToSuperRuntimeId(), super_property_args);
2350 break; 2327 break;
2351 } 2328 }
2352 case KEYED_SUPER_PROPERTY: { 2329 case KEYED_SUPER_PROPERTY: {
2353 builder() 2330 builder()
2354 ->StoreAccumulatorInRegister(super_property_args[3]) 2331 ->StoreAccumulatorInRegister(super_property_args[3])
2355 .CallRuntime(StoreKeyedToSuperRuntimeId(), super_property_args); 2332 .CallRuntime(StoreKeyedToSuperRuntimeId(), super_property_args);
2356 break; 2333 break;
2357 } 2334 }
2358 } 2335 }
2359
2360 // Value is in accumulator.
2361 if (expr->HasTypeProfileSlot()) {
2362 FeedbackSlot collect_type_feedback_slot = expr->TypeProfileSlot();
2363
2364 builder()->CollectTypeProfile(lhs_name,
2365 feedback_index(collect_type_feedback_slot));
2366 }
2367 } 2336 }
2368 2337
2369 void BytecodeGenerator::VisitYield(Yield* expr) { 2338 void BytecodeGenerator::VisitYield(Yield* expr) {
2370 builder()->SetExpressionPosition(expr); 2339 builder()->SetExpressionPosition(expr);
2371 Register value = VisitForRegisterValue(expr->expression()); 2340 Register value = VisitForRegisterValue(expr->expression());
2372 2341
2373 Register generator = VisitForRegisterValue(expr->generator_object()); 2342 Register generator = VisitForRegisterValue(expr->generator_object());
2374 2343
2375 // Save context, registers, and state. Then return. 2344 // Save context, registers, and state. Then return.
2376 builder() 2345 builder()
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after
3519 } 3488 }
3520 3489
3521 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { 3490 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() {
3522 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict 3491 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict
3523 : Runtime::kStoreKeyedToSuper_Sloppy; 3492 : Runtime::kStoreKeyedToSuper_Sloppy;
3524 } 3493 }
3525 3494
3526 } // namespace interpreter 3495 } // namespace interpreter
3527 } // namespace internal 3496 } // namespace internal
3528 } // namespace v8 3497 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698